Ask Experts Questions for FREE Help !
Ask
    Gopi Chand's Avatar
    Gopi Chand Posts: 1, Reputation: 1
    New Member
     
    #1

    Nov 29, 2014, 04:55 AM
    C# - Method's type signature is not PInvoke compatible
    Hello friends,
    Iam trying to use the VC++ (2003) dll in C# (2010)
    When am calling the method of dll from c# am getting this error
    "Method's type signature is not PInvoke compatible"


    I am returning the structure from VC++
    Code:
    struct SLFData
    {
    public:
    char ByLat[10];
    char ByLong[10];
    };


    And I am marshalling in C#
    Code:
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    public struct SLFData
    {
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
    public char[] ByLat;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
    public char[] ByLong;
    };


    Yet again I get the same error!
    What am I missing here?
    Can anybody help me Plzz
    InfoJunkie4Life's Avatar
    InfoJunkie4Life Posts: 1,409, Reputation: 81
    Ultra Member
     
    #2

    Nov 29, 2014, 08:21 AM
    Try here. Seems a common problem across the internet.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

How do I calculate gross profit using the weighted average method and the FIFO method [ 0 Answers ]

Please give me the fomular and where to look, which amounts

Correct Method for this type? [ 6 Answers ]

I have never seen this type of main breaker/fuse. Is the correct method for disconnecting/shutting off power to pull straight out? Do the screws need to be removed first? Or? I am a Cabinet builder and installer and since this device is not made of wood, it is not familiar! Ps I hate...

Blood type compatible [ 3 Answers ]

Is there a problem when you are pregnant and your husband is A negative and you are A or O positive


View more questions Search