Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ProgIDFromCLSID ?

Posted on 2000-02-21
7
Medium Priority
?
827 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
0
Comment
Question by:Monk100
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 1

Expert Comment

by:timop
ID: 2545201
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
 
LVL 5

Expert Comment

by:Wyn
ID: 2545215
REFCLSID clsID;
LPTSTR  pszProgID;
ProgIDFromCLSID(clsID, &pszProgID);

Here you got the ProgID.
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2545216
Should be a comment.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Monk100
ID: 2545364
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
 
LVL 11

Expert Comment

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

..B ekiM
0
 
LVL 1

Accepted Solution

by:
timop earned 200 total points
ID: 2552298
Any points for me :-)?

Thanks,
timop.
0
 

Author Comment

by:Monk100
ID: 2553983
Thanks Mr Timop,
I don't have points else i would have increased my points
Have a Nice Day
Bye
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question