Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use ProgIDFromCLSID API function?
Message
 
 
To
26/02/2008 06:25:33
Lu Ping
Zhuhai Tec Co.
Zhuhai, China
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01296369
Message ID:
01296377
Views:
9
DECLARE Long CLSIDFromString IN ole32.dll String lpsz , String @ pclsid 
DECLARE Long ProgIDFromCLSID IN Ole32.dll String clsid, Long  @ lplpszProgID
DECLARE Long lstrlenW IN WIN32API long src
DECLARE Long LocalFree IN WIN32API Long

* CLSID for Treeview
lcClsid = "{C74190B6-8589-11D1-B16A-00C0F0283628}"
* 16 bytes CLSID
lcClsID16 = REPLICATE(Chr(0), 16)
* Convert string CLSID into CLSID
IF CLSIDFromString (STRCONV(lcClsid,5), @lcClsID16) <> 0
	* Error
	RETURN .F.
ENDIF

* Pointer to ProgID
lnpProgID = 0
* Get ProgID	
IF ProgIDFromCLSID (lcClsID16, @lnpProgID) <> 0
	* Error
	RETURN .F.
ENDIF

? STRCONV(SYS(2600, lnpProgID, lstrlenW(lnpProgID)*2), 6)

= LocalFree(lnpProgID)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform