T
TOM
I am using C++.NET 2003. The appplication requires calling a device (a USB
driver) that was compiled under C++ 6.0, and distributed as a binary (a .sys
file) by the manufacturer. Some of the data structures are fairly complex,
and a couple header files from the Windows DDK are needed to establish the
variable types and structures needed to call the USB functions.
The problem is that an #include of the necessary DDK headers within C++
auto-generated Windows forms modules fails to compile due to numerous
conflicts between the (new) and the (old) IDLs.
In .C++.NET 2002 I was able to hold the structures as part of the wrapper
module, as long as they were not part of a function or method interface.
This broke in .NET 2003, and now I have to hide the offending data
structures inside the methods as automatic variables so that they never are
exposed outside the module. I cannot make them part of the wrapper
interface, since that requires that auto-generated modules to have to
#include the DDK headers. Within the wrapper module, I use P/Invoke to call
the low level USB calls in the .SYS module.
So, it works, but the wrapper is very unelegant. It cannot save device state
between calls since that would require declaring a structure and #includes
which would then break all the other modules.
Is there another approach that would allow use of these proprietary USB data
structures (and the necessary #includes from the DDK) that would allow
static varables that are not exposed outside the wrapper module?
-- Tom
driver) that was compiled under C++ 6.0, and distributed as a binary (a .sys
file) by the manufacturer. Some of the data structures are fairly complex,
and a couple header files from the Windows DDK are needed to establish the
variable types and structures needed to call the USB functions.
The problem is that an #include of the necessary DDK headers within C++
auto-generated Windows forms modules fails to compile due to numerous
conflicts between the (new) and the (old) IDLs.
In .C++.NET 2002 I was able to hold the structures as part of the wrapper
module, as long as they were not part of a function or method interface.
This broke in .NET 2003, and now I have to hide the offending data
structures inside the methods as automatic variables so that they never are
exposed outside the module. I cannot make them part of the wrapper
interface, since that requires that auto-generated modules to have to
#include the DDK headers. Within the wrapper module, I use P/Invoke to call
the low level USB calls in the .SYS module.
So, it works, but the wrapper is very unelegant. It cannot save device state
between calls since that would require declaring a structure and #includes
which would then break all the other modules.
Is there another approach that would allow use of these proprietary USB data
structures (and the necessary #includes from the DDK) that would allow
static varables that are not exposed outside the wrapper module?
-- Tom