IT Reflexions

17 ian, 2008

(English) Sample Win32 C++ Windows Mobile 5.0 application

Posted by: Anca A. In: Windows Mobile

Din păcate acest articol este disponibil doar în English.

3 Responses to "(English) Sample Win32 C++ Windows Mobile 5.0 application"

1 | Sherif Tawfik

februarie 6th, 2009

Avatar

Hello Anca,

Thanks for the nice piece of code. However, I have tried it inside my MFC WM6 application, and I am getting this error:

Data Abort: Thread=97c2571c Proc=80096c70 ‘SMSTimer.exe’
AKY=00000801 PC=0002b9e0(SMSTimer.exe+0×0001b9e0) RA=0002b9d4(SMSTimer.exe+0×0001b9d4) BVA=18152dac FSR=0000040f

I look forward to your kind response..

Sherif

2 | Sherif Tawfik

februarie 6th, 2009

Avatar

Sorry, the code I used is the following:

//////////////////////////////////
// Retrieve the handle to the display device context.
hdc = GetDC (hWnd);

// start drawing the text that will be displayed
int bReturn;
TCHAR szHelloStr[50];

StringCchCopy(szHelloStr, 50, L”Mouse clicked!”);

// Set text color.
SetTextColor (hdc, RGB(0,0,0));

bReturn = ExtTextOut (hdc, 10 , 140, 0, NULL,
szHelloStr, lstrlen(szHelloStr), NULL);

// Release the device context.

ReleaseDC(hWnd, hdc);
////////////////////////////////

By the way, I used :: before each function, to use the CWnd functions.

3 | Sherif Tawfik

februarie 6th, 2009

Avatar

Hello Anca..

Sorry for bothering you, just solved the problem.

Bye.

Comment Form

About me

Client-focused software engineer with high intellectual mobility and experience in international teams.

Some of my interests are open innovation, design patterns, networking, personal branding, blogging and study of foreign languages.

Enjoy your visit and don’t hesitate to leave me a feedback!