CreateThread API function 
Author Message
 CreateThread API function

Hi,

I've problems with using CreateThread function with VB 5.0.

My question is : how can i use it ?

My code is :

Private declare function CreateThread Lib "Kernel32" _
(lpThreadAttributes as SECURITY_ATTRIBUTES, _
Byval dwStackSize as long, _
lpStartAddress as long, _
lpParameter as Any , _
Byval dwCreationFlags as long, _
lpThreadID as long) as long

' Create the thread
lThread = CreateThread(tSecurity, 0, adressof DialoguerTube,
lHandleTubeServeur, 0, lThreadID)

I get an error number 87 (incorrect parameters).

Can you help me. I'm not sure i'have to use Adressof instruction. How can i
translate
the C-type LPTHREAD_START_ROUTINE with VB.

Thanks !

Thierry MOURGUIART



Mon, 21 Jan 2002 03:00:00 GMT  
 CreateThread API function
Salut!

I'm afraid that I have never used the CreateThread function so I cannot provide
insight in this regard.  However, I thought that I should point out that if you
need to use AddressOf, which is probably the case,  you should spell it "
l'anglaise".

John.......

Quote:

> Hi,

> I've problems with using CreateThread function with VB 5.0.

> My question is : how can i use it ?

> My code is :

> Private declare function CreateThread Lib "Kernel32" _
> (lpThreadAttributes as SECURITY_ATTRIBUTES, _
> Byval dwStackSize as long, _
> lpStartAddress as long, _
> lpParameter as Any , _
> Byval dwCreationFlags as long, _
> lpThreadID as long) as long

> ' Create the thread
> lThread = CreateThread(tSecurity, 0, adressof DialoguerTube,
> lHandleTubeServeur, 0, lThreadID)

> I get an error number 87 (incorrect parameters).

> Can you help me. I'm not sure i'have to use Adressof instruction. How can i
> translate
> the C-type LPTHREAD_START_ROUTINE with VB.

> Thanks !

> Thierry MOURGUIART




Mon, 21 Jan 2002 03:00:00 GMT  
 CreateThread API function
You might want to find a different way of doing what you want to do.

I know you stated you are using VB5, but if you ever convert to vb6, your
calls to CreateThread will crash your application.

--
                         - Nicholas Paldino



Mon, 21 Jan 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CreateThread API function

2. How to create a thraed with createthread API function in VB ?

3. How to use the API Function CreateThread?

4. Win32 API function CreateThread

5. using the api function createthread

6. how to use CreateThread function ?

7. Pass CHAR * to Function called by CREATETHREAD

8. CreateThread API

9. CreateThread API

10. CreateThread API

11. API Call using createThread

12. CreateThread API??

 

 
Powered by phpBB® Forum Software