C++ to Delphi, Values/GUIDs

I need 2 Functions, Rater simple i guess.. if you know how that is :)

1. Convert String with '0x0300' type values into the Format we use in Delphi.

2. Convert GUIDs from C++ Headers into GUID Format we use in Delphi.
i found 2 kinds in the headers :
First: {e436eb78-524f-11ce-9f53-0020af0ba770}
Second: 0xe436eb78, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70

Not very familiar with those things yet.. so i hope u guys could introduce me to the devils..
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

duno much about guids but you can use something like below :


  First : TGUID = '{3F5A62E2-51F2-11D3-A075-CC7364CAE42B}';

 Second : TGUID = (

do you know about guidtostring(TGuid) defined in comobj.
and cocreateguid(tguid) in activex unit.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brainwareAuthor Commented:
Well i kinda need to convert the format of the Hmm STRINGS/GUIDS whatever u wanna call them, Into Delphi Working Values.. at first the MOST Imp is the 0x0300  i checked delphi source and noticed some values i could not see any compare between the values here and the once in the Windows SDK (c++)
Noticed some ppl to like
MyConst = (1 shr 2) insted of such value .... Im only getting more confused.. :(
brainwareAuthor Commented:
i have been awake for 4 days now (in a row), But anyhows.. a page with bad english i bet, http://www.bw-soft.com
bwDelphi-Kit, Getting Developed by me and several of others, No freeware tho.. Not when it is as big as its going to be shortly..

Just if a pro like u had any interests in it..

Kinda Amature page right now.. but no time for Fancy html, Can't u see we are coding :)
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

>1. Convert String with '0x0300' type values into the
>Format we use in Delphi.

That's an hexadecimal value. To convert it to an integer, do the following:

function CHexToDInt(CHex : string) : longint;
   Delete(CHex, 1, 2);   // 0x0300 -> 0300
   Result := StrToInt('$'+CHex);  // 0300 -> $0300 -> longint



Hehe, this one is faster...   :-))

function CHexToDInt(CHex : string) : longint;
   Delete(CHex, 1, 1);   // 0x0300 -> 0300
   CHex[1] := '$';
   Result := StrToInt(CHex);  // 0300 -> $0300 -> longint


Regards, Madshi.
brainwareAuthor Commented:
hehe.. Well i learned that it was HEX yeah.. but what about the GUID Crap..
Michael, do you want to convert the GUID strings with a program or simply manually? If manually, look at Barry's comment.
brainwareAuthor Commented:
Well i just need to write a small app that i give a C++ GUID and it gives me Delphi version of it...
becuse i want to port a few things of the DirectMedia SDK..
brainwareAuthor Commented:
the functions u refered me too was oki.. figured the rest out too..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.