Run-time error '429' : ActiveX can't create object

L

Lucy Ludmiller

Sorry about the cross posts, not sure which group is the most relevant,
since I am using C++, MFC/COM and VB6

I have written an MFC ActiveX control in C++. I want to use the control
in VB6. The component builds succesfully, and is succesfully registered
on my computer. I am able to reference it in a VB project and have the
component show in the "list of components" dialog.

I have declared my object in VB6 as this:

dim withevent m_control as MyControlLib.MyControl

I try to create an instance of it in VB6 like this:

set m_control = CreateObject("MyControlLib.MyControl")


I then get this error. Which by the way, I believe is a red herring
*i.e. misleading). The ocx is succesfully registered on my mchine, it is
on the path of my VB project and it has all the required dependencies. I
thought there may be a problem wth my control because it was quite
complicated (had a lot of C++ DLL dependencies), so I tried an MFC
control generated by the MFC wizard, and I added two methods and an
event. When i tried to use the component in VB - I had exactly the same
results.

Does anyone know how to instantiate/use an MFC activeX COM control in VB6 ?
 
R

Ralph

Lucy Ludmiller said:
Sorry about the cross posts, not sure which group is the most relevant,
since I am using C++, MFC/COM and VB6

I have written an MFC ActiveX control in C++. I want to use the control
in VB6. The component builds succesfully, and is succesfully registered
on my computer. I am able to reference it in a VB project and have the
component show in the "list of components" dialog.

I have declared my object in VB6 as this:

dim withevent m_control as MyControlLib.MyControl

I try to create an instance of it in VB6 like this:

set m_control = CreateObject("MyControlLib.MyControl")


I then get this error. Which by the way, I believe is a red herring
*i.e. misleading). The ocx is succesfully registered on my mchine, it is
on the path of my VB project and it has all the required dependencies. I
thought there may be a problem wth my control because it was quite
complicated (had a lot of C++ DLL dependencies), so I tried an MFC
control generated by the MFC wizard, and I added two methods and an
event. When i tried to use the component in VB - I had exactly the same
results.

Does anyone know how to instantiate/use an MFC activeX COM control in VB6 ?

To add a control to VB open the Projects->Components (Ctrl+T).
[Be sure to go back and remove any reference to the control from
Project->References.]

-ralph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top