Hello,
I have a guid as string like "DB087CCC-AF2C-431d-84A3-25291FF089D5", and I need to convert them in a structure like
typedef struct _GUID {
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[ 8 ];
} GUID;
(typical Microsoft GUID structure).
In Installshield (11) I've defined a structure like:
typedef GUID
begin
LONG Data1;
SHORT Data2;
SHORT Data3;
CHAR Data4(8);
end;
Any idea how to populate the GUID defined structure from my string in Installshield 11 ?
Is there a function which is predefined, and already does this?
Thanks.
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Convert string to GUID structure`
Started by
bogdan.carjac
, Mar 05 2007 17:31
5 replies to this topic
Posted 05 March 2007 - 18:29
Da gibt es glaube ich nichts vordefiniertes. Am besten nimmst du die String-Funktionen (StrFind usw.)
Stefan Krüger
InstallSite.org twitter facebook
Posted 06 March 2007 - 08:57
Thank you, I appreciate your answer, even if my German is not so good.
But I think it's not a metter of Substrings. It's more an issue of converting a GUID string into GUID structure, so what i need is an algorithm, IF Installshield doesn't have a predefined function which does something similar (as I understood from your German explanation).
And if Installshield doesn't support that... it will be my job to think about an algorithm.
Best regards,
Bogdan.
But I think it's not a metter of Substrings. It's more an issue of converting a GUID string into GUID structure, so what i need is an algorithm, IF Installshield doesn't have a predefined function which does something similar (as I understood from your German explanation).
And if Installshield doesn't support that... it will be my job to think about an algorithm.
Best regards,
Bogdan.
Posted 07 March 2007 - 11:47
Hello,
I solved the problem and I used CLSIDFromString method from Ole32.dll.
I presume it's similar with what you've described. But there is a problem, and i think it's an installShield 11 problem.
The DLL's method is expecting an UNICODE string:
HRESULT CLSIDFromString(
LPOLESTR lpsz,
LPCLSID pclsid
);
In Installshield I placed a STRING variable, and I checked! is not working!
So STRING variable I think it is MBCS!
I checked in Installshield documentation and it says STRING type is unicode, which I think is wrong. In order to make it work I used WSTRING !
http://www.installsh...Pro7Excerpt.pdf
I guess that's interesting to know... anyway in my case I was able to call the DLL's method only with WSTRING !
Best regards,
Bogdan.
I solved the problem and I used CLSIDFromString method from Ole32.dll.
I presume it's similar with what you've described. But there is a problem, and i think it's an installShield 11 problem.
The DLL's method is expecting an UNICODE string:
HRESULT CLSIDFromString(
LPOLESTR lpsz,
LPCLSID pclsid
);
In Installshield I placed a STRING variable, and I checked! is not working!
So STRING variable I think it is MBCS!
I checked in Installshield documentation and it says STRING type is unicode, which I think is wrong. In order to make it work I used WSTRING !
http://www.installsh...Pro7Excerpt.pdf
I guess that's interesting to know... anyway in my case I was able to call the DLL's method only with WSTRING !
Best regards,
Bogdan.
Posted 08 March 2007 - 17:51
QUOTE (bogdan.carjac @ 2007-03-06 09:57) |
Thank you, I appreciate your answer, even if my German is not so good. |
Apologies for that. To much jumping between the English and the German section of this forum.
Stefan Krüger
InstallSite.org twitter facebook