Search Results

Search found 370 results on 15 pages for 'csharp'.

Page 6/15 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • reverse this function

    - by ooo
    i have code that takes a csharp datetime and converts it into a long to plot in the "flot" graph. here is the code public static long GetJavascriptTimestamp(DateTime input) { TimeSpan span = new TimeSpan(DateTime.Parse("1/1/1970").Ticks); DateTime time = input.Subtract(span); return (long)(time.Ticks / 10000); } I now need an opposite function where i take this long value and get the csharp datetime object back. any idea if the above method can be reversed ?

    Read the article

  • Regex to extract a string between two delimeters WITHOUT also returning the delimeters?

    - by CSharp Noob
    Hello, I want to just extract the text between the brackets -- NOT the brackets, too! My code looks currently like this: var source = "Harley, J. Jesse Dead Game (2009) [Guard]" // Extract role with regex m = Regex.Match(source, @"[(.*)]"); var role = m.Groups[0].Value; // role is now "[Guard]" role = role.Substring(1, role.Length-2); // role is now "Guard" Can you help me to simplify this to just a single regex, instead of the regex, then the substring?

    Read the article

  • How to implement collapsible sections like on this .aspx page?

    - by CSharp Noob
    This .aspx page has a very nice set of collapsible sections with a little "+ -" control. http://www.microsoft.com/sqlserver/2008/en/us/editions-compare.aspx Can anyone tell me how this might be done in Visual Studio? I have tried using firebug to deconstruct the page but can't find the script that is doing the showCollapsibleItem() call. Thank you!

    Read the article

  • TCPClient in C# (Error).

    - by CSharp
    using System; using System.Text; using System.IO; using System.Net.Sockets; namespace ConsoleApp01 { class Program { public static void Main(string[] args) { TcpClient client = new TcpClient("python.org",80); NetworkStream ns = client.GetStream(); StreamWriter sw = new StreamWriter(ns); sw.Write("HEAD / HTTP/1.1\r\n" + "User-Agent: Test\r\n" + "Host: www.python.org\r\n" + "Connection: Close\r\n"); sw.Flush(); Console.ReadKey(true); } } } System.Net.Sockets.SocketException: Unable to make a connection because the target machine actively refused it at System.Net.Sockets.TcpClient..ctor at ConsoleApp01.Program.Main :line 12 Why do i get this error message?

    Read the article

  • Overriding Page class constructor in ASP.NET code-behind file -- when is it called?

    - by CSharp Noob
    If I override the System.Web.UI.Page constructor, as shown, when does DoSomething() get called in terms of the page lifecycle? I can't seem to find this documented anywhere. namespace NameSpace1 { public partial class MyClass : System.Web.UI.Page { public MyClass() { DoSomething(); } protected void Page_Load(object sender, EventArgs e) { } } } For reference, here is the ASP.NET Page Lifecycle Overview: http://msdn.microsoft.com/en-us/library/ms178472.aspx Turns out the best answer was right in the MSDN article. I just had to look carefully at the diagram.

    Read the article

  • A Better way? Finding ASP.NET controls, finding their id

    - by CSharp
    I have a method that finds all the controls, iterates through them, determines if they are a textbox,drop down list, etc.. retrieves their ID name, and depending on the ID name it will set a boolean statement (thus I would know if that section of the form is complete, and will email to a certain group of people) unfortunetly this is done with too many if statements and was wondering if I could get some help making this more manageable protected void getEmailGroup() { Control[] allControls = FlattenHierachy(Page); foreach (Control control in allControls) { if (control.ID != null) { if (control is TextBox) { TextBox txt = control as TextBox; if (txt.Text != "") { if (control.ID.StartsWith("GenInfo_")) { GenInfo = true; } if (control.ID.StartsWith("EmpInfo_")) { EmpInfo = true; } } } if (control is DropDownList) { DropDownList lb = control as DropDownList; if (lb.SelectedIndex != -1) { if (control.ID.StartsWith("GenInfo_")) { GenInfo = true; } if (control.ID.StartsWith("EmpInfo_")) { EmpInfo = true; } } } } } }

    Read the article

  • A Better way? C# finding controls, finding their id,

    - by CSharp
    I have a method that finds all the controls, iterates through them, determines if they are a textbox,drop down list, etc.. retrieves their ID name, and depending on the ID name it will set a boolean statement (thus I would know if that section of the form is complete, and will email to a certain group of people) unfortunetly this is done with too many if statements and was wondering if I could get some help making this more manageable ` protected void getEmailGroup() { Control[] allControls = FlattenHierachy(Page); foreach (Control control in allControls) { if (control.ID != null) { if (control is TextBox) { TextBox txt = control as TextBox; if (txt.Text != "") { if (control.ID.StartsWith("GenInfo_")) { GenInfo = true; } if (control.ID.StartsWith("EmpInfo_")) { EmpInfo = true; } } } if (control is DropDownList) { DropDownList lb = control as DropDownList; if (lb.SelectedIndex != -1) { if (control.ID.StartsWith("GenInfo_")) { GenInfo = true; } if (control.ID.StartsWith("EmpInfo_")) { EmpInfo = true; } } } } } }`.

    Read the article

  • VB.NET IF() Coalesce and “Expression Expected” Error

    - by Jeff Widmer
    I am trying to use the equivalent of the C# “??” operator in some VB.NET code that I am working in. This StackOverflow article for “Is there a VB.NET equivalent for C#'s ?? operator?” explains the VB.NET IF() statement syntax which is exactly what I am looking for... and I thought I was going to be done pretty quickly and could move on. But after implementing the IF() statement in my code I started to receive this error: Compiler Error Message: BC30201: Expression expected. And no matter how I tried using the “IF()” statement, whenever I tried to visit the aspx page that I was working on I received the same error. This other StackOverflow article Using VB.NET If vs. IIf in binding/rendering expression indicated that the VB.NET IF() operator was not available until VS2008 or .NET Framework 3.5.  So I checked the Web Application project properties but it was targeting the .NET Framework 3.5: So I was still not understanding what was going on, but then I noticed the version information in the detailed compiler output of the error page: This happened to be a C# project, but with an ASPX page with inline VB.NET code (yes, it is strange to have that but that is the project I am working on).  So even though the project file was targeting the .NET Framework 3.5, the ASPX page was being compiled using the .NET Framework 2.0.  But why?  Where does this get set?  How does ASP.NET know which version of the compiler to use for the inline code? For this I turned to the web.config.  Here is the system.codedom/compilers section that was in the web.config for this project: <system.codedom>     <compilers>         <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">             <providerOption name="CompilerVersion" value="v3.5" />             <providerOption name="WarnAsError" value="false" />         </compiler>     </compilers> </system.codedom> Keep in mind that this is a C# web application project file but my aspx file has inline VB.NET code.  The web.config does not have any information for how to compile for VB.NET so it defaults to .NET 2.0 (instead of 3.5 which is what I need). So the web.config needed to include the VB.NET compiler option.  Here it is with both the C# and VB.NET options (I copied the VB.NET config from a new VB.NET Web Application project file).     <system.codedom>         <compilers>             <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">                 <providerOption name="CompilerVersion" value="v3.5" />                 <providerOption name="WarnAsError" value="false" />             </compiler>       <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">         <providerOption name="CompilerVersion" value="v3.5"/>         <providerOption name="OptionInfer" value="true"/>         <providerOption name="WarnAsError" value="false"/>       </compiler>     </compilers>     </system.codedom>   So the inline VB.NET code on my aspx page was being compiled using the .NET Framework 2.0 when it really needed to be compiled with the .NET Framework 3.5 compiler in order to take advantage of the VB.NET IF() coalesce statement.  Without the VB.NET web.config compiler option, the default is to compile using the .NET Framework 2.0 and the VB.NET IF() coalesce statement does not exist (at least in the form that I want it in).  FYI, there is an older IF statement in VB.NET 2.0 compiler which is why it is giving me the unusual “Expression Expected” error message – see this article for when VB.NET got the new updated version. EDIT (2011-06-20): I had made a wrong assumption in the first version of this blog post.  After a little more research and investigation I was able to figure out that the issue was in the web.config and not with the IIS App Pool.  Thanks to the comment from James which forced me to look into this again.

    Read the article

  • how to convert bitmap image to CIELab image?

    - by Neal Davis
    Hello to stackoverflow members! This is my first post but I love reading the questions and answers on this forum! I'm using VS2008, CSharp, NET 3.5 and Windows XP Pro latest patches on this project. I am reading in a jpeg file to a bitmap image using CSharp in the following way: Bitmap bmp = new Bitmap("background.jpg"); Graphics g = Graphics.FromImage(bmp); I then write some text and logos on g using various DrawString and DrawImage commands. I then want to write this bitmap to a tiff file using the command: bmp.Save("final_artwork.tif", ImageFormat.Tiff); I don't know what the TIFF tags in the header of the final resultant TIFF file will be when you do bmp.Save as shown above? But what I want to produce is a TIFF image file with PHOTOMETRIC CIELab, BITSPERSAMPLE 8, SAMPLESPERPIXEL 3, FILLORDER MSB2LSB, ORIENTATION TOPLEFT, PLANARCONFIG CONTIG, and also uncompressed and singlestrip. Im fairly certain, at least I have not found anything about Microsoft API and CIELab, I can not convert the bitmap image to CIELab photometric and the other requirements using anything from the Microsoft API or .NET 3.5 environment - someone please correct if I am wrong. I have used libtiff in a project in the past but just to write a tiff file where the tiff image in memory was already in CIELab format and all the other requirements as noted per above. Im not certain libtiff can convert from my CSharp bitmap image, which is probably RGB photometric, to CIELab, 8 bps, and 3 spp? Maybe I can use OpenCVImage or Emgu CV or something similiar? So the main question is what is going to be the easiest way to get my final bitmap image as outlined above into a CIELab TIFF and also meeting the other requirements per above? Thanks for any suggestions and code fragments you can provide? Neal Davis

    Read the article

  • Generating PDF Files With iTextSharp

    - by Ricardo Peres
    I recently had the need to generate a PDF file containing a table where some of the cells included images. Of course, I used iTextSharp to do it. Because it has some obscure parts, I decided to publish a simplified version of the code I used. using iTextSharp; using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.text.html; //... protected void OnGeneratePdfClick() { String text = "Multi\nline\ntext"; String name = "Some Name"; String number = "12345"; Int32 rows = 7; Int32 cols = 3; Single headerHeight = 47f; Single footerHeight = 45f; Single rowHeight = 107.4f; String pdfName = String.Format("Labels - {0}", name); PdfPTable table = new PdfPTable(3) { WidthPercentage = 100, HeaderRows = 1 }; PdfPCell headerCell = new PdfPCell(new Phrase("Header")) { Colspan = cols, FixedHeight = headerHeight, HorizontalAlignment = Element.ALIGN_CENTER, BorderWidth = 0f }; table.AddCell(headerCell); FontFactory.RegisterDirectory(@"C:\WINDOWS\Fonts"); //required for the Verdana font Font cellFont = FontFactory.GetFont("Verdana", 6f, Font.NORMAL); for (Int32 r = 0; r SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.0.320/scripts/clipboard.swf'; SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; SyntaxHighlighter.all();

    Read the article

  • Loading a Template From a User Control

    - by Ricardo Peres
    What if you wanted to load a template (ITemplate property) from an external user control (.ascx) file? Yes, it is possible; there are a number of ways to do this, the one I'll talk about here is through a type converter. You need to apply a TypeConverterAttribute to your ITemplate property where you specify a custom type converter that does the job. This type converter relies on InstanceDescriptor. Here is the code for it: public class TemplateTypeConverter: TypeConverter { public override Boolean CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return ((sourceType == typeof(String)) || (base.CanConvertFrom(context, sourceType) == true)); } public override Boolean CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return ((destinationType == typeof(InstanceDescriptor)) || (base.CanConvertTo(context, destinationType) == true)); } public override Object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { Object objectFactory = value.GetType().GetField("_objectFactory", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(value); Object builtType = objectFactory.GetType().BaseType.GetField("_builtType", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(objectFactory); MethodInfo loadTemplate = typeof(TemplateTypeConverter).GetMethod("LoadTemplate"); return (new InstanceDescriptor(loadTemplate, new Object [] { "~/" + (builtType as Type).Name.Replace('_', '/').Replace("/ascx", ".ascx") })); } return base.ConvertTo(context, culture, value, destinationType); } public static ITemplate LoadTemplate(String virtualPath) { using (Page page = new Page()) { return (page.LoadTemplate(virtualPath)); } } } And, on your control: public class MyControl: Control { [Browsable(false)] [TypeConverter(typeof(TemplateTypeConverter))] public ITemplate Template { get; set; } } This allows the following declaration: Hope this helps! SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.0.320/scripts/clipboard.swf'; SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; SyntaxHighlighter.brushes.Xml.aliases = ['xml']; SyntaxHighlighter.all();

    Read the article

  • Initially Unselected DropDownList

    - by Ricardo Peres
    One of the most (IMHO) things with DropDownList is its inability to show an unselected value at load time, which is something that HTML does permit. I decided to change the DropDownList to add this behavior. All was needed was some JavaScript and reflection. See the result for yourself: public class CustomDropDownList : DropDownList { public CustomDropDownList() { this.InitiallyUnselected = true; } [DefaultValue(true)] public Boolean InitiallyUnselected { get; set; } protected override void OnInit(EventArgs e) { this.Page.RegisterRequiresControlState(this); this.Page.PreRenderComplete += this.OnPreRenderComplete; base.OnInit(e); } protected virtual void OnPreRenderComplete(Object sender, EventArgs args) { FieldInfo cachedSelectedValue = typeof(ListControl).GetField("cachedSelectedValue", BindingFlags.NonPublic | BindingFlags.Instance); if (String.IsNullOrEmpty(cachedSelectedValue.GetValue(this) as String) == true) { if (this.InitiallyUnselected == true) { if ((ScriptManager.GetCurrent(this.Page) != null) && (ScriptManager.GetCurrent(this.Page).IsInAsyncPostBack == true)) { ScriptManager.RegisterStartupScript(this, this.GetType(), "unselect" + this.ClientID, "$get('" + this.ClientID + "').selectedIndex = -1;", true); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "unselect" + this.ClientID, "$get('" + this.ClientID + "').selectedIndex = -1;", true); } } } } } SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.0.320/scripts/clipboard.swf'; SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; SyntaxHighlighter.all();

    Read the article

  • Dynamic LINQ in an Assembly Near By

    - by Ricardo Peres
    You may recall my post on Dynamic LINQ. I said then that you had to download Microsoft's samples and compile the DynamicQuery project (or just grab my copy), but there's another way. It turns out Microsoft included the Dynamic LINQ classes in the System.Web.Extensions assembly, not the one from ASP.NET 2.0, but the one that was included with ASP.NET 3.5! The only problem is that all types are private: Here's how to use it: Assembly asm = typeof(UpdatePanel).Assembly; Type dynamicExpressionType = asm.GetType("System.Web.Query.Dynamic.DynamicExpression"); MethodInfo parseLambdaMethod = dynamicExpressionType.GetMethods(BindingFlags.Public | BindingFlags.Static).Where(m = (m.Name == "ParseLambda") && (m.GetParameters().Length == 2)).Single().MakeGenericMethod(typeof(DateTime), typeof(Boolean)); Func filterExpression = (parseLambdaMethod.Invoke(null, new Object [] { "Year == 2010", new Object [ 0 ] }) as Expression).Compile(); List list = new List { new DateTime(2010, 1, 1), new DateTime(1999, 1, 12), new DateTime(1900, 10, 10), new DateTime(1900, 2, 20), new DateTime(2012, 5, 5), new DateTime(2012, 1, 20) }; IEnumerable filteredDates = list.Where(filterExpression); SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.0.320/scripts/clipboard.swf'; SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; SyntaxHighlighter.all();

    Read the article

  • VS2012 - How to manually convert .NET Class Library to a Portable Class Library

    - by Igor Milovanovic
    The portable libraries are the  response to the growing profile fragmentation in .NET frameworks. With help of portable libraries you can share code between different runtimes without dreadful #ifdef PLATFORM statements or even worse “Add as Link” source file sharing practices. If you have an existing .net class library which you would like to reference from a different runtime (e.g. you have a .NET Framework 4.5 library which you would like to reference from a Windows Store project), you can either create a new portable class library and move the classes there or edit the existing .csproj file and change the XML directly. The following example shows how to convert a .NET Framework 4.5 library to a Portable Class Library. First Unload the Project and change the following settings in the .csproj file: <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> to: <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable \$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> and add the following keys to the first property group in order to get visual studio to show the framework picker dialog: <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB}; {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>   After that you can select the frameworks in the Library Tab of the Portable Library:   As last step, delete any framework references from the library as you have them already referenced via the .NET Portable Subset.     [1] Cross-Platform Development with the .NET Framework - http://msdn.microsoft.com/en-us/library/gg597391.aspx [2] Framework Profiles in .NET: http://nitoprograms.blogspot.de/2012/05/framework-profiles-in-net.html

    Read the article

  • Yet Another Way To Create An Object

    - by Ricardo Peres
    After I wrote this post, I come up with yet another way to create an object... Here it is: Stopwatch watch = new Stopwatch(); ConstructorInfo ci = typeof(StringBuilder).GetConstructor(new Type[0]); NewExpression expr = Expression.New(ci); Func<StringBuilder> func = Expression.Lambda(typeof(Func<StringBuilder>), expr).Compile() as Func<StringBuilder>; watch.Start(); for (Int32 i = 0; i < 100; ++i) { StringBuilder builder = func(); } Int64 time4 = watch.ElapsedTicks; watch.Reset(); I know of only one other way, which is by using CodeDOM. If you know of any other ways to create an object, let me know! SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.0.320/scripts/clipboard.swf'; SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; SyntaxHighlighter.all();

    Read the article

  • Creating a Sandboxed Instance

    - by Ricardo Peres
    In .NET 4.0 the policy APIs have changed a bit. Here's how you can create a sandboxed instance of a type, which must inherit from MarshalByRefObject: static T CreateRestrictedType<T>(SecurityZone zone, params Assembly [] fullTrustAssemblies) where T : MarshalByRefObject, new() { return(CreateRestrictedType<T>(zone, fullTrustAssemblies, new IPermission [0]); } static T CreateRestrictedType<T>(SecurityZone zone, params IPermission [] additionalPermissions) where T : MarshalByRefObject, new() { return(CreateRestrictedType<T>(zone, new Assembly [0], additionalPermissions); } static T CreateRestrictedType<T>(SecurityZone zone, Assembly [] fullTrustAssemblies, IPermission [] additionalPermissions) where T : MarshalByRefObject, new() { Evidence evidence = new Evidence(); evidence.AddHostEvidence(new Zone(zone)); PermissionSet evidencePermissionSet = SecurityManager.GetStandardSandbox(evidence); foreach (IPermission permission in additionalPermissions ?? new IPermission[ 0 ]) { evidencePermissionSet.AddPermission(permission); } StrongName [] strongNames = (fullTrustAssemblies ?? new Assembly[0]).Select(a = a.Evidence.GetHostEvidence<StrongName>()).ToArray(); AppDomainSetup adSetup = new AppDomainSetup(); adSetup.ApplicationBase = Path.GetDirectoryName(typeof(T).Assembly.Location); AppDomain newDomain = AppDomain.CreateDomain("Sandbox", evidence, adSetup, evidencePermissionSet, strongNames); ObjectHandle handle = Activator.CreateInstanceFrom(newDomain, typeof(T).Assembly.ManifestModule.FullyQualifiedName, typeof(T).FullName); return (handle.Unwrap() as T); } SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.0.320/scripts/clipboard.swf'; SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; SyntaxHighlighter.all();

    Read the article

  • VS2010 - Add template to New Project window

    - by gbogumil
    I am trying to add a new project template for an often used pattern. Starting from the class library template I have done the following (it still does not show up in the new project window): opened the .vstemplate file changed name and description to 'hard coded' values (my template). The values in there pulled from the csharpui.dll resources. changed the TemplateID, DefaultName, and ProjectItems included. saved these to the ProjectemplatesCache folder and as a zip in the ProjectTemplates folder. restarted VS2010 and checked the new project location which should have shown my new template. specifically, the folders I saved to were.. C:\program files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache\CSharp\Windows\1033\HostComm.zip (the zip is the folder name, not a zip file) and C:\program files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Windows\1033 (this folder has a HostComm.zip file in it) Has anyone else done this? Can it be done? If it can then what did I miss?

    Read the article

  • Rewriting VB.NET Lambda experession as a C# statement

    - by ChadD
    I downgraded my app from version 4 of the framework to version 4 and now I want to implement this VB.NET lambda function statement (which works on 3.5) Dim colLambda As ColumnItemValueAccessor = Function(rowItem As Object) General_ItemValueAccessor(rowItem, colName) and rewrite it in C#. This was my attempt: ColumnItemValueAccessor colLambda = (object rowItem) => General_ItemValueAccessor(rowItem, colName); When I did this, I get the following error: Error 14 One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll? C:\Source\DotNet\SqlSmoke\SqlSmoke\UserControls\ScriptUserControl.cs 84 73 SqlSmoke However, when I downgraded the app from version 4.0 of the framework to 3.5 (because our users only hae 3.5 and don't have rights to install 4.0). when I did this, the reference to "Microsoft.CSharp" was broken. Can I rewrite the VB.NET command in C# using syntax that is valid in C# 3.5 as I was able to in VB.NET? What would the syntax be?

    Read the article

  • Pinvoke- to call a function with pointer to pointer to pointer parameter

    - by jambodev
    complete newbe in PInvoke. I have a function in C with this signature: int addPos(int init_array_size, int *cnt, int *array_size, PosT ***posArray, PosT ***hPtr, char *id, char *record_id, int num, char *code, char *type, char *name, char *method, char *cont1, char *cont2, char *cont_type, char *date1, char *date_day, char *date2, char *dsp, char *curr, char *contra_acc, char *np, char *ten, char *dsp2, char *covered, char *cont_subtype, char *Xcode, double strike, int version, double t_price, double long, double short, double scale, double exrcised_price, char *infoMsg); and here is how PosT looks like: typedef union pu { struct dpos d; struct epo e; struct bpos b; struct spos c; } PosT ; my questions are: 1- do I need to define a class in CSharp representing PosT? 2- how do I pass PosT ***posArray parameter across frm CSharp to C? 3- How do I specify marshaling for it all? I Do appreciate your help

    Read the article

  • MissingMethodException in C# Program

    - by draghia-aurelian
    I wrote a Windows Form Application in C# and it works well for my computer. But on another PC, an error occurs when I try to do some stuff. MenuItem_Click Event Handler private void rUNToolStripMenuItem_Click(object sender, EventArgs e) { MessageBox.Show("I'm in rUNToolStripMenuItem_Click!"); ... } ToolStripMenuItem Event Handler private void dataPositionToolStripMenuItem_Click(object sender, EventArgs e) { MessageBox.Show("I'm in dataPositionToolStripMenuItem_Click!"); ... } Running on my computer: MenuItem_ClickEvent Handler Output (On My PC) MessageBox appears: "I'm in rUNToolStripMenuItem_Click" ToolStripMenuItem Event Handler (On My PC) MessageBox appears: "I'm in dataPositionToolStripMenuItem_Click!" MenuItem_Click Event Handler: (On another PC) Messagebox doesn't appear and an Exception is thrown Method not found: "Void Microsoft.CSharp.RuntimeBinder.CSharpGetMemberBinder.ctor( System.String.System.Type, System.Collections.Generic.IEnumerable'1<Microsoft .CSharp.RuntimeBinder.CSharpArgument Info>)'. This is the PrintScreen with error: What am I doing wrong?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >