Re: How to link to older C code without IDL conflicts?

From: Ronald Laeremans [MSFT] (ronaldl_at_online.microsoft.com)
Date: 02/17/04


Date: Tue, 17 Feb 2004 01:04:03 -0800

Compile with /d1PrivateNativeTypes to get back to the VC 2002 behavior in
this respect. There is a KB article describing the issue (googling for the
flag name should find it) along with a few posts by myself. In the Whidbey
version of VC we will be providing a method to control visibility of native
types individually.

Ronald Laeremans
Visual C++ team

"TOM" <noname@noprovider.nodomain> wrote in message
news:eLOmzlx8DHA.2404@TK2MSFTNGP12.phx.gbl...
> 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
>
>
>
>
>



Relevant Pages

  • Re: hid.dll & VC++ 6
    ... but never to compile code based upon any current WDK. ... I'm tasked with writing an application to communicate with a USB card ... missing ')' before identifier 'HIDP_REPORT_TYPE' ... pointed it at the headers and libraries and it worked for a bit until i ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Verizon Express Network (1X, 3G) Under Linux
    ... I have the acm compiled as a loadable kernel module and I loaded it ... > Network by way of a Motorola v120e handset. ... USB Setup. ... Make sure you compile the ...
    (comp.os.linux.networking)
  • Re: hid.dll & VC++ 6
    ... but never to compile code based upon any current WDK. ... I'm tasked with writing an application to communicate with a USB card ... missing ')' before identifier 'HIDP_REPORT_TYPE' ... pointed it at the headers and libraries and it worked for a bit until i ...
    (microsoft.public.win32.programmer.kernel)
  • Re: sane-plustek backend does not work
    ... ">it is USB scanner. ... ">after that I compile sane-backend port ... when I attach the scanner I can see: ... " If it does have that line, try a kernel recompile and reinstall again. ...
    (freebsd-questions)