|
-
July 28th, 2010, 04:26 AM
#2
Re: [MFC] Refreshing Picture Control
Please use code tags for posting readable code.
You can use Invalidate to force a window to redraw itself.
Some notes on your code.
In the OnRead...
Code:
CComPort* pComPort = new CComPort(g_sComPort);
This is never freed, so you have a memory leak.
In the OnPaint...
Code:
CGPSDlg m_bridge;
y=m_bridge.m_nLatitude;
You are creating a new window in the OnPaint. This will slow down your paint, because creating a new window is relatively a intensive job, and the OnPaint can be triggered a lot of times without you knowing it. Also, the class is new, so the m_nLatitude has it's default value, not the value you put in there during the OnRead function.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|