|
|
Yeah, the issie is that you're leaking memory. Did you expect someone to look at the first few bytes and tell you waht the 38084 byte item is ? Surely you're not passing around enough 37k objects to not have an idea what it could be ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
! good thing there are smart people out there who answers question!
|
|
|
|
|
You're welcome. Both of us who answered told you the same thing, so I'm not sure if you're trying to insult him, or insult me. Either way, the question was impossible to answer in any way beyond what we told you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Memory leaks are not something that is easily solved. It requires a good eye and patience. Perhaps you should use this problem to train those skills?
Good music: In my rosary[^]
|
|
|
|
|
I just found out what was the problem. Thanks!
|
|
|
|
|
|
two database files been opened and never release the allocated memory
|
|
|
|
|
I downloaded mapirtf.dll/mapirtf.lip from micorsoft.com to read the rtfbody. I'm getting run time error.. I think
What should I really pass for 1st parameter?
Where can I get the Profile name for 1st parameter?
<br />
CString GetRTFBody(_MailItemPtr pMailItem)<br />
{<br />
CString mailEntryID;<br />
CString pStoreID;<br />
HMODULE hdll;<br />
LPTSTR abody;<br />
MAPIFolderPtr pmailfolder = pMailItem->Parent;<br />
<br />
hdll = LoadLibrary(_MAPIRTF_DLL);<br />
if(hdll)<br />
{<br />
<br />
_readrtf readRTF;<br />
readRTF = (_readrtf)GetProcAddress(hdll,"readrtf");<br />
readRTF(pmailfolder->GetName(),pMailItem->EntryID,pmailfolder->StoreID,&abody);<br />
}<br />
<br />
CString rtfbody(abody);<br />
return rtfbody;<br />
}<br />
|
|
|
|
|
pnpfriend wrote:
I'm getting run time error.
Where?
pnpfriend wrote:
What should I really pass for 1st parameter?
To what function?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Oh I'm sorry.
I'm getting error at readrtf () function.
I think I'm passing the wrong information to readrtf().. especially parameter one. Mapirtf.cpp explain about readrtf() defination as follow: but I dont' know where to get Profile name..
<br />
DllExport HRESULT WINAPI readrtf (LPSTR lpProfileName,<br />
LPSTR lpMsgIDSrc,<br />
LPSTR lpStoreIDSrc,<br />
LPSTR *lpRTF)<br />
In the example of readrtf() provided by microsoft, http://support.microsoft.com/?kbid=172038[^] get the session, mapi message and the logon then readrtf(). I'd tried to get the session of as follow, but doesnt' work.. I dont' know how to covert that vb example code (from 172038) to c++.
<br />
<br />
CoInitialize(NULL);<br />
_ApplicationPtr pApp; <br />
hr=pApp.CreateInstance(__uuidof(Application));<br />
if (FAILED(hr))<br />
{<br />
MessageBox("Unable to instantiate Outlook.","Outlook Error",MB_OK);<br />
return;<br />
}<br />
<br />
pNS = pApp->GetNamespace(_bstr_t("MAPI"));<br />
_NameSpacePtr session = pApp->GetNamespace(_bstr_t("MAPI.Session"));<br />
<br />
<br />
thanks for your reply David.
|
|
|
|
|
I also have another question
I tried to include mapix.h and mapiutil.h to my project so I can call
MAPIInitialize() and LPMAPISESSION session memeber functions.
However, when I run the application.. I got error saying
WCHAR: is redefiniation; different basic types. error is in "MAPIDef.h"
what am I missing again? do I need to support the unicode? if so how can I do that?
I tried to add
#ifundef UNICODE
#define _UNICODE
to stdafx.h but I still get the same error.
What can I do to get the rtf message body of email?
Thanks
|
|
|
|
|
I'm messing with the status bar of my MFC SDI app to change the message from 'ready' to 'working' while doing a lengthy computation using the setup linked below. I've got everything working except that intially there is no value for the default status text. I've tried calling StatusBarMessage() from the constructor and OnCreate events, but in both cases it causes a null reference exception because the GUI components haven't been created yet. Where should I move the initialization call to.
http://www.codeguru.com/Cpp/controls/statusbar/article.php/c2973/#more
|
|
|
|
|
Which pane of the status bar are you attempting to change?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
The left most that normally displays "Ready" or a description of the current menu/toolbar item.
I solved my problem by calling the init code in InitializeInstance. *duh*
|
|
|
|
|
I also 'handled' WM_SETMESSAGESTRING in one of my MFC apps, and in that case I could set the message to anything I wanted, and also avoid messages I did not want to appear in the status bar that the framework might have posted automatically.
Oh, I also remember I did this because the message text was not in pane 0 of my staus bar, it was in the right-most pane instead of the left-most pane.
|
|
|
|
|
I'm trying to make an edit box that will involve more complicated entry than just one line. In fact, sometimes I want to prefill my edit box from a file. I've already set the multiline property, and the 'want return' property, so it appears to be working properly when typing into it, but if I load in information from a file, the newline characters get changed into a funny vertical blackened box. How can I get the edit box to format them properly, turning the newline character into an actual newline?
Danny
|
|
|
|
|
bugDanny wrote:
How can I get the edit box to format them properly, turning the newline character into an actual newline?
Use \r\n instead.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
Thank you both. By the way, what does the \r mean?
Danny
|
|
|
|
|
|
I've added several items to my menus at designtime; thier Enabled properties are true, and their grayed properties are false; but at runtime they're grayed out and inactive. Is there something I need to do to activate them?
|
|
|
|
|
Problem fixed. I had my handlers set for ON_UPDATE_COMMAND_UI instead of ON_COMMAND. Been too long since I've done anything with mfc obviously.
|
|
|
|
|
Hi.
How could I know when Windows is closing.
Because I have a program always loading and I want to trap the Window's closing, to show a message box.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
-- modified at 14:35 Wednesday 21st September, 2005
|
|
|
|
|
You may override the WM_NCDESTROY message handler like this
void CyourDlg::OnNcDestroy()
{
MessageBox("Dialog is going to be closed...");
CDialog::OnNcDestroy();
}
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 15:02 Wednesday 21st September, 2005
|
|
|
|