Pelles C forum

C language => Pocket PC and Smartphone questions => Topic started by: ppcc on August 10, 2008, 04:53:26 PM

Title: GetCurrentThreadId() - Exception: Access Violation
Post by: ppcc on August 10, 2008, 04:53:26 PM
Hi all,
I'm new in programming for ppc and not very experienced in Windows programming. For programming ppc I started using PellesC and like it a lot.
 
I had lot's of problems in compiling sqlite (v3.6.1 amalganation) on PellesC (v5.008) for ppc WM5. I have now been able to compile a lib and include it in an application. Retriving the sqlite-version function works, but trying to open a database results in an app-crash. By debugging I narrowed it down to the function call GetCurrentThreadId().

Even a naked ""Hello, Pocket PC!"" Project added with GetCurrentThreadId() results in an Exception Access Violation. On a Win32 (pc) Project it works properly.

Referring to the MS Platform SDK GetCurrentThreadId() is supported since WinCE 1.0.
I also found the declaration in PellesC <kfuncs.h>
Do I have to prepare something, maybe Compiler-settings, in order to use this function?

google was not helpful in this problem, any hint is welcome
ppcc

//edit
I just tried it with ppc WM5 Emulator - same result.
I attached a part of the error log, in case it's helpful for someone ...

Title: Re: GetCurrentThreadId() - Exception: Access Violation
Post by: _SIL_ on April 18, 2011, 10:44:27 AM
I found simple way to solve that problem!!! 8)

Code: [Select]
DWORD myGetCurrentThreadId(void){
return *(DWORD*)0xFFFFC808;
}

DWORD myGetCurrentProcessId(void){
return *(DWORD*)0xFFFFC80C;
}