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
Last edited by Wokawidget; Apr 15th, 2004 at 09:59 AM.
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.
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
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