Solved

Dialog box

Posted on 2000-07-27
7
278 Views
Last Modified: 2013-11-20
I try to display a dialog box from a DLL
but when i call the dll function to call
the dialog box i see just the buttons and no Frame and just a black background but the mesaage transfer between dialog and callback function is correct what is the problem.


Cdlg = CreateDialog (g_hInst,(LPCSTR) MAKEINTRESOURCE (IDD_AGENTDIALOG),
(HWND) NULL,(DLGPROC) CallDlg);
                  

ShowWindow (Cdlg,SW_SHOW);
0
Comment
Question by:saidi
[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
7 Comments
 
LVL 6

Expert Comment

by:MichaelS
ID: 3618175
can you show your CallDlg function?
0
 
LVL 4

Expert Comment

by:ShankarRamaswamy
ID: 3619212
before the createdialog funct put this code & give a try ,
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));

Since the resource for dlg is at dll we should do the above.otherwise the resource is loaded from the exe .
0
 
LVL 4

Expert Comment

by:ShankarRamaswamy
ID: 3620092
Also verify whether the properties of the dialog which you are calling from dll has the visible checkbox checked.
0
Independent Software Vendors: 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!

 
LVL 2

Expert Comment

by:pinnakas
ID: 3637520
What is g_hInst?

The problem might be with the call back function you have specified with CreateDialog?

Post the code it contains so that we can check for possible errors.

0
 
LVL 2

Accepted Solution

by:
simongod earned 200 total points
ID: 3688332
eek I think that you are doing this the HARD way.  Let me first try to get this straight.  You have a dll with a dialog in it that you want to display in your app?  Well thats easy.  Look at it this way that dialog that is in the dll is part of the app IF you link the dll's LIB file the your app.  then where ever you want to display the dialog from include the dialogs header file to the source and call the dialog just as if it were part of the app already.

MyDialog dlg;
dlg.DoModal();

Also there is one change that you have to make to the dialogs header file in the dll.  Below is the header file for a dialog in a dll that I made.

class AFX_EXT_CLASS CAnalogInputDefPropPage : public CPropertyPage

Can you see the difference?  Its that AFX_EXT_CLASS thing.  I cannot remember exactly what it does but it allows you to export and import functions.  I think.  You will have to use MSDN to verify that.  I can send you a dummy app that uses a dialog from a dll to show you it works.  just add your email.
0
 

Author Comment

by:saidi
ID: 3689219
Answer accepted
0
 

Author Comment

by:saidi
ID: 3689220
thank's for your answer.
my email:saidi@excite.com
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

624 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