Click here to Skip to main content
15,898,134 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGetting Monitor Name Pin
2-Jan-02 12:23
suss2-Jan-02 12:23 
GeneralRe: Getting Monitor Name Pin
Nish Nishant2-Jan-02 16:36
sitebuilderNish Nishant2-Jan-02 16:36 
GeneralRe: Getting Monitor Name Pin
3-Jan-02 6:13
suss3-Jan-02 6:13 
GeneralBook advice please! Pin
Rickard Andersson202-Jan-02 11:50
Rickard Andersson202-Jan-02 11:50 
GeneralRe: Book advice please! Pin
Tomasso7-Jan-02 7:00
Tomasso7-Jan-02 7:00 
GeneralFor whom the Mutex waits Pin
Bill Wilson2-Jan-02 10:30
Bill Wilson2-Jan-02 10:30 
GeneralVertical PropertySheet Tab Labels Pin
Ken Goguen2-Jan-02 9:42
Ken Goguen2-Jan-02 9:42 
GeneralMapping interfaces to IIDs Pin
Klaus Probst2-Jan-02 9:10
Klaus Probst2-Jan-02 9:10 
I'm working on an ATL DLL that will be used as a helper tool for ASP and scripting applications. The apps run inside a managed environment with a service-level COM architecture based on VB and VC++ DLLs that implement various interfaces, which the v-table challenged languages can't get at. The idea goes something like this:

STDMETHODIMP CDispatchHelper::CreateInstance(BSTR ProgID, BSTR Interface, IDispatch **pReturn)


The code will take the progID, call CLSIDFromProgID(), then CoCreateInstance and then invoke QueryInterface on the pointer, which is then returned with no more than an AddRef() call (the helper DLL is a pure IDispatch implementation, obviously). The problem is getting the IID of the interface, which is passed as a simple string (no GUID). I figure I can:

- Load the implementation typelib, look at the coclass and follow the tlb chain down to the interface. This is OK, but it's kinda hacky. Plus it's kinda slow, I think.
- Enumerate HKEY_CLASSES_ROOT\Interface until I find the string. I have the GUID already (the name of the parent key) so I just call StringToIID() and I'm done. I figure this is what COM is doing anyways. It takes just a couple of milliseconds to go through the entire branch, but my feeling is that Microsoft can write better code than me any day.
- ... and I'm all ouf ideas. Is there a reliable way to take the name of an interface and get its GUID? Some undocumented COM API or something like that?

Thanks for any thoughts....



___________
Klaus
[www.vbbox.com]
GeneralRe: Mapping interfaces to IIDs Pin
Bill Wilson2-Jan-02 10:22
Bill Wilson2-Jan-02 10:22 
GeneralRe: Mapping interfaces to IIDs Pin
Klaus Probst2-Jan-02 10:34
Klaus Probst2-Jan-02 10:34 
Questionright way to save listbox data = ? Pin
Kuniva2-Jan-02 8:28
Kuniva2-Jan-02 8:28 
AnswerRe: right way to save listbox data = ? Pin
Carlos Antollini2-Jan-02 9:28
Carlos Antollini2-Jan-02 9:28 
Generalrandom access writing? Pin
Kuniva2-Jan-02 11:22
Kuniva2-Jan-02 11:22 
GeneralRe: random access writing? Pin
Carlos Antollini3-Jan-02 2:43
Carlos Antollini3-Jan-02 2:43 
GeneralRe: random access writing? Pin
Kuniva3-Jan-02 2:49
Kuniva3-Jan-02 2:49 
GeneralRe: random access writing? Pin
Kuniva3-Jan-02 3:00
Kuniva3-Jan-02 3:00 
GeneralRe: random access writing? Pin
Carlos Antollini3-Jan-02 3:09
Carlos Antollini3-Jan-02 3:09 
GeneralDumping data structures binary into a file Pin
slacker2-Jan-02 7:31
slacker2-Jan-02 7:31 
GeneralRe: Dumping data structures binary into a file Pin
Erik Funkenbusch2-Jan-02 8:51
Erik Funkenbusch2-Jan-02 8:51 
GeneralRe: Dumping data structures binary into a file Pin
2-Jan-02 9:34
suss2-Jan-02 9:34 
Questionwhat are the includes for WM_KICKIDLE ??? Pin
Kuniva2-Jan-02 7:20
Kuniva2-Jan-02 7:20 
AnswerRe: what are the includes for WM_KICKIDLE ??? Pin
Michael Dunn2-Jan-02 7:34
sitebuilderMichael Dunn2-Jan-02 7:34 
GeneralRe: what are the includes for WM_KICKIDLE ??? Pin
Kuniva2-Jan-02 7:39
Kuniva2-Jan-02 7:39 
GeneralRe: what are the includes for WM_KICKIDLE ??? Pin
User 66582-Jan-02 9:21
User 66582-Jan-02 9:21 
GeneralRe: what are the includes for WM_KICKIDLE ??? Pin
Tim Smith2-Jan-02 9:33
Tim Smith2-Jan-02 9:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.