Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

demonrealms

What the....GUIDS????

This topic is 5584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, i know what GUID''s are but the book I bought didn''t come with it(the software called GUID). Does anyone know where I can get it? Or is there a better way to making id''s for your com objects? Thanks for your time.

Share this post


Link to post
Share on other sites
Advertisement
The software that generates GUID''s is not call GUID, but guidgen, and I''m fairly sure it comes bundled with windows.

-Neophyte

Share this post


Link to post
Share on other sites
DirectX objects inherit the IUNKNOWN interface, and as long as you link dxguid.lib, that should do it for you!

You also should #define INITGUID in one of your apps, and call CoInitialize(NULL); at the top of your WINMAIN file, and CoUninitialize(); after the shutdown of your app.

Share this post


Link to post
Share on other sites
guidgen doesn''t come with Windows; however, it does come with the Platform SDK (and ships with MSVC).

But, you don''t need guidgen to create a new GUID. Create a program and call the CoCreateGuid() function in objbase.h or the UuidCreate() function in Rpcdce.h to create a new GUID and then use UuidToString() to output the GUID that you can then use in your programs.


  
#include <windows.h>
#include <rpcdce.h>
#include <iostream>

int main(void) {
UUID id;
unsigned char * id_string;

UuidCreate(&id);
UuidToString(&id, &id_string);

std::cout << id_string << std::endl;

RpcStringFree(&id_string);

return 0;
}

Requires rpcrt4.lib, so with MinGW you''d compile it with
g++ -o guid.exe guid.cpp -lrpcrt4

Share this post


Link to post
Share on other sites
Hey, Thanks so much, I found it. i did a search for it and found it(no duh I said it the first time). So anyway thanks again for your time and for helping me. I really appreicate it.
-_- |_|

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!