- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Again, when looking for code to crib to write multithreading code, I found this and used it to start a thread:
Code:
hThread1 = CreateThread (NULL_SECURITY_ATTRIBUTES, 0, & LOC(ThreadProc), & LOC(pColor1), 0, & LOC(ThreadID1))
However, when I tried to compile it, the compiler objected to the 'LOC's saying it was the wrong type of object. By trial and error, I had to change the code to
Code:
hThread1 = CreateThread (NULL, 0, & ThrdProc, & Dummy, 0, & ThreadID1)
before it would compile correctly. Why is this? I am using CVF 6.6C.
This problem indicates that there will be a lot ofsample codes that willsimilarly fail, IMO.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are two declarations of CreateThread in CVF -- one in KERNEL32 and one in DFMT. Your first call conforms to the former, and the second to the latter. Personally, I consider DFMT "obsolescent" -- the one in Kernel32 is more consistent withother APIs.
(There's also ALLOW_NULL for lpThreadAttributes in Kernel32 version, so you may pass plain NULL() instead of NULL_SECURITY_ATTRIBUTES).
Jugoslav

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page