Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using an ActiveX control from a DLL

Posted on 2001-08-02
4
Medium Priority
?
542 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 800 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

971 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