Announcement

Collapse
No announcement yet.

Return control to program while DLL continues

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

    Return control to program while DLL continues

    I have an exported Sub "SendMail" in a DLL... I would like to activate this Sub, and then have control returned to my program while the DLL sends the email in the background. Everything is working, but at the moment my program hangs until the sub has completed (when the email finishes sending) - usually a few seconds...
    Does anyone know? if its possible at all?



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

    #2
    Wayne --
    Call Dll in thread.

    ------------------
    E-MAIL: [email protected]

    Comment


      #3
      Semen, im calling my PB DLL with the Sendmail sub from a VB6 program ... VB6 typically does not support multi-threading, so would I perhaps need to create a second PB DLL, and call that, which in turned called the SendMail sub in a new thread?
      It seems a bit clandestine using a second DLL just to call my main DLL, but it seems there is no other way possible from my VB app?


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

      Comment


        #4
        solved! in the same DLL too, phew
        kind thanks Semen for pointing me in the right direction

        here is the code thats working for me:

        Code:
        SUB MAILFILE() EXPORT
        DIM idThread(1) AS LONG
        DIM dwResult as dword
        THREAD CREATE SendMail(0) TO idThread(0)
        END SUB
        I call MAILFILE() from my VB sub, and it returns immediately, while the thread continues in the background...
        oohhh the warm fuzzies you get when you move from VB to PB, its better than toasted marshmallows


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

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎