Solved

Dialog box

Posted on 2000-07-27
7
276 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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 163
Host to IP 7 83
how to monitor remote shell execution on linux 9 107
Execute multiple curl cmds with sleep and send output to file 10 114
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

756 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