Thread: Putting a DialogBox into a DLL?

  1. #1
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630

    Putting a DialogBox into a DLL?

    Can you put a DialogBox into a DLL? I need for my DLL's to be able to control some of their internal parameters during debuging stages and id like to be able to pull up a dialog box and just change their values. I tried just putting one in, and exporting a method that calls DialogBoxParams but it just causes the program to close.

    Code:
    // from Batch.h
    extern "C" DLLAPI void ParamDialog(const HINSTANCE& hInstance, const HWND& hParent);
    //Pre:
    //Post:
    
    INT_PTR	CALLBACK DialogProc(HWND hwndDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
    //Pre:
    //Post:
    
    //from Batch.cpp
    void ParamDialog(const HINSTANCE& hInstance, const HWND& hParent)
    {	int iDlg = ::DialogBoxParam(hInstance,
    		                            MAKEINTRESOURCE(IDD_DIALOG1),
    		                            hParent,
    			            DialogProc,
    			            NULL);
    }

  2. #2
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    Ok, i figured out why the program was closing, but now it wont load the Dialog. I mean it loads the DLL fine. Loads the function fine. But when I call the DialogParam function nothing happens, nothing is displayed. I made sure to have the Dialog visible in its properties.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dialogbox from within a DLL
    By JustMax in forum C Programming
    Replies: 33
    Last Post: 02-03-2009, 10:23 AM
  2. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  3. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  4. DLL and std::string woes!
    By Magos in forum C++ Programming
    Replies: 7
    Last Post: 09-08-2004, 12:34 PM
  5. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 05:29 AM