Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Display message from DLL

Display message from DLL

Scheduled Pinned Locked Moved C / C++ / MFC
help
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Manjunath S
    wrote on last edited by
    #1

    Dear All, I have an application which interacts with DLL inturn to a driver.. So when I press a button(named Load Driver) I should call a dll function.In this function i need to display a message that driver is loading and this displayed message should disappear after few minutes... For displaying this message i created a dialog ( using createDialog) and destroyed it after few minutes,But the problem is, the control (here static text) inside this dialog is not displaying and this createdialog tries to use dialog which i have in application .DLL is win32 prog.. Manjunath S GESL Bangalore

    W D 2 Replies Last reply
    0
    • M Manjunath S

      Dear All, I have an application which interacts with DLL inturn to a driver.. So when I press a button(named Load Driver) I should call a dll function.In this function i need to display a message that driver is loading and this displayed message should disappear after few minutes... For displaying this message i created a dialog ( using createDialog) and destroyed it after few minutes,But the problem is, the control (here static text) inside this dialog is not displaying and this createdialog tries to use dialog which i have in application .DLL is win32 prog.. Manjunath S GESL Bangalore

      W Offline
      W Offline
      William Wang
      wrote on last edited by
      #2

      is ur dll created with MFC? if yes, add this AFX_MANAGE_STATE(AfxGetStaticModuleState()); at the beginning of your exporting function in dll. life is like a box of chocolate,you never know what you r going to get.

      M 1 Reply Last reply
      0
      • W William Wang

        is ur dll created with MFC? if yes, add this AFX_MANAGE_STATE(AfxGetStaticModuleState()); at the beginning of your exporting function in dll. life is like a box of chocolate,you never know what you r going to get.

        M Offline
        M Offline
        Manjunath S
        wrote on last edited by
        #3

        Dll is not Using MFC.Its a normal Dll Manjunath S GESL Bangalore

        C W 2 Replies Last reply
        0
        • M Manjunath S

          Dll is not Using MFC.Its a normal Dll Manjunath S GESL Bangalore

          C Offline
          C Offline
          color Aljechin
          wrote on last edited by
          #4

          UpdateData(0)? :rose:

          D 1 Reply Last reply
          0
          • M Manjunath S

            Dll is not Using MFC.Its a normal Dll Manjunath S GESL Bangalore

            W Offline
            W Offline
            William Wang
            wrote on last edited by
            #5

            if u r using HWND CreateDialog(HINSTANCE hInstance,LPCTSTR lpTemplate, HWND hWndParent,DLGPROC lpDialogFunc); to create a dialog, make sure the parameter hInstance is correctly dilivered, it must be the dll module's instance. life is like a box of chocolate,you never know what you r going to get.

            M 1 Reply Last reply
            0
            • W William Wang

              if u r using HWND CreateDialog(HINSTANCE hInstance,LPCTSTR lpTemplate, HWND hWndParent,DLGPROC lpDialogFunc); to create a dialog, make sure the parameter hInstance is correctly dilivered, it must be the dll module's instance. life is like a box of chocolate,you never know what you r going to get.

              M Offline
              M Offline
              Manjunath S
              wrote on last edited by
              #6

              HI, How to get DLL module's instance for createDialog... Manjunath S GESL Bangalore

              W 1 Reply Last reply
              0
              • C color Aljechin

                UpdateData(0)? :rose:

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                What part of "Dll is not Using MFC." did you miss? :rolleyes:


                "Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

                "Judge not by the eye but by the heart." - Native American Proverb

                1 Reply Last reply
                0
                • M Manjunath S

                  Dear All, I have an application which interacts with DLL inturn to a driver.. So when I press a button(named Load Driver) I should call a dll function.In this function i need to display a message that driver is loading and this displayed message should disappear after few minutes... For displaying this message i created a dialog ( using createDialog) and destroyed it after few minutes,But the problem is, the control (here static text) inside this dialog is not displaying and this createdialog tries to use dialog which i have in application .DLL is win32 prog.. Manjunath S GESL Bangalore

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  Manjunath S wrote:

                  But the problem is, the control (here static text) inside this dialog is not displaying...

                  Are there any other controls on the dialog that are not being displayed? If so, it sounds like a secondary thread is needed as the UI thread is too busy servicing other messages.


                  "Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

                  "Judge not by the eye but by the heart." - Native American Proverb

                  1 Reply Last reply
                  0
                  • M Manjunath S

                    HI, How to get DLL module's instance for createDialog... Manjunath S GESL Bangalore

                    W Offline
                    W Offline
                    William Wang
                    wrote on last edited by
                    #9

                    BOOL WINAPI DllMain(HANDLE hinstDLL, DWORD dwReason, LPVOID lpvReserved); the first parameter is the dllmodule's instance. life is like a box of chocolate,you never know what you r going to get.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups