Solved

Using an ActiveX control from a DLL

Posted on 2001-08-02
4
501 Views
Last Modified: 2013-11-20
I have made an MFC DLL, using the Application Wizard.
In that DLL I inserted a dialog, with some common controls and and ActiveX control (a better grid than the one provided by Microsoft).

The problem arises when I call the function that creates the dialog. Apparently the DoModal method fails because of the ActiveX control (if the dialog doesn't have the ActiveX control there is no problem).

As when I use ActiveX control in other applications (.EXE) I inserted this line in the InitInstance member of the DLL.

AfxEnableControlContainer();

Also, I inserted this line in the exported function of the DLL that creates the dialog:

AFX_MANAGE_STATE(AfxGetStaticModuleState());

I think that there is a function call or something that is missing, but I can't find any examples about using an ActiveX control from a DLL.
0
Comment
Question by:pgiusto
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6346141
Did you call 'AfxOleInit()'?
0
 

Author Comment

by:pgiusto
ID: 6346237
Yes, while expecting for a comment, y read in the MSDN about using AfxOleInit() in the dll, but it doesn't work.

Should I tried using AfxOleInit() in the application (.exe)
0
 
LVL 12

Expert Comment

by:migel
ID: 6346264
Hi!
is your control registered in the system?
0
 

Author Comment

by:pgiusto
ID: 6346280
OK. I tried calling the function from the exe instead from the dll and it's work.

Thanks a lot.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question