We help IT Professionals succeed at work.

ProgIDFromCLSID ?

Monk100
Monk100 asked
on
977 Views
Last Modified: 2013-11-20
Dear Friends,
Supposing i have a CLSID-->
783CD4E2-9D54-11cf-B8EE-00608CC9A71F
I want to extract the ProgID via the API
******************************
ProgIDFromCLSID(
 REFCLSID clsid,  
//CLSID forwhich the ProgID is requested
  LPOLESTR * lplpszProgID
//Address of output variable that //receives a  pointer to the requested //ProgID string
)
*********************************
How do i load the Parameter CLSID?
Have a Nice Day
Bye
Comment
Watch Question

Commented:
Hi,

The parameter CLSID you can either define as constant
// 783CD4E2-9D54-11cf-B8EE-00608CC9A71F
const CLSID myCLSID = { 0x783CD4E2, 0x9D54, 0x11cf, { 0xB8, 0xEE, 0x0, 0x60, 0x8c, 0xc9, 0xa7, 0x1f} };
LPOLESTR lpszProgID = NULL;  
ProgIDFromCLSID( myCLSID, &lpszProgID );
CoTaskMemFree(lpszProgID);

or
convert string {783CD4E2-9D54-11cf-B8EE-00608CC9A71F} to CLSID
CLSID clsid;
LPOLESTR strCLSID = L"{783CD4E2-9D54-11cf-B8EE-00608CC9A71F}";
CLSIDFromString( strCLSID, &clsid );

LPOLESTR lpszProgID = NULL;  
ProgIDFromCLSID( clsid, &lpszProgID );
CoTaskMemFree(lpszProgID);

Bye.
Wyn

Commented:
REFCLSID clsID;
LPTSTR  pszProgID;
ProgIDFromCLSID(clsID, &pszProgID);

Here you got the ProgID.
Wyn

Commented:
Should be a comment.

Author

Commented:
It Works.
Thanks a lot Mr Timop for answering the question.
I extracted the value into a CString-->
**************
LPOLESTR lpszProgID = NULL;    
ProgIDFromCLSID( clsid, &lpszProgID );

CString str=lpszProgID;
AfxMessageBox(str);
**************************
Mr Wyn,Thanks to you also for commenting
Bye
Have a Nice Day, Sirs

Commented:
Looks like timop should submit an answer so this question can be graded and taken from the list of active questions.

..B ekiM
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks Mr Timop,
I don't have points else i would have increased my points
Have a Nice Day
Bye
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.