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

x
?
Solved

Dialog box

Posted on 2000-07-27
7
Medium Priority
?
280 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
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 600 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

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
Integration Management Part 2

783 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