473,396 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is my interpretation of COM interface correct?

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
2 1124
>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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cmelnick | last post by:
I created an interface, IMyInterface and placed it in namespace MyPackage. Something like this: namespace MyPackage { interface IMyInterface { // Stuff } } This interface as well as some...
7
by: sNOiSPAMt | last post by:
7.20.3#1 If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value,...
5
by: cs | last post by:
We have a VB.NET interface that I just dont have the time to rewrite at the moment, and I need to implement it on C#, I have done it already however I get the following error when referencing my...
3
by: Chua Wen Ching | last post by:
Hi there, I just read Chris Sells's article at http://www.codeproject.com/csharp/delegate_bedtime.asp?df=100&forumid=2983&select=922269#xx922269xx I wonder i can do this: 1) I want to...
6
by: John Salerno | last post by:
I understand how they work (basically), but I think maybe the examples I'm reading are too elementary to really show their value. Here's one from Programming C#: #region Using directives ...
8
by: khalprin | last post by:
Hello, I'm trying to create a component that will be used from .net clients and COM clients. I've got an object model that looks something like this: ISystem IRuntime IConfiguration...
9
by: Sean Chambers | last post by:
Not sure if this is the correct way to go about this, but it seems correct. I'm trying to eliminate dependencies through interfaces and want to minimize casting as much as possible, as a result I...
15
by: Gustaf | last post by:
Using VS 2005. I got an 'IpForm' class and an 'IpFormCollection' class, containing IpForm objects. To iterate through IpFrom objects with foreach, the class is implemented as such: public class...
8
by: rn5a | last post by:
Suppose I have the following class code: Imports System Imports System.Data Imports System.Data.SqlClient Public Class DBSettings Private sqlCmd As SqlCommand Private sqlConn As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.