C equivalent calling convention in C#

S

Sunil Menon

Dear All,
I would like to call a C dll function from my C# application using
PInvoke.
The dll name is XSal2_32.dll...its equivalent c code is...
BOOL XSalStrCompress(HSTRING p_hsIn,int p_iLevel, LPHSTRING p_lphsOut
)

In my C# application I have declared it as...
[DllImport("XSal2_32.dll")]
public static extern Boolean XSalStrCompress(string m, int tr,
[MarshalAs(UnmanagedType.BStr)]string ma);

but it always returns false...

could someone please help me in solving this problem...

TALIA

Many Regards
Sunil
 
T

Thomas Scheidegger [MVP]

Hi,
BOOL XSalStrCompress(HSTRING p_hsIn,int p_iLevel, LPHSTRING p_lphsOut)

I don't think 'HSTRING' and 'LPHSTRING'
map 1:1 to any well-known Windows/C++/.NET string types.

I guess they are some kind of custom 'string-handles'....

Ask the vendor of this DLL to provide
exact specification for this types.

Then use the newsgroup:
microsoft.public.dotnet.framework.interop
for more.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top