By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,877 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

Is my interpretation of COM interface correct?

P: n/a
I'm trying to wrap the COM interface IClientVirtualDevice. Is my
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
Nov 17 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
>I'm trying to wrap the COM interface IClientVirtualDevice. Is my
interpretation of the functions within it correct (GetCommand and
CompleteCommand)?
The Functions should be Subs unless you add the <PreserveSig>
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.
Nov 17 '06 #2

P: n/a
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.
Thanks for your help. I'm trying to wrap the entire VDI interface for use
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

Nov 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.