Search Result

Collapse
3 results in 0.0024 seconds.
Keywords
Members
Tags
pinvoke
  •  

  • JeepRubicon
    started a topic Passing structure to unmanaged code from C#

    Passing structure to unmanaged code from C#

    Hi all,

    I've been fighting this problem for some time now and am hoping someone can help. I'm converting a VB6 application to C#. Everything I'm about to show works perfect in VB6, but fails in C#.

    I'm making an API call into a C dll, passing a structure. The structure gets values modified in the C side and I should see the modified values in my return structure.

    Here are the C structures:

    ...
    See more | Go to post
    Last edited by JeepRubicon; Oct 10 '11, 05:55 PM. Reason: Added method

  • karmjit435
    started a topic How to pass double values using PInvoke
    in .NET

    How to pass double values using PInvoke

    I have a c++ component. It exposes an API which accept two double values:

    say:
    void Multiply(double a, double b);

    if i call this API from a C# code using PInoke and pass the values
    a=199.4225
    b=1678
    a*b = 335237.92955
    andi debug the code and found that in the Autos window the values are actually
    a= 199.42249999999 99
    b= 1678.0000000000 000

    If i call this method from a...
    See more | Go to post

  • MarshalDirectiveException - Method's type signature is not PInvoke compatible

    Hello,
    I'm trying to retrieve a structure in C# from a C dll. Really to say I'm not an expert programmer on both C/C#, and will appreciate any comments and suggestions.
    Here's a C dll coded structure, to be retrieved..
    --
    Code:
    struct MESSAGEE 
    {
          int               MsgNo;          
          int               MsgType;       
          char        MsgTypeText[64];
          char        MsgNoText[64];
    ...
    See more | Go to post
Working...