Results 1 to 2 of 2

Thread: C++ Programming beginner

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    84

    C++ Programming beginner

    Hi fellow forum users,

    I'm trying to learn Visual C++. I have run into some problems while learning to use the complier. I'm currently studying the the book " Teach Yourself Visual C++ in 21 Days"

    The problem is that I can't seem to understand the problem with this code example in the book.

    Code:
    void CMouseDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
    {
    
    		char IsChar;
    	HCURSOR ihCursor;
    
    	IsChar = char (nChar);
    
    	if (IsChar == 'A')
    	{
    		ihCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
    		SetCursor(ihCursor);
    	}
    		if (IsChar == 'B')
    		{
    			ihCursor = AfxGetApp()->LoadStandardCursor(IDC_IBEAM);
    		SetCursor(ihCursor);
    
    	}
    		if(IsChar == 'C')
    		{		
    			ihCursor = AfxGetApp()->LoadStandardCursor(IDC_WAIT);
    		SetCursor(ihCursor);
    		}
    		if (IsChar == 'X')
    		{
    			ihCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
    		SetCursor(ihCursor);
    		
    	OnOK();
    		
    	{	
    	CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
    	{
    		
    	}
    I will upload the complete code if is required, but it appears to be this section of the code causing the problem. The letters are ment to change the arrow icon to a wait icon and a beam icon.

    I don't know anything about Visual C++ so your advise would be most helpful to get some insight to the problem.

  2. #2
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: C++ Programming beginner

    Wrong forum i am afraid...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width