I would like to define/generate a GUID (interface class) for my test driver. What is the best way to do that 'programatically using C/C++' so it won't conflict with other devices/drivers in the system?
Also, are there a开发者_StackOverflowny standard guidelines to follow or other things to keep in mind while creating a new GUID?
Please suggest.
Use a GUID generator. There is one bundled with Visual Studio. In 2008, it's under Tools > Create GUID.
CoCreateGuid is the Win32 API that does this using randomness sources including your network adapter.
Martyn
If you have Boost, check out Boost UUID (Universally Unique Id) library.
精彩评论