NO

Author Topic: GetCurrentThreadId() - Exception: Access Violation  (Read 5954 times)

ppcc

  • Guest
GetCurrentThreadId() - Exception: Access Violation
« 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 ...

« Last Edit: August 12, 2008, 08:15:28 PM by ppcc »

_SIL_

  • Guest
Re: GetCurrentThreadId() - Exception: Access Violation
« Reply #1 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;
}