Click here to Skip to main content
15,914,163 members
Home / Discussions / Mobile
   

Mobile

 
GeneralDetecting hardware Pin
seanwright18-Nov-04 8:28
seanwright18-Nov-04 8:28 
GeneralShowCursor and Threads Pin
Rajesh Prabhu. R17-Nov-04 22:17
Rajesh Prabhu. R17-Nov-04 22:17 
Questionhow can i develope Pin
NewtonOfComputers17-Nov-04 20:03
NewtonOfComputers17-Nov-04 20:03 
Generalmobile games Pin
bigdeeoo716-Nov-04 13:53
bigdeeoo716-Nov-04 13:53 
GeneralAPIs equivalent in Windows CE Pin
fjlv200515-Nov-04 23:18
fjlv200515-Nov-04 23:18 
GeneralDialog-based project Pin
illidan9915-Nov-04 3:46
illidan9915-Nov-04 3:46 
GeneralRe: Dialog-based project Pin
eli1502197921-Nov-04 0:44
eli1502197921-Nov-04 0:44 
GeneralNewbie question: CDC, CBitmap, and Member Functions Pin
nandhp14-Nov-04 10:49
nandhp14-Nov-04 10:49 
First of all I'm using eMbedded Visual C++ 3.0, PPC2002 SDK, and I have a AppWizard SDI application without a Document. With me so far?

Okay, now here's my problem.

I'm hoping to produce a game for Pocket PC as a programming excersize. Probably Freecell.

My OnPaint function for CChildView does the following:
1. It makes the background green.
2. It creates a CBitmap from a resource and draws it.
3. It calls a member function which does the same thing as 2, except with a different bitmap (ShowCard)
4. It calls another member function which takes a parameter telling it which of two bitmaps to draw and draws the appropriate one. (ShowKing)

Now I have a OnClick handler in CMainFrame, which calls a member function in CChildView, which handles the OnClick event.

This handler determines which half of the screen you clicked, then tells ShowKing which bitmap to draw. But it doesn't actually do it:

void CChildView::ShowKing(int facing) {
CPaintDC dc(this); // device context for painting
CDC tempdc;
CBitmap card;
if ( facing == 1 ) card.LoadBitmap(IDB_KINGRIGHT);
else card.LoadBitmap(IDB_KINGLEFT);
card.CreateCompatibleBitmap(&tempdc,29,41);
tempdc.CreateCompatibleDC(&tempdc);
tempdc.SelectObject(&card);
dc.BitBlt(113,3,14,16, &tempdc,0,0,SRCCOPY);
}


Can anyone help me figure out what's wrong?

-nand
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
eli1502197915-Nov-04 2:53
eli1502197915-Nov-04 2:53 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
nandhp15-Nov-04 8:41
nandhp15-Nov-04 8:41 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
Jonas Larsson15-Nov-04 20:56
Jonas Larsson15-Nov-04 20:56 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
nandhp16-Nov-04 6:46
nandhp16-Nov-04 6:46 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
Jonas Larsson16-Nov-04 7:09
Jonas Larsson16-Nov-04 7:09 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
nandhp16-Nov-04 9:11
nandhp16-Nov-04 9:11 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
nandhp20-Nov-04 8:22
nandhp20-Nov-04 8:22 
GeneralAbout context menu Pin
sea_caty14-Nov-04 6:21
sea_caty14-Nov-04 6:21 
Generaldrive mapping Pin
Jan van den Baard13-Nov-04 5:26
professionalJan van den Baard13-Nov-04 5:26 
GeneralInfra red strange problem Pin
wk_vigorous11-Nov-04 6:47
wk_vigorous11-Nov-04 6:47 
GeneralBasic question Pin
eli1502197911-Nov-04 4:19
eli1502197911-Nov-04 4:19 
Questionwhy does it take 3 DestroyWindow()'s to kill my child? Pin
hedpe10-Nov-04 22:58
hedpe10-Nov-04 22:58 
GeneralUsing VC++ Express for Windows Mobile Pin
Member 213881410-Nov-04 21:18
Member 213881410-Nov-04 21:18 
GeneralRe: Using VC++ Express for Windows Mobile Pin
eli1502197910-Nov-04 23:48
eli1502197910-Nov-04 23:48 
Questionnew version of win mobile? Pin
Roger Alsing10-Nov-04 20:30
Roger Alsing10-Nov-04 20:30 
GeneralPlease helpppppppp Pin
eli1502197910-Nov-04 3:25
eli1502197910-Nov-04 3:25 
GeneralRe: Please helpppppppp Pin
GDavy11-Nov-04 1:00
GDavy11-Nov-04 1:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.