![]() |
Error calling createthread
I'm getting an error when making the following (windows api) call:
createthread(nil,0,@read_winboard,nil, 0,Threadid); The error message says "variable required". read_winboard is an existing procedure, and Threadid is a declared dword. I'm using a slightly modified version of this code. "Variable required" sounds like I need to send a variable instead of a value, in which case it's one of the nils or the zero that need to be changed. I've tried changing things back and forth but with no result, and I can't find any comprehensible info to set things straight. And I don't put too much faith into what and error message "sounds like". So, anyone got any solid info? |
I am not sure precisely what you mean by is a "declared dword". ThreadID is used by the kernel32.lib function to return the id for the thread that has just been created.
I tried the following code just to be certain it works :
type ENoThread = class(Exception);and it works just fine. There is one thing you should be aware of - the way Win32 functions are defined in the Windows API help is not always the way they are declared in Delphi. Typically you should look for the external function declaration in the appropriate Delphi unit. If you are not sure begin with Windows.PAS. It is not at all uncommon for parameters that appear as lpSomething in the Windows help file to turn up as Delphi var parameters in the declaration. Hope this helps. |
Re: Error calling createthread
Quote:
|
| All times are GMT -5. The time now is 5:58 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC