Click here to Skip to main content
15,894,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: linker cannot find shared library... Pin
Salvatore Terress15-Dec-23 11:47
Salvatore Terress15-Dec-23 11:47 
GeneralRe: linker cannot find shared library... Pin
Salvatore Terress16-Dec-23 10:03
Salvatore Terress16-Dec-23 10:03 
GeneralRe: linker cannot find shared library... Pin
k505416-Dec-23 12:13
mvek505416-Dec-23 12:13 
GeneralRe: linker cannot find shared library... Pin
Salvatore Terress17-Dec-23 11:19
Salvatore Terress17-Dec-23 11:19 
GeneralRe: linker cannot find shared library... Pin
Richard MacCutchan16-Dec-23 21:16
mveRichard MacCutchan16-Dec-23 21:16 
Questionhow to add full path #include ? Pin
Salvatore Terress10-Dec-23 5:57
Salvatore Terress10-Dec-23 5:57 
AnswerRe: how to add full path #include ? Pin
Dave Kreskowiak10-Dec-23 6:19
mveDave Kreskowiak10-Dec-23 6:19 
GeneralRe: how to add full path #include ? Pin
Mircea Neacsu10-Dec-23 8:06
Mircea Neacsu10-Dec-23 8:06 
GeneralRe: how to add full path #include ? Pin
Dave Kreskowiak10-Dec-23 15:30
mveDave Kreskowiak10-Dec-23 15:30 
GeneralRe: how to add full path #include ? Pin
Peter_in_278010-Dec-23 16:25
professionalPeter_in_278010-Dec-23 16:25 
GeneralRe: how to add full path #include ? Pin
jschell11-Dec-23 4:33
jschell11-Dec-23 4:33 
GeneralRe: how to add full path #include ? Pin
Dave Kreskowiak11-Dec-23 4:41
mveDave Kreskowiak11-Dec-23 4:41 
GeneralRe: how to add full path #include ? Pin
k505411-Dec-23 6:12
mvek505411-Dec-23 6:12 
GeneralRe: how to add full path #include ? Pin
Dave Kreskowiak11-Dec-23 9:19
mveDave Kreskowiak11-Dec-23 9:19 
GeneralRe: how to add full path #include ? Pin
jschell12-Dec-23 5:13
jschell12-Dec-23 5:13 
GeneralRe: how to add full path #include ? Pin
Dave Kreskowiak12-Dec-23 5:25
mveDave Kreskowiak12-Dec-23 5:25 
GeneralRe: how to add full path #include ? Pin
k505412-Dec-23 5:31
mvek505412-Dec-23 5:31 
GeneralRe: how to add full path #include ? Pin
jschell12-Dec-23 11:10
jschell12-Dec-23 11:10 
GeneralRe: how to add full path #include ? Pin
Dave Kreskowiak12-Dec-23 11:19
mveDave Kreskowiak12-Dec-23 11:19 
GeneralRe: how to add full path #include ? Pin
k505412-Dec-23 5:30
mvek505412-Dec-23 5:30 
GeneralRe: how to add full path #include ? Pin
jschell12-Dec-23 11:06
jschell12-Dec-23 11:06 
AnswerRe: how to add full path #include ? Pin
Mircea Neacsu10-Dec-23 8:11
Mircea Neacsu10-Dec-23 8:11 
AnswerRe: how to add full path #include ? Pin
Richard MacCutchan10-Dec-23 21:48
mveRichard MacCutchan10-Dec-23 21:48 
Question[edit: most problems fixed, one problem remaining] Invalidate rectangle follow up, flickering and no movement Pin
Calin Negru9-Dec-23 23:10
Calin Negru9-Dec-23 23:10 
[edit] I solved the background flickering problem by changing the last argument in the InvalidateRect() function to false. I also got the test rectangle moving. The only problem left is that the white moving rectangle is still flickering.
[/edit]

I wrote some code, for some reason the rectangle that should work as background is flickering and I can`t get a test rectangle to move.
I`m pasting the source bellow, please help me get my code in proper configuration.

while (WM_QUIT != msg.message)
{
	if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	else
	{
		UpdateGame();
	}
}

//...
switch (msg)
{
case WM_PAINT:
	hdc = BeginPaint(hwnd, &ps);
	draw(hdc);
    movingR = movingR + 0.1;
	RECT ARectangle;
	ARectangle.left = 0;
	ARectangle.top = 0;
	ARectangle.right = 600;
	ARectangle.bottom = 600;
	
	InvalidateRect(hwnd, &ARectangle, false);
	UpdateWindow(hwnd);
	
	EndPaint(hwnd, &ps);
	return 0;
//...

void draw(HDC hdc)
{
	Gdiplus::Graphics gf(hdc);
	Gdiplus::Pen pen(Gdiplus::Color(255, 255, 0, 0));
	Gdiplus::SolidBrush brush(Gdiplus::Color(255, 0, 255, 0));
	Gdiplus::SolidBrush brush2(Gdiplus::Color(255, 255, 255, 255));

	gf.FillRectangle(&brush, 0, 0, 600, 600);
	gf.FillRectangle(&brush2,(int)movingR, 200, 100, 100);

}
//...

void UpdateGame()
{
	//movingR = movingR + 1;
}


modified 10-Dec-23 7:50am.

AnswerRe: [edit: most problems fixed, one problem remaining] Invalidate rectangle follow up, flickering and no movement Pin
Mircea Neacsu10-Dec-23 2:03
Mircea Neacsu10-Dec-23 2:03 

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.