Invoke problem..need HELP!

G

Guest

Hi!
I have the following problem:

When i invoke lineGetDevCaps i receive always a STRUCTURETOOSMALL error,
this is my code:

LINEDEVCAPSS status = new LINEDEVCAPSS();
status.dwTotalSize = 1024;

int InitSize = Marshal.SizeOf(status);
int dwVersion = 131072;
IntPtr pIP = MarshalEx.AllocHGlobal(InitSize);
Marshal.StructureToPtr(status, pIP, false);
ret = NativeTapi.lineGetDevCaps(tapi.hLineApp, 0, dwVersion, 0, pIP);
---> ret return exception


Tapi is already and correctly initialized (i have used Alex tapi wrapper)

thanks in advance!
 
S

Sergey Bogdanov

What CF version? I believe that you should change Marshal.Sizeof(status)
to Marshal.SizeOf(typeof(LINEDEVCAPSS)).
 
G

Guest

HI, thanks for your reply:

I use CF 1.0 and Tapi 1.6: Now i have changed Marshal.Sizeof(status)
with Marshal.SizeOf(typeof(LINEDEVCAPSS)) but i receive the same error
"structuretoosmall" :-(




Sergey Bogdanov said:
What CF version? I believe that you should change Marshal.Sizeof(status)
to Marshal.SizeOf(typeof(LINEDEVCAPSS)).


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Azzi said:
Hi!
I have the following problem:

When i invoke lineGetDevCaps i receive always a STRUCTURETOOSMALL error,
this is my code:

LINEDEVCAPSS status = new LINEDEVCAPSS();
status.dwTotalSize = 1024;

int InitSize = Marshal.SizeOf(status);
int dwVersion = 131072;
IntPtr pIP = MarshalEx.AllocHGlobal(InitSize);
Marshal.StructureToPtr(status, pIP, false);
ret = NativeTapi.lineGetDevCaps(tapi.hLineApp, 0, dwVersion, 0, pIP);
---> ret return exception


Tapi is already and correctly initialized (i have used Alex tapi wrapper)

thanks in advance!
 

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