Announcement

Collapse
No announcement yet.

Creating a dialog inside a Dll??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a dialog inside a Dll??

    Hello PB-Community!

    CASE %DLL_PROCESS_ATTACH
    gl_hInstance = hInstance

    g_hMsgWnd = CreateDialog (gl_hInstance, BYVAL 100&, 0, _
    CODEPTR(MyProc))
    -----------------------------------------
    CASE %DLL_PROCESS_DETACH
    IF IsWIndow (g_hMsgWnd) THEN
    DestroyWindow g_hMsgWnd
    END IF

    I use this modeless (hidden) (ressource-file) dialog as an asychronic message window (But this is not the topic of my question).

    The Question: Am I allowed to create such a window in a DLL?
    Are there maybe hidden problems (I know they always are?).
    Testing seems to be ok? But....

    Thanks for any comments.

    Greetings,
    Heinz Grandjean
    Heinz Grandjean
    http://www.estwgj.com/

  • #2
    Cannot (should not!) do this on the DLL_PROCESS_ATTACH notification. Check your API reference under DLLMain()

    But as far as putting a function to create that window in the DLL, that's no problem at all. Once the DLL is successfully loaded, any procedure in that DLL may as well be in an #INCLUDE file in your "main" program.

    (I do this a lot).

    MCM
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      custom controls

      Creating windows in a Dll is how visual custom controls are made.
      Fred
      "fharris"+Chr$(64)+"evenlink"+Chr$(46)+"com"

      Comment

      Working...
      X