Results 1 to 6 of 6

Thread: New multi threading tool...have problem with code, need help.

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    New multi threading tool...have problem with code, need help.

    OK, after quite a while away I have finally finished a new an improved multithreading technique.
    I have created an app (DLL) called vbGateway.
    This allows you to communicate between threads using Send data (Synchronous) and Post Data (Asynchronous)

    I would love for people to hack my code and find bugs and/or improvements.

    The follwoing is a list of steps that need to be done to test this DLL.
    • Download and extract zip to a folder
    • Open vbGateway.vbp and compile to DLL
    • Open up project1, in the demo folder
    • Reference vbGateway and then compile project1
    • Launch 2 instances of project1.exe
    • Copy and past the hWnd text box from one instance to the childhWnd textbox in the other instance...and vis versa
    • Click send and post data buttons

    When receiving the data I have made the client hang for 500 ms. this is to demonstarte the PostData method as the sending client is still free and gains code execution staright away after posting message.
    The data, a byte array, that is sent can be anything from text, like in the demo, to the byte array of an entire file, tis up to you what you send.

    Comments most welcome.

    Woka
    Attached Files Attached Files

  2. #2
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703
    Why not pipes?
    an ending

  3. #3

  4. #4
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703
    Well, pipes are kind of the inbuilt os-way to do interprocess communication.. that said your code provides a different way to do it, as it's event based. Anyway, the code looks good, will try to test later.
    an ending

  5. #5

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Right I have a little problem...2 in fact, and they are confusing the hell out of me

    Attached in the new verion of my gateway DLL, and a multithreading file search project.

    Compile the new vbGateway DLL.
    Then go into the Multithreading folder and compile the SearchThread ActiveX EXE project.
    Now open the DemoUI project and run it.
    Start 1 search and it works fine.
    When u try and start another search it errros in the clsSearch Class_initialise event when it tries to create a gateway object.
    This error is caused my the vbGateway app because something is already using the subclassing module!
    HOW can both objects use the same module?! This is a DLL, not activeX EXE!!! I am confused

    My 2nd problem is that the data gets sent, but now and again, for some reason unknown to me, the 1st few bytes, in the byte array, that I sent to the DemoUI's clsSearch gateway object are wrong and it errors when I try to set the contents of the property bag. The DemoUI project beeps when this happens

    Woka
    Attached Files Attached Files

  6. #6

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Sorry my mistake...I forgot that they used the same module when the classes were created in the same thread...d'oh.
    Tis easy to fix the subclassing problem. I am having one of those days

    Anyways, the other problem about the bytes getting corrupted...still stuck

    Woof

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width