Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't access member functions from my OCX

Status
Not open for further replies.

grandseer

Programmer
Oct 18, 2007
1
CA
Hi all,

I am developing in VS.NET2005 and wrote an activex (OCX) component in C++.

I created a new VB application, and added the following to the Form1_Load function:

Dim x as AxMyControlNameLib.AxMyControlClass
x = new AxMyControlNameLib.AxMyControlClass
x.TestFunction()

The control is created perfectly and works in its own right but I get a "Catastrophic Error" on the line where I try to access the member function TestFunction.

In the control's cpp file's dispatch map I added:
DISP_FUNCTION_ID(CMyDialog,"TestFunction",1,TestFunction,VT_EMPTY,VTS_NONE)

and in the idl file (in the dispinterface _DMyControlClass code block) I added:
[id(1)] void TestFunction();

Please point me in the right direction. I have been searching forever online trying to figure this out.
Thanks in advance
G
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top