Resolving functions from character strings...any ideas?
-
With the Microsoft Developer studio add-ins, you declare functions in a COM interface, then call a routine (a member of the Application object) AddCommand, which takes amongst other things a string that contains the names of your functions. These are not exported functions, they are standard STDMETHOD(...) functions (which expands to HRESULT virtual __stdcall ...). Any one have any ideas on how they do this? I know you can export the functions, and then use GetProcAddress to look those functions up my name, but these functions are not exported...they are normal exposed members of a COM interface. Anyone have any ideas on how they get away with this? Thanks in advance. -Jesse
-
With the Microsoft Developer studio add-ins, you declare functions in a COM interface, then call a routine (a member of the Application object) AddCommand, which takes amongst other things a string that contains the names of your functions. These are not exported functions, they are standard STDMETHOD(...) functions (which expands to HRESULT virtual __stdcall ...). Any one have any ideas on how they do this? I know you can export the functions, and then use GetProcAddress to look those functions up my name, but these functions are not exported...they are normal exposed members of a COM interface. Anyone have any ideas on how they get away with this? Thanks in advance. -Jesse
Check out this link: http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-CallFunc&forum=cotd&id=-1 That should help :) Later, Caleb
-
Check out this link: http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-CallFunc&forum=cotd&id=-1 That should help :) Later, Caleb
Sweet! Thank a bunch :)
-
With the Microsoft Developer studio add-ins, you declare functions in a COM interface, then call a routine (a member of the Application object) AddCommand, which takes amongst other things a string that contains the names of your functions. These are not exported functions, they are standard STDMETHOD(...) functions (which expands to HRESULT virtual __stdcall ...). Any one have any ideas on how they do this? I know you can export the functions, and then use GetProcAddress to look those functions up my name, but these functions are not exported...they are normal exposed members of a COM interface. Anyone have any ideas on how they get away with this? Thanks in advance. -Jesse
MS compiles your com interface file (.idl) and produces the function name to function pointer map. Look through the files in your directory after compile and you can find this. There's probably a macro that uses the ## syntax to create the function name as a string.
-
MS compiles your com interface file (.idl) and produces the function name to function pointer map. Look through the files in your directory after compile and you can find this. There's probably a macro that uses the ## syntax to create the function name as a string.
Thanks...I couldnt find anything to resolve those functions to strings, however your suggestion of a macro gave me an idea that I made work =) -Jesse