Announcement

Collapse
No announcement yet.

Building DLL's for VB using DDT.

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

  • Building DLL's for VB using DDT.

    I know now that i need global window classes when i use a PB dll in VB.

    The created window hinstance MUST point to the DLL NOT the instance of the app.

    When i make use of a DDT dialog i think the DDT dialog is created using the app's instance.

    I'm not sure if this is my crash or something else.

    Can PB shed some light on this?

    The app will only crash in design modus, the DLL is not allways released because VB is the instance i guess.
    When i use the technique described above, no problems any longer.

    Btw, GetModulehandle() in the DLL returns the calling app's instance.
    This is the incorrect handle.


    Thanks,


    ------------------
    [email protected]
    hellobasic

  • #2
    Originally posted by Edwin Knoppert:
    GetModulehandle() in the DLL returns the calling app's instance.
    This is the incorrect handle.
    Edwin --
    take hInstDLL from LibMain



    ------------------

    Comment


    • #3
      Sorry, you misread, i KNOW this, that's the whole point.

      I think DDT uses the instance of the app instead of the DLL.


      ------------------
      [email protected]
      hellobasic

      Comment


      • #4
        Possibly I'm just confused but, as I seem to recall it, a DLL is construed as an extension of an app. Any memory that the DLL allocates is owned by the app, not the DLL. If this is correct, I'm not clear that it's possible to have a case where the window hInstance points to the DLL rather than the app... depending, I guess, on what you mean by "points to".

        ------------------
        Tom Hanlin
        PowerBASIC Staff

        Comment


        • #5
          It would seem to me if you wanted a new instance or a separate one you would have to createprocess otherwise I believe you are going to be using the instance of the VB app that calls the DLL.


          I could be wrong, just makes sense.

          Scott


          ------------------
          Scott
          mailto:[email protected][email protected]</A>
          Scott Turchin
          MCSE, MCP+I
          http://www.tngbbs.com
          ----------------------
          True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

          Comment


          • #6
            I didn't spoke about 'points to'.

            I certainly know that when i create ANY KIND of window in a DLL wich uses the VB instance (In design mode) VB will crash after a few times running.

            I used an usercontrol with a DLL window as child.

            New is the fact that i used an ordinary DDT dialog not as child from VB6.
            The app also crashes.
            For instance, run/break/restart/end/change and try to store VBchanges.

            The problem is VB, he doesn't unload it very well i guess.
            The future user of my control WON't do anything different so..
            This is a problem.

            I'm asking, is using the DLL instance handle an ordinary way or is it common to use the EXE's handle.
            This seems already to be answered, using the EXE's handle is common.

            But i want to be sure.

            In that case, i need to write app's towards VB.

            Thanks,



            ------------------
            [email protected]mail.com
            hellobasic

            Comment

            Working...
            X