DirectPlay and #define INITGUID
All the DirectPlay tutorials I have looked at have #define INITGUID in it. I investigated to see what that define was for and found this webpage (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dx8_c/directx_cpp/intro/programcpp/compiling/CompilingDX8.asp) -- copied below.
Linking with GUIDs
To use GUIDs in a version 8.x application, include a link to the Dxguid.lib library and remove "#define INITGUID" from all your header files and source files. This is a change from previous versions, where GUIDS were linked by defining INITGUID prior to all other include and define statements. In the older versions, INITGUID needed to be defined in only one of your source modules.
I don''t understand. The tutorial I was working with told me to make a guid (how do you make one?) yet it included the line defining INITGUID. What am I supposed to do?
So what version of DirectPlay are you using?
Chances are the tutorials you are looking at are old, in which INITGUID was used by queryinterfaces.
I would simply remove it.
I''ve also fairly certain that you don''t have to deal with anything like QueryInterfaces anyway, so simply remove it.
Chances are the tutorials you are looking at are old, in which INITGUID was used by queryinterfaces.
I would simply remove it.
I''ve also fairly certain that you don''t have to deal with anything like QueryInterfaces anyway, so simply remove it.
I''m using the version 8.1 (which is what the tutorials are in as they are the tuts that came with the sdk
). I agree with you though. I have it commented out and will leave it that was as it seems to work fine now.
But the GUID thing is still confusing me. How do I make a GUID for my game?
![](smile.gif)
But the GUID thing is still confusing me. How do I make a GUID for my game?
i had the same problem some times ago.
you can create a guid with the MS Visual Studio tool called ''GuidGen''. this tool is NOT linked to your start menu !!!
take a look at your visual studio folder, for example:
"C:\Program Files\Microsoft Visual Studio\Common\Tools\GUIDGEN.EXE"
digital_drug
you can create a guid with the MS Visual Studio tool called ''GuidGen''. this tool is NOT linked to your start menu !!!
take a look at your visual studio folder, for example:
"C:\Program Files\Microsoft Visual Studio\Common\Tools\GUIDGEN.EXE"
digital_drug
This is from msdn: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndxgen/html/directx8faq.asp
--------------------------------
I get linker errors about multiple or missing symbols for globally unique identifiers (GUIDs), what do I do?
The various GUIDs you use should be defined once and only once. The definition for the GUID will be inserted if you #define the INITGUID symbol before including the DirectX header files. Therefore, you should make sure that this only occurs for one compilation unit. An alternative to this method is to link with the dxguid.lib library, which contains definitions for all of the DirectX GUIDs. If you use this method (which is recommended), then you should never #define the INITGUID symbol.
--------------------------------
The dxguid.lib library defines guid constants used by directx and is NOT used to actually make guids.
[edited by - DmGoober on November 12, 2002 2:25:16 PM]
--------------------------------
I get linker errors about multiple or missing symbols for globally unique identifiers (GUIDs), what do I do?
The various GUIDs you use should be defined once and only once. The definition for the GUID will be inserted if you #define the INITGUID symbol before including the DirectX header files. Therefore, you should make sure that this only occurs for one compilation unit. An alternative to this method is to link with the dxguid.lib library, which contains definitions for all of the DirectX GUIDs. If you use this method (which is recommended), then you should never #define the INITGUID symbol.
--------------------------------
The dxguid.lib library defines guid constants used by directx and is NOT used to actually make guids.
[edited by - DmGoober on November 12, 2002 2:25:16 PM]
Alexander "DmGoober" Jhinalexjh@online.microsoft.com[Warning! This email account is not attended. All comments are the opinions of an individual employee and are not representative of Microsoft Corporation.]
If you are using VC++, check your tools/bin dir for a tool called GUIDGEN.EXE. This will create a unique guid.
Your question about guid''s is covered in the directx sdk docs (the first chapter!). DirectPlay needs a guid to uniquely identify the application. Why would you need/want to do this? several reasons - again covered in the sdk docs.
doesnt anyone bother reading anymore?
steb
quote:
Original post by steb
If you are using VC++, check your tools/bin dir for a tool called GUIDGEN.EXE. This will create a unique guid.
Your question about guid''s is covered in the directx sdk docs (the first chapter!). DirectPlay needs a guid to uniquely identify the application. Why would you need/want to do this? several reasons - again covered in the sdk docs.
doesnt anyone bother reading anymore?
steb
Thanks for the replies, I got this working a while ago. I had read all the documentation but was unclear on some things. Specifically, why the documentation told me to NOT include #define INITGUID yet all the tutorials went ahead and included it anyway. Oh well, I found the guidgen program and everything works.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement