Solved

Using an ActiveX control from a DLL

Posted on 2001-08-02
4
514 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Title # Comments Views Activity
Complete beginner needs help making a cron job 9 134
Window placement 17 100
child constructor and parent constructor, overriding and overloading 6 95
Path of Workbook 3 88
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informatā€¦
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦

752 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