Solved

Dialog box

Posted on 2000-07-27
7
271 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 88
Question regarding Copy/Paste 16 86
only14 challenge 19 63
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 86
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 …
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now