|
The problem is that while the debug version stores additional information for each allocation, the release version does not. So if you did not free all the memory that you allocated, then in the debug version, the (invisible) debug code will be able to free the memory that you forgot to clean up yourself. But the release version, lacking that additional information, is unable to do that by itself. This leaves you with memory leaks. Obviously these leaks are big enough that after 59 runs you've used up all your memory.
Fix: properly free the memory that you allocate when you don't need it any more!
|
|
|
|
|
Hi all,
i m using a Edit box control with multiple line option.
and calculate the text length of edit box,here when press enter in edit box for new line the charcter length of enter key is 2.
please tell me how can i chek this and consider it as 1 char instead of 2.
thanks in advance.
|
|
|
|
|
Windows uses \r\n as a combination to get a carriage return and a line feed. You have to build your software to take that into account.
Edit: Why do you want to consider it as one char?
|
|
|
|
|
Please tell me how can i do this?
|
|
|
|
|
If you let us know exactly what you want to achieve I'm sure I or someone else could help you. Why is it important to treat it as one single char?
|
|
|
|
|
just bcoz of this enter the length of string change from the original string.
and encounter the problem in sent and received char count when i m using this string to send sms.
|
|
|
|
|
Ok, you will have to translate the text yourself, replacing \r\n with \n. If you use MFC or ATL CString::Replace()[^] will do just fine.
|
|
|
|
|
Hi!
I've to show a confirmation Message Box(with Yes and No Buttons), on closing a Modeless Dialog. How to do this?
|
|
|
|
|
Checkout this article[^] and AfxMessageBox() on MSDN.
The best things in life are not things.
|
|
|
|
|
If you are using MFC then add handlers for the OK and/or Cancel buttons (OnOK, OnCancel) and use AfxMessageBox to query the user, if the user wishes to close the dialog, call the super method, if not, then don't.
E.g:
void CMyDialog::OnCancel()
{
if (AfxMessageBox(_T("Are you completely and absolutely super-sure you wish to close this great dialog?", MB_YESNO | MB_ICONQUESTION) == IDYES) __super::OnCancel();
}
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Code-o-mat wrote: void CMyDialog::OnCancel()
{
if (AfxMessageBox(_T("Are you completely and absolutely super-sure you wish to close this great dialog?", MB_YESNO | MB_ICONQUESTION) == IDYES) __super::OnCancel();
}
This works well. But my Project Name is coming on the caption of the Message Box. How to customize this caption?
|
|
|
|
|
Use MessageBox[^] instead of AfxMessageBox:
void CMyDialog::OnCancel()
{
if (MessageBox(m_hWnd, _T("Are you completely and absolutely super-sure you wish to close this great dialog?"), _T("The Question"), MB_YESNO | MB_ICONQUESTION) == IDYES) __super::OnCancel();
}
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
pix_programmer wrote: How to customize this caption?
Try reading the MSDN documentation.
The best things in life are not things.
|
|
|
|
|
Hello
in WM_CLOSE (win32) / OnCancel() (MFC) add your message box. and according to the result returned, you can add your code.
Regards,
A. Gopinath.
|
|
|
|
|
Hmm, am I the only one who considers it weird if an attempt to close a dialog results in opening a dialog?
Sorry, just had to add this
|
|
|
|
|
Hehe, no, but I just saw the irony of it
|
|
|
|
|
i am writing small utility that will save webpage in local disk to view offline.. pls help me
|
|
|
|
|
Internet Explorer and other browsers do provide this facility.
Can you show us what have you done so far and did you have a look at the web browser control?
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
yes web browser having that interface to store in local drive. But how can i achieve same using vc++?...i can save html document of the link but some photos and style sheet all won't come ...
|
|
|
|
|
If you are working under windows, check out WinINet[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Hi!
I want to add the Icon through code in MFC. Is it possible? I've to read the Icon file name from an XML file,and add the file as an Icon from VC++ code. I don't want to go and right click the "Ico" folder and add the file. How to add an Icon from code?
|
|
|
|
|
Use the LoadImage API to load the icon from the file and then use CWnd::SetIcon to the loaded icon for the window.
|
|
|
|
|
Add it to what?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
A rather relevant question I might add.
|
|
|
|
|
Thanks.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|