Jump to content
  • Advertisement

Archived

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

soconne

UuidCreateSequential Help Needed !!

This topic is 5227 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

Does anybody have example C++ code that shows how to call UuidCreateSequential ? Specifically calling it from the DLL file, and not the .lib. So something like HANDLE handle = LoadLibrary("RPCRT4.DLL"); // the rest ... I''m trying to use this in Borland C++ Builder, but I cannot seem to figure out the syntax. Here is the delphi code though in case somebody can translate it. function GetMACAddress(seq:boolean ):String; var UuidCreateFunc : function (var guid: TGUID):HResult;stdcall; handle : THandle; g:TGUID; i:integer; ErrCode: HResult; begin handle := LoadLibrary(''RPCRT4.DLL''); if seq then @UuidCreateFunc := GetProcAddress(Handle, ''UuidCreateSequential'') else @UuidCreateFunc := GetProcAddress(Handle, ''UuidCreate'') ; ErrCode:=UuidCreateFunc(g); if ErrCode=0 then begin result:=''''; for i:=1 to 6 do result:=result+IntToHex(g.MAC,2); end else begin result:=''ffffffff''+IntToHex(Errcode,4); end; end;

Share this post


Link to post
Share on other sites
Advertisement
Lucky you I know both Object Pascal and C++ like the back of my hand


typedef __stdcall HRESULT (*fnUuidCreate)(GUID*);

HANDLE handle = LoadLibrary("RPCRT4.DLL");
fnUuidCreate UuidCreateFunc = 0;
if(UuidCreateFunc = (fnUuidCreate)GetProcAddress(Handle, "UuidCreateSequential"))
else
UuidCreateFunc = (fnUuidCreate)GetProcAddress(Handle, "UuidCreate");

GUID guid;
HRESULT result = UuidCreateFunc(&guid);
//etc...


[edited by - Magmai Kai Holmlor on June 3, 2004 12:53:07 AM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!