469,945 Members | 1,519 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

MFC ActiveX built with /CLR fails to load

Hello.
We need to use UserControl-derived components written in C# in our
existing MFC application. The components need to be inserted into
existing ActiveX controls (written using MFC and ATL as separate OCX
files). The recommended way is to turn on the /CLR switch and use
CWinFormsControl class. Using this approach I was able to insert a
simple test component into one of our ActiveX controls and successfully
build the OCX in Debug mode, however when running the application I
noticed that it fails to load the modified ActiveX control - when the
app tries to create an instance of the control it fails with the
following error: ClassFactory cannot supply requested class. The same
load failure occurs even when I completely removed the test component
from the ActiveX control so it seems that the failure is caused by
building with the /CLR switch. I also tried to build the ActiveX's
StdAfx.cpp and the cpp file containing code for the ActiveX DLL (such
as InitInstance and DLLRegisterServer) without the /CLR switch but it
didn't help. The control is registered properly and w/o errors (at
least that's what regsvr32 shows).

We use Visual Studio 2005, any help will be greatly appreciated. Thank
you.

Oct 15 '06 #1
0 1295

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Wm. Scott Miller | last post: by
1 post views Thread by Steve | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.