I have to marshal LINEDEVCAPS structure for TAPI in the call to
lineGetDevCaps.
[DllImport("Tapi32.dll",CharSet=CharSet.Auto,EntryPoint="lineGetDevCaps")]
private static extern uint (int hLineApp,uint dwDeviceID,uint dwAPIVersion,
uint dwExtVersion,out IntPtr lpLineDevCaps);
This structure is a variable length one, so i declare the last parameter
like a pointer istead like LINEDEVCAPS so I can allocate
the necessary memory space, but when I call the function a receive (HRESULT
= Bad pointer)
liggett78 - 13 Dec 2004 13:47 GMT
Your declaration is wrong. The last param is not the "out" parameter, rather
"ref" I think.
See Platform SDK:
"Pointer to a variably sized structure of type LINEDEVCAPS. Upon successful
completion of the request, this structure is filled with line device
capabilities information. Prior to calling lineGetDevCaps, the application
must set the dwTotalSize member of this structure to indicate the amount of
memory available to TAPI for returning information."
So you should be allocating memory for it.
Regards, Joerg
> I have to marshal LINEDEVCAPS structure for TAPI in the call to
> lineGetDevCaps.
[quoted text clipped - 7 lines]
> the necessary memory space, but when I call the function a receive (HRESULT
> = Bad pointer)