|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Is my interpretation of COM interface correct?interpretation of the functions within it correct (GetCommand and CompleteCommand)? ''' <summary> ''' Wrapper for IClientVirtualDevice ''' </summary> <ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("40700424-0080-11D2-851F-00C04FC21759")> _ Public Interface IClientVirtualDevice ' virtual HRESULT STDMETHODCALLTYPE GetCommand( ' /* [in] */ DWORD dwTimeOut, ' /* [out] */ struct VDC_Command **ppCmd) = 0; Function GetCommand(ByVal dwTimeOut As Integer, _ ByRef ppCmd As VDC_Command) As Integer ' virtual HRESULT STDMETHODCALLTYPE CompleteCommand( ' /* [in] */ struct VDC_Command *pCmd, ' /* [in] */ DWORD dwCompletionCode, ' /* [in] */ DWORD dwBytesTransferred, ' /* [in] */ DWORDLONG dwlPosition) = 0; Function CompleteCommand(ByVal pCmd As VDC_Command, _ ByVal dwCompletionCode As Integer, _ ByVal dwBytesTransferred As Integer, _ ByVal dwlPosition As Long) As Integer End Interface >I'm trying to wrap the COM interface IClientVirtualDevice. Is my The Functions should be Subs unless you add the <PreserveSig>>interpretation of the functions within it correct (GetCommand and >CompleteCommand)? attribute and handle the HRESULT return codes yourself. I'd have to see your declaration of VDC_Command to know it the parameter types are correct. But I'm guessing that it should be ByRef pCmd As VCD_Command and ByRef ppCmd As IntPtr. Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. > I'd have to see your declaration of VDC_Command to know it the Thanks for your help. I'm trying to wrap the entire VDI interface for use > parameter types are correct. But I'm guessing that it should be ByRef > pCmd As VCD_Command and ByRef ppCmd As IntPtr. > with .NET - if it's already available somewhere, I would appreciate someone linking to it ;). Anyway: Public Structure VDC_Command Public commandCode As Integer Public size As Integer Public position As Long Public buffer() As Byte End Structure |
|||||||||||||||||||||||