ComObjCreate equivalent in C++?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: ComObjCreate equivalent in C++?

Re: ComObjCreate equivalent in C++?

Post by jeeswg » 13 Jul 2017, 19:50

I don't have much to say on this, just that COM.ahk might be useful for understanding how it works. Best of luck.
COM.ahk, best version? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=29969

Another thing I've been told is that for an IDispatch interface, its methods can be used nicely, with an AHK object, with dot notation. But that for an IUnknown interface, you have to the ugly route and use DllCall abd NumGet.
Explorer column interaction (get/set: which appear, width, ascending/descending order) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=33129

ComObjCreate equivalent in C++?

Post by Miguel7 » 13 Jul 2017, 13:16

Hey guys,

So after hours of research and seemingly endless trial'n'error, I can get CoCreateInstance to work (theoretically - that is, it passes a check using the "FAILED" Win32 function)). Now I'm getting even further into the seedy underbelly of Microsoft's COM interop API, and I can't help but wonder how the AHK team did it. Somehow they managed to turn an insane list of CLSIDs, IIDs, DISPIDs and other crap to a magical one-line function. Then you can call that COM object's methods as if it was an AHK class you created yourself. Has anyone ever seen / written something similar for C++? It seems to me that since Microsoft's original implementation is such a freaking nightmare, someone somewhere must have. If not, has anyone found a really good tutorial that explains how to correctly use COM objects after CoCreateInstance? I've been all over MSDN and found lots of function signatures but few if any tutorials (which is why it took 10 times the effort just to get CoCreateInstance working... I think). Thanks in advance. :)

Top