[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

Dialog box

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.


ShowWindow (Cdlg,SW_SHOW);
1 Solution
can you show your CallDlg function?
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 .
Also verify whether the properties of the dialog which you are calling from dll has the visible checkbox checked.
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

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.

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;

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.
saidiAuthor Commented:
Answer accepted
saidiAuthor Commented:
thank's for your answer.
my email:saidi@excite.com

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now