ProgIDFromCLSID ?

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
Monk100Asked:
Who is Participating?
 
timopConnect With a Mentor Commented:
Any points for me :-)?

Thanks,
timop.
0
 
timopCommented:
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.
0
 
WynCommented:
REFCLSID clsID;
LPTSTR  pszProgID;
ProgIDFromCLSID(clsID, &pszProgID);

Here you got the ProgID.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
WynCommented:
Should be a comment.
0
 
Monk100Author 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
0
 
mikeblasCommented:
Looks like timop should submit an answer so this question can be graded and taken from the list of active questions.

..B ekiM
0
 
Monk100Author Commented:
Thanks Mr Timop,
I don't have points else i would have increased my points
Have a Nice Day
Bye
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.