Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exe GUID
Message
From
01/07/2005 12:37:02
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01028186
Message ID:
01028245
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
Hello,

instantiating a COM exe just to retrieve it's CLSID is a bit overhead isn't it ..?!

you may use this function instead:
#DEFINE S_OK 0

FUNCTION CLSIDFromProgIDEx(lcProgID,lcGuidString)

	DECLARE INTEGER CLSIDFromProgID IN ole32.dll STRING pProgID, STRING @ pGuid
	DECLARE INTEGER StringFromGUID2 IN ole32.dll STRING pGuid, STRING @ pString, INTEGER nMaxChars

	LOCAL lcGuid, lnHr, lnChars
	lcGuid = SPACE(16)
	lcGuidString = SPACE(80)
	
	lcProgID = STRCONV(lcProgID+CHR(0),5)
	
	lnHr = CLSIDFromProgID(lcProgID,@lcGuid)
	IF lnHR = S_OK
		lnChars = StringFromGUID2(lcGuid,@lcGuidString,40)
		lcGuidString = STRCONV(lcGuidString,6)
		lcGuidString = LEFT(lcGuidString,lnChars-1)
	ENDIF

	RETURN lnHr
ENDFUNC


&& usage
LOCAL lnHr, lcClsID
IF CLSIDFromProgIDEx('yourExe.yourClass',@lcClsID) = 0
 ? lcClsID
ENDIF
Regards
Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform