|
-
Aug 23rd, 2000, 03:32 PM
#1
Thread Starter
Frenzied Member
I have a problem with this code .
'in module
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
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
Public Sub Threadfunc()
dim i as integer
do until i = 20
form1.caption = i
sleep 500
i = i+1
loop
End Sub
'in form1
Private Sub Command1_Click()
Dim hThread As Long, hThreadID As Long
hThread = CreateThread(ByVal 0&, ByVal 0&, AddressOf threadfunc, ByVal 0&, ByVal 0&, hThreadID)
End Sub
When i run it in VB it works fine but when i run it as a compiled EXE un illegal operation in msvbvm60.dll occurs.
What's the problem?
-
Aug 23rd, 2000, 03:40 PM
#2
_______
<?>
If you are running the compiled version on a machine without VB installed you will need to copy the VB msvbvm60.dll file into the windows system dir of the machine you are running the exe on.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 23rd, 2000, 03:43 PM
#3
Thread Starter
Frenzied Member
No, no, i have all vb runtime files including the msvbvm60.dll in the system dir.
-
Aug 23rd, 2000, 03:59 PM
#4
_______
<?>
It does so on my system as well..another thing is if in the app before you convert it to an exe you stop before it reaches 19 you will get a different dll error and crash VB.
I have no explanation as to why!
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
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
|