InvokeHelper in Microsoft Visual C++ .NET

Sep 29, 2004
18,656
68
91
I am working on an inherited application. I am at my wits end as to what this is doing. Actually, I understand the parameters other than the very first one.

In particular, what is 0x4 doing? My understanding is that this maps to a method somewhere. How do I find out what it is mapping to?

unsigned long result;
InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
 

nickbits

Diamond Member
Mar 10, 2008
4,122
1
81
That is a DSPID which does map to a property. Normally they are #defines, hardcoding a value is bad practice. The meaning of that value should be in either:
The header file for that object
The documentation for that object
The IDL file for that object
The type library for that object (.dll/.tlb, view in oleview.exe)
 
Sep 29, 2004
18,656
68
91
nickbits,

Yup ... this code isn't good, but I've seen worse. No comments either!

Thanks, off to learn about the topics you mentioned.