I have a VB6 application that is running against an ActiveX written in C++.
I've added a function to the ActiveX that I think is properly exposed to the
outside world but there seems to be some problem with the COM linking. The
function does not take any arguments and the code completion in VB6 finds the
function by the proper name and shows no arguments as well. When I run the
application and try to call the function, the debugger gives me the "Run-time
error '449': Argument not optional" error.
I think this is more of a COM linking problem but I have no idea of how to
resolve it. Any help would be much appreciated.

Signature
Live large, sail hard, and enjoy life.
Robert
Robert Harper - 01 Jul 2009 19:11 GMT
Found the problem. It was that in the header file in one order where the
afx_msg macro is interpreted and in the source file where the DISP_FUNCTION
macro was interpreted, it was swapped with another function name that took a
parameter.
Kind of dicey if you ask me but oh well. Chock one up to experience.

Signature
Live large, sail hard, and enjoy life.
Robert
> I have a VB6 application that is running against an ActiveX written in C++.
> I've added a function to the ActiveX that I think is properly exposed to the
[quoted text clipped - 6 lines]
> I think this is more of a COM linking problem but I have no idea of how to
> resolve it. Any help would be much appreciated.