Seemed to work very smoothly !
Still some more confusion however,
One of the functions in the COM object (in C++) is :
SelectDrive(unsigned_char DriveLetter/*[in]*/, void** DriveHandle/*[out]*/)
Input is a char, for instance 'd'
Output is a pointer to a HANDLE of an object (the handle is used to pass to
other functions of the COM object)
(in C++ HANDLE is a pointer to void and because it's output of the function,
the output is a pointer to a pointer of void (void**))
..NET seems to make this of this function :
public abstract new void SelectDrive ( System.Byte DriveLetter ,
System.IntPtr DriveHandle )
I don't seem to understand .NET (yet) because I can't write a few simple
lines that use the COM object.
I find it strange that I seem to have to pass an entire object each time,
instead of a simple variable ?
I tried numerous things, then tried the classes as they are used in the
function template made by .NET
This was the last attempt :
System.IntPtr Drive ;
System.Byte DriveLetter = (byte)'D' ;
DllName.InterfaceName.SelectDrive(DriveLetter, Drive) ;
I still get compiler errors ...
An object reference is required for the nonstatic field, method, or property
'Perlustro.ICDDVDIO.SelectDrive(byte, out System.IntPtr)'
Can anybody give a few simple lines of code showing me how to do this !
I don't have the time right now to completely dig into .NET
I just need to be able to demonstrate the use of the COM object in .NET
Thanks !
Peter
-------------------------------------------------------------
"Patrick Steele [MVP]" <pa*****@mvps.org> wrote in message
news:MP************************@msnews.microsoft.c om...
In article <Mf**********************@phobos.telenet-ops.be>,
Pe***@Smart-Projects.net says... Thanks,
how do I add a reference to the COM object ?
(like said, very new to VS.NET)
Go to the "Project" menu. Click "Add Reference..." Click on the "COM"
tab and select the COM object from the list presented.
It actually creates a .NET wrapper that makes your COM object look like
a .NET object (a "Runtime callable wrapper" or simply "RCW").
--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele