|
-
Dec 6th, 2000, 12:59 PM
#1
Thread Starter
Fanatic Member
I'm doing some multithreading work with apartment threads, and I make a call to the above and it fails every time; I think I have to make a call before I do this to enable it to work, any ideas guys?
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Dec 6th, 2000, 01:34 PM
#2
Frenzied Member
hmmm never used that call 
You want Asynchronous threads?
I tend to use
Code:
Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Dec 7th, 2000, 04:26 AM
#3
Thread Starter
Fanatic Member
I want an Apartment Model thread, to give the thread its own copy of data to stop it getting mixed up in other threads...
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Dec 10th, 2000, 04:31 PM
#4
Junior Member
is it possible to pass parameters into the threaded fubctions?
-
Dec 11th, 2000, 12:01 PM
#5
Thread Starter
Fanatic Member
CoInitialize
Initializes the COM library on the current apartment and identifies the concurrency model as single-thread apartment (STA). Applications must initialize the COM library before they can call COM library functions other than CoGetMalloc and memory allocation functions.
You must do this before you can call any of the other COM functions, Dan Appleman has an example on his site - I'll bundle it into a class for apartment threads and post it.
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|