|
Yes, MFC does have a few, but those too are revealed when your application is shut down.
John R. Shaw wrote: 2) “The largest…” sounds familiar are you sure you are the original source?
I'm not 100% sure. I heard on the radio that all thing begin as something, even fire as a spark. I thought about that for a minute and settled on the quote. If it belongs to someone else, it was not intentional.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I believe you 100%, but I know I have read or heard that quote before (multiple times). But half the stuff I figured out or made a statement about (mostly when I was younger) had already been done by someone else. When I first sat down with a piece of graphics paper and figured out how to draw a line (simple algebra) via C code (before the Web) I was not shocked that some one else had already done that. What bothered me was that he (some professor) wrote a paper on it (years before) and therefore (from an academic point of view) I could not have figured it out on my own. I some times think we are dealing with a bunch of intellectual idiots, just because someone solved the same problem before you did (and you did not know about it) does not lessen the fact that you discovered it [separately].
I got a little carried away there. I am going back to school and discovered a few months back that no matter how accurate my paper is I still need to search the Web to find [supporting] references, because I am not an expert until I have published (with per-review). Even then you are not an expert on the subject unless you where the first person to write about it, in which case you can quote yourself.
“When you fall down it hurts!” – John R. Shaw
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
i used LoadMappedBitmap,CreateMappedBitmap in my program.it is compiled successfully but it is showing runtime error?why?
E-Ramu
|
|
|
|
|
Can you be more specific,how to use?whats error?
whitesky
|
|
|
|
|
What does the debugger say about the problem?
|
|
|
|
|
CBitmap b;
b.LoadMappedBitmap(IDB_BITMAP3,0);
i wrote these 2 lines.the debugger is showing that "the memory could not be read".but it is working when i use b.LoadBitmap(IDB_BITMAP3) instead of MappedBitmap
E-Ramu
-- modified at 8:01 Thursday 15th June, 2006
|
|
|
|
|
i wrote
<br />
CBitmap b;<br />
b.LoadMappedBitmap(IDB_BITMAP,0); and it return 1 and it work a another question whats IDB_BITMAP3?(detaily)
whitesky
|
|
|
|
|
void CMainFrame::OnCreate()
{
CBitmap b;
b.LoadMappedBitmap(IDB_BITMAP1,0);
m_bt.SetBitmap(b);
}
Note:-Here IDB_BITMAP1 is a bitmap ID and m_bt is a button.i want to place the bitmap on button.if i use b.LoadBitmap(IDB_BITMAP1) instead of LOadMappedBitmap it is working correctly.where is the problem?
E-Ramu
|
|
|
|
|
Are you sure that your problem is LoadMappedBitmap i write your code but i get return 1 one question why you use this function in OnCreate
whitesky
|
|
|
|
|
Dear Everyone;
I have got a picture control placed on top of an activex control (web broswer).Just to make th eproblem clearer i had to do some drawings on top of the web browser. I have then subclassed the picture control and overriden its OnPaint() function.
I am doing some drawings in the overridden OnPaint(). Now, everytime the user clicks on a button "Draw" a flag is set to TRUE in the overriden OnPaint() and some shapes are drawn. The drawings are done fine
I have another button "Clear" that is supposed to clear the previous drawings. How do i clear what i have drawn ??
Thank you
llp00na
|
|
|
|
|
Call Invalidate and draw nothing in the OnPaint()
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
thanx for your reply;
I used your approach. However i had the background (the web browser) erased evrytime Invalidate is called. So i did what guys suggested (hiding the control).
cheers
llp00na
|
|
|
|
|
Cédric Moonen is absolutely correct; that is the simplist solution.
But since you say you have a picture control placed on top of the other window, why don't you just hide it. The problem with not drawing anything when OnPaint() is called (for the picture control) is that the picture control is still there and it may call a function to erase the background before calling OnPaint(), which would leave an empty blank spot on the screen.
Just some thoughts,
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Thanx alot,
Cedric Moonen' suggestion was n't giving me the right result. It's exactly how u explained it. I had the background erased everytime Invalidate was called. Hiding the control worked much better.
llp00na
|
|
|
|
|
Maybe for you task is more appropriate to hide your picture control? When you click the Clear button, you can call m_cMyPicture.ShowWindow(SW_HIDE) function for your picture, and when you click the Draw button you can execute m_cMyPicture.ShowWindow(SW_SHOWNA) . Now you do not need to check a flag in OnPaint .
|
|
|
|
|
hi dear i am sorry i put my problem but u dont ans me
so plz
tel me result for this
cn u send me an example as i easily undestand
i hav three dialog boxes
third dialog box contain menu
i want that when i goto third dialog box from first dialog box then its menu are disabled but when i go from second dialog box third dialog box menues are not disabled.
plz send me code how to do it
note : specially for viorel
Please mail me
|
|
|
|
|
Thanx very much for the code. It really helped alot, hiding the control was the trick. But i still need flag in OnPaint() because the drawings are only done when the user requests.
llp00na
|
|
|
|
|
how do i incorporate socket arrays in this code..
CAsyncSocket m_sListener,m_sConnected;
void CCsDlg::OnAccept()
{
CString serverIP;
UINT port;
port=2000;
serverIP="10.1.46.37";
if(m_sListener.Accept(m_sConnected))
{
m_sConnected.GetSockName(serverIP,port);
UpdateData(TRUE);
}
else
{
AfxMessageBox("Cannot Accept Connection");
}
}
|
|
|
|
|
Hi,
I need develop a zip/unzip folders and files in C++.
Have any one help me with some open source link or example code?
Tx
|
|
|
|
|
|
Check out InfoZip. http://www.info-zip.org/[^]
AFAIK, both Winzip and java.util.zip are based om InfoZip. So there won't be any compatibility problems using it.
|
|
|
|
|
|
Hi all,
I like to create a kind of digital clock as an ocx. therefore other programmer can use my ocx inside their program. problem is:
1. How can i set up the timer for an ocx?
Note: I have create a WM_CREATE message handler and put the SetTimer command in it. Then I Create a WM_TIMER message handler and put the increment of the "second" in it, and display the number inside the OnDraw. But, it seems that the WM_TIMER message handler is never been called (that make my "Second" number never changed)
2. Is it possible to use a dialog box for an ocx, or do I have to always use OnDraw to draw something inside the ocx?
Below is the code that mimic the functionality of my digital clock. I use a data member called m_number that has been set to 0 inside the CxxxCtrl constructor. I expect to have this number increased each second elapsed. But it just didn't work. Any help please. Thanks.
// CTimerOcxCtrl::OnDraw - Drawing function
void CTimerOcxCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
CRect rectOcx = rcBounds;
CString strNumber;
strNumber.Format("%ld", m_number);
pdc->DrawText(strNumber, rectOcx, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
}
/////////////////////////////////////////////////////////////////////////////
// CTimerOcxCtrl message handlers
void CTimerOcxCtrl::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
m_number ++;
if (m_number > 100)
m_number = 0;
COleControl::OnTimer(nIDEvent);
}
int CTimerOcxCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
/*
CWnd *pMainWnd = AfxGetMainWnd();
HWND hWnd = pMainWnd->GetSafeHwnd();
*/
//SetTimer(hWnd, ID_TIMER1, 100, NULL);
SetTimer(ID_TIMER1, 100,NULL);
return 0;
}
|
|
|
|
|
budihartanto wrote: Is it possible to use a dialog box for an ocx,
its possible..
in the CTimerOcxCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
funtion u can create a child dialog. It will be displayed when the ocx is inserted.
nave
|
|
|
|
|
budihartanto wrote: But, it seems that the WM_TIMER message handler is never been called (that make my "Second" number never changed)
I think you need to invalidate or redraw the window on each WM_TIMER message. In your OnTimer handler, before returning you should try one of this:
InvalidateControl(NULL, FALSE);
or
InvalidateControl(NULL, TRUE);
or
Invalidate(FALSE);
or
Invalidate(TRUE);
or
RedrawWindow(NULL, NULL, RDW_UPDATENOW);
or
RedrawWindow(NULL, NULL, RDW_UPDATENOW | RDW_ERASENOW);
or other appropriate.
Hope it helps.
|
|
|
|