Norman
Thu Jun 22 19:53:54 CDT 2006
In my limited experience for the SetupDi and CM routines that I needed, MSDN
said which headers to #include, and the Platform SDK contained those
headers.
The Platform SDK for February 2003 can be used with VC++ 6.
If your program has to run on both Windows 2000 and Windows XP, then I think
you won't want to call any APIs that were added after February 2003. So
that will probably be enough.
If you need some #define lines for constants that aren't defined in the
Platform SDK, then copy those lines from the DDK into one of your own header
files. This might be risky in the future, i.e. your program will need
adjusting for future versions of Windows, but it will be fine for 2000 and
XP.
"Jackal Huang" <huangjj@hotmail.com> wrote in message
news:%23ZkefFhlGHA.4444@TK2MSFTNGP02.phx.gbl...
> Thanks for all kindly replies.
>
> I would write the utility to detect the arrival of usb storage device and
> then
> perform safe-remove operation. The program can be run on Win2000 or XP.
> Therefore, I think MSVC 6 is enough.
>
> To perform safe remove operation, I need to use CM_xxx function such as
> CM_Request_Device_Eject defined in cfgmgr32.h.
> These functions are not declared in VC or platform SDK header file.
> To include cfgmgr32.h of DDK, I got many compile error in cfgmgr32.h.
> I try many include directory orders in VC's include option.
>
> CM_xxx functions are leagcy function and many CM functions can be
> replaced by SetupDixxx function, but some seems not to be replaced by
> setup api.
>
> Therefore, I want to know whether some general include rule can solve this
> problem ?
>
> Best Regards
>
> JJ Huang
>
> "Thomas F. Divine [DDK MVP]" <tdivine@NOpcausaSPAM.com>
>> "Mark Roddy" <markr@hollistech.com> wrote in message
>> news:uTa9EJUlGHA.2128@TK2MSFTNGP04.phx.gbl...
>>> Jackal Huang wrote:
>>>> I often need to write windows program (using MFC) that uses special
>>>> APIs
>>>> defined in DDK header files. Therefore, the project includes some
>>>> header
>>>> files from MSVC and some header files from DDK.
>>>>
>>>
>>> Which special apis? User mode apis are defined in the platform sdk
>>> header files.
>>>
>>> You might need to include IOCTL definitions, guids, and related data
>>> structures defined in various device specific header files not included
>>> with the sdk. In that case, just include them, using some arrangement to
>>> specify the correct ddk path.
>>>
>> In case Mark's reply isn't perfectly clear...
>>
>> Yes, the DDK can be used to build user-mode applications. The inc tree
>> basically has two parts. For example, for Windows Server 2003:
>>
>> 3790.1801\inc\wnet - Contains "user-mode" includes
>> 3790.1801\inc\ddk\wnet - Contains lernel-only includes
>>
>> If you are using the DDK Build to build an application, then these are
>> the include trees you would use.
>>
>> What Mark was saying is that most of the user-mode includes from the DDK
>> are also provided in the Platform SDK. In you install the latest Platform
>> SDK, then the includes that you probably need will automatically be
>> integrated into Visual Studio and you will have less greif in using them.
>> There might be some exceptions...
>>
>> A strong suggestion is for you to abandon MCVC 6. It is two generations
>> behind the current VS .NET 2005. You will be more successful if you use
>> more current develoment tools.
>>
>> Thomas F. Divine, Windows DDK MVP
>>
http://www.pcausa.com
>>
>>
>>
>
>