Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exe GUID
Message
De
01/07/2005 12:37:02
 
 
À
01/07/2005 11:22:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01028186
Message ID:
01028245
Vues:
15
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform