I am using the dll to call a function.Now the error im getting is
A call to PInvoke function 'App_Code.tvheafo_!Scancsharp+UnsafeNativeMethods::getpath' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters
of the PInvoke signature match the target unmanaged signature.
cathie16
Member
32 Points
16 Posts
Re: MFC dll in c# web Application
Aug 07, 2011 07:03 AM|LINK
I am using the dll to call a function.Now the error im getting is
A call to PInvoke function 'App_Code.tvheafo_!Scancsharp+UnsafeNativeMethods::getpath' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
this is the code used for calling the function
this is the code im using to define the function in dll
[DllImport(_dllLocation)] [return: MarshalAs(UnmanagedType.LPStr)] public static extern string getpath([MarshalAs(UnmanagedType.LPStr)] string name);this is function definition in dll
extern "C" __declspec(dllexport) LPTSTR getpath(LPSTR aFilePath) { coding... }