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. DialogBox of win32 dll

DialogBox of win32 dll

Scheduled Pinned Locked Moved C / C++ / MFC
helplearningworkspace
8 Posts 2 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 dll in which one the function should display a dialog box( this dialogbox resource is in dll)when it called by the aplication ,which has loaded this library (using Loadlibrary()). But problem here is ,when the application calls this function( which is exported by dll) the dialogbox is not displaying properly and the program stops continuing execution. To solve this i used AFX_MANAGE_STATE(),but when i compile it displayed AFX_MANAGE_STATE is undefined variable( i complied using nmake in SDK platform environment)..

    Manjunath S GESL Bangalore

    P 1 Reply Last reply
    0
    • M Manjunath S

      dear all, I have dll in which one the function should display a dialog box( this dialogbox resource is in dll)when it called by the aplication ,which has loaded this library (using Loadlibrary()). But problem here is ,when the application calls this function( which is exported by dll) the dialogbox is not displaying properly and the program stops continuing execution. To solve this i used AFX_MANAGE_STATE(),but when i compile it displayed AFX_MANAGE_STATE is undefined variable( i complied using nmake in SDK platform environment)..

      Manjunath S GESL Bangalore

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      Manjunath S wrote:

      But problem here is ,when the application calls this function( which is exported by dll) the dialogbox is not displaying properly and the program stops continuing execution.

      What do you mean by this? can you be more specific. Why dont you tried using MFC dll's.

      Prasad Notifier using ATL

      M 1 Reply Last reply
      0
      • P prasad_som

        Manjunath S wrote:

        But problem here is ,when the application calls this function( which is exported by dll) the dialogbox is not displaying properly and the program stops continuing execution.

        What do you mean by this? can you be more specific. Why dont you tried using MFC dll's.

        Prasad Notifier using ATL

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

        Actually i have created a dialogbox in an exsisting Dll sample code and tried to display the dialogbox which i have created But it is giving an error(Err No.1813,Specified Resource type cannot be found in the Image file) Thanks

        Manjunath S GESL Bangalore

        P 1 Reply Last reply
        0
        • M Manjunath S

          Actually i have created a dialogbox in an exsisting Dll sample code and tried to display the dialogbox which i have created But it is giving an error(Err No.1813,Specified Resource type cannot be found in the Image file) Thanks

          Manjunath S GESL Bangalore

          P Offline
          P Offline
          prasad_som
          wrote on last edited by
          #4

          can you show code, you have used? My suggestion would be use MFC dlls otherwise.

          Prasad Notifier using ATL

          M 1 Reply Last reply
          0
          • P prasad_som

            can you show code, you have used? My suggestion would be use MFC dlls otherwise.

            Prasad Notifier using ATL

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

            Hi code is as follows if((hInst_temp = GetModuleHandle(NULL))==NULL) { MessageBox(NULL,"GetModuleHandle error",NULL,MB_OK); } if(-1 ==WlxDialogBoxParam(hWlx, hInst_temp,MAKEINTRESOURCE(IDD_DXCAPTURE_DIALOG),NULL, MyCaptureDlgProc, dwInitParam)) { LPVOID lpMsgBuf; LPVOID lpDisplayBuf; DWORD dw = GetLastError(); FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, lstrlen((LPCTSTR)lpMsgBuf)+lstrlen((LPCTSTR)"gina")) *sizeof(TCHAR)); wsprintf((LPTSTR)lpDisplayBuf, TEXT("%s failed with error %d: %s"), "Gina", dw, lpMsgBuf); MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK); LocalFree(lpMsgBuf); LocalFree(lpDisplayBuf); } error number is 1813( ths specified resource type cannot found in image file)

            Manjunath S GESL Bangalore

            P 1 Reply Last reply
            0
            • M Manjunath S

              Hi code is as follows if((hInst_temp = GetModuleHandle(NULL))==NULL) { MessageBox(NULL,"GetModuleHandle error",NULL,MB_OK); } if(-1 ==WlxDialogBoxParam(hWlx, hInst_temp,MAKEINTRESOURCE(IDD_DXCAPTURE_DIALOG),NULL, MyCaptureDlgProc, dwInitParam)) { LPVOID lpMsgBuf; LPVOID lpDisplayBuf; DWORD dw = GetLastError(); FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, lstrlen((LPCTSTR)lpMsgBuf)+lstrlen((LPCTSTR)"gina")) *sizeof(TCHAR)); wsprintf((LPTSTR)lpDisplayBuf, TEXT("%s failed with error %d: %s"), "Gina", dw, lpMsgBuf); MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK); LocalFree(lpMsgBuf); LocalFree(lpDisplayBuf); } error number is 1813( ths specified resource type cannot found in image file)

              Manjunath S GESL Bangalore

              P Offline
              P Offline
              prasad_som
              wrote on last edited by
              #6

              Just an advise, use pre tags for code, its become readable.

              Manjunath S wrote:

              if(-1 ==WlxDialogBoxParam(hWlx, hInst_temp,MAKEINTRESOURCE(IDD_DXCAPTURE_DIALOG),NULL, MyCaptureDlgProc, dwInitParam))

              Is it dll code ? I'm not sure, but its something related to AfxSetResourcehandle, you need to set it right for calling process.

              Prasad Notifier using ATL

              M 1 Reply Last reply
              0
              • P prasad_som

                Just an advise, use pre tags for code, its become readable.

                Manjunath S wrote:

                if(-1 ==WlxDialogBoxParam(hWlx, hInst_temp,MAKEINTRESOURCE(IDD_DXCAPTURE_DIALOG),NULL, MyCaptureDlgProc, dwInitParam))

                Is it dll code ? I'm not sure, but its something related to AfxSetResourcehandle, you need to set it right for calling process.

                Prasad Notifier using ATL

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

                Hi, Thanks for your useful response ... Now its working fine... I also made a mistake in dialog procedure

                Manjunath S GESL Bangalore

                P 1 Reply Last reply
                0
                • M Manjunath S

                  Hi, Thanks for your useful response ... Now its working fine... I also made a mistake in dialog procedure

                  Manjunath S GESL Bangalore

                  P Offline
                  P Offline
                  prasad_som
                  wrote on last edited by
                  #8

                  Cheers !

                  Prasad Notifier using ATL

                  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