very simple problem......casting.......

This is a discussion on very simple problem......casting....... within the Windows Programming forums, part of the Platform Specific Boards category; Ok I just want to cast this down......... Code: case WM_CREATE: hdc=GetDC(hwnd); Image BackGround; BackGround.LoadPic("Sunset.bmp",hdc); BitBlt(hdc,NULL,NULL,NULL,NULL,BackGround.GetBitMapDC,NULL,NULL,SRCCOPY); return 0; /****This is ...

  1. #1
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    very simple problem......casting.......

    Ok I just want to cast this down.........

    Code:
        case WM_CREATE:
    
    		  hdc=GetDC(hwnd);
    		  Image BackGround;
    		  BackGround.LoadPic("Sunset.bmp",hdc);
    		  BitBlt(hdc,NULL,NULL,NULL,NULL,BackGround.GetBitMapDC,NULL,NULL,SRCCOPY);
    		  return 0;
        
    
    
    
    
    
    
    /****This is my class *************/
    
    
    class Image
    
    
    {
    public:
    	
    	void LoadPic(char*, HDC);
    	HDC GetBitMapDC(){return BitMapDC;}
    	
    
    
    private:
    
    	HDC BitMapDC;
    	HBITMAP CreatedBitMap;
    
    
    };
    
    
    
    void Image::LoadPic(char* FileName, HDC hdc)
    
    {
    	CreatedBitMap=(HBITMAP)LoadImage(NULL,FileName,IMAGE_BITMAP,NULL,NULL,LR_LOADFROMFILE);
    	BitMapDC=CreateCompatibleDC(hdc);
    	SelectObject(BitMapDC,CreatedBitMap);
    
    }

    Error I am getting "error C2664: 'BitBlt' : cannot convert parameter 6 from 'struct HDC__ *(void)' to 'struct HDC__ *'
    There is no context in which this conversion is possible"

    Thank you guys, I know it's a very trivial error but I don't know what the problem is.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  2. #2
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    never mind () forgot those......lol
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Fairly simple problem
    By fatdunky in forum C Programming
    Replies: 1
    Last Post: 11-14-2005, 10:34 PM
  2. Simple Variable Problem
    By Cthulhu in forum C++ Programming
    Replies: 2
    Last Post: 11-11-2005, 03:07 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  4. Replies: 5
    Last Post: 12-03-2003, 04:47 PM
  5. Simple? winsock client - server problem
    By knutso in forum Windows Programming
    Replies: 2
    Last Post: 03-26-2003, 03:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21