Help: AfxGetApp ->OpenDocumentFile crashes in release mode
Programming and Web Development Forums - VC - Microsoft Visual C
Skip to content
Board index VC
Change font size
FAQ
Register
Login
Help: AfxGetApp ->OpenDocumentFile crashes in release mode
VC
Post a reply
2 posts Page 1 of 1
Jump to:
Windows
MS EXCEL
MS OFFICE OUTLOOK
Exchange 2000
pocket pc
VB.NET
VC
Windows
Sponsored Links
1. enabling nt service
How does one enable/disable a service using mfc/win32 api's? Starting Stopping and pausing is easy, but i don't see anything about enabling/disabling. Greg
2. memory leak with grandchild class
Seems like I should know how to solve this, but I'm drawing a blank right now. Until recently, all my sprite classes have been derived from my class CSprite. Now that I have derived a class from one of the derived classes, I am getting this from my debugger, often with more lines than this. Detected memory leaks! Dumping objects -> C:\Hand in Hand\Room 101\Sprite.cpp(111) : {207} client block at 0x003273D8, subtype 0, 60 bytes long. a CBitmap object at $003273D8, 60 bytes long C:\Hand in Hand\Room 101\Sprite.cpp(111) : {206} client block at 0x00327360, subtype 0, 60 bytes long. a CBitmap object at $00327360, 60 bytes long Object dump complete. The line it takes me to is in the base class: void CSprite::DrawMask { . . . m_dibsMask[i] = new CDIBSection(this); . . . } I also delete my dibSections in the base class destructor: CSprite::~CSprite { int i; for(i = 0; i OpenDocumentFile crashes in release mode
by Dr. Jan Itor " Fri, 04 Feb 2005 14:08:39 GMT
Help!
The line
AfxGetApp ->OpenDocumentFile works fine on my computer (where I compiled the application using VC
2003 .NET), but crashes on different computer that doesn't have the VC
installed. I copied 3 dll's to other computer system32 dir:
MFC71.dll
Msvcr71.dll
mfc71enu.dll
The debug version works fine on both computers, but I had to copy 2
more dlls (ending with d) to other computer. I also tried linking MFC
statically, but it still crashes...
What am I missing here?
Any help is greatly appreciated !
Top
Re: Help: AfxGetApp ->OpenDocumentFile crashes in release mode
by Dr. Jan Itor " Sat, 05 Feb 2005 02:17:14 GMT
I just narrowed it down a little. It turns out that doc is getting
created, but it crashes before the view is created.
Help !
Jan Itor
Top
Similar Threads:
1.CSingleDocTemplate crashes in Release mode, works on in Debug mode
Hi !
I am having problem with release build in Windows Mobile 5, Smartphone SDK.
In my app's InitInstance, I do this:
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(MbxDoc),
RUNTIME_CLASS(MbxFrame), // main SDI frame window
RUNTIME_CLASS(MbxView));
if (!pDocTemplate)
return FALSE;
In debug mode, it works ok, both in Pocket PC and Smartphone.
In release mode, it works also ok in Pocket PC. But in smartphone, it
crashes. I could trace till LoadTemplate and then stack and memory gets
corrupted and all crashes.
I am staring at my resources files a while, but have no idea what can go
wrong.
I check format of IDR_MAINFRAME string, menu, icon. all ok (they worked
after all in debug mode).
can any one give me clue - what can a be a problem? I can send more
information/code if needed.
I strongly suspect 2 things: (1) something wrong with my resources and (2)
there is some problem with Smartphone SDK, some difference which I do not
know.
any help/hint is appreciated.
regards.
Seshu
2.Help: AfxGetApp ->m_pMainWnd != AfxGetMainWnd ?
Hi,
Is there any case that these two are not the same? I encounter some
strange problems with my application.
Previously I used the CMainFrame *pFrame = (CMainFrame*)
AfxGetMainWnd in Func1, to get the CMainFrame pointer, but there are
sometimes that this function returns an invalid pointer value, then
when I try to access some functions in the CMainFrame, it crashes. But
When I switch to use the following method,
CMyApp *pApp = (CMyApp *) AfxGetApp ;
CMainFrame *pFrame = (CMainFrame*) pApp->m_pMainWnd;
It works fine, I am just wondering in what kind of situation does this
case happen?
Append more details, Func1 is defined as a static function, and this
function is an event driven function. It means another thread call
this Func1.
Hope that I have provided enough details, and wish to get answers
soon.
Thanks all !
3.Release mode causes crash
Hi,
I've tried converting the current project I'm working on into Release
Mode. It keeps crashing on the vftable throwing an memory exception.
The function stack looks like:
App!ClassName::`vftable' 0x1
I have the application in a multi-threaded DLL and optimizations have
been turned off.
I would greatly appreciate any help anyone is willing to give for this
problem.
Regards,
Keith
4.Mixed mode DLL causing crash in release outside of debugger =)
I had a c++.net project that would terminate without exception in release
mode, but work perfectly in debug mode. I modified the project settings for
release mode to disable some, if not all optimizations and the project now
works in release mode. After that, I did a google search in the vc dotnet
newsgroups and found that others have had the same problem and it seems to
have been fixed in the vc2005 beta. What i would really like is for
microsoft to release a patch/fix for this for vc7.1 that is probably highly
unlikely.
"Drew" wrote in message
news: abo6do@r.postjobfree.com ...
> My client is in C#. Most of my code is in C++. I have a mixed mode C++
> layer
> sitting between the two.
>
> Environment: VS .NET 2003
>
> Running my debug code in our outside of the debugger works normally.
> Running my release code inside the debugger works normally.
> Running my release code outside of the debugger crashes on a particular
> line.
>
> Turning off optimizations APPEARS to have fixed the problem. My questions
> are:
>
> 1. The call happens a function in my mixed mode DLL in an unmanaged class
> with all methods declared as static. I pass in some of my unmanaged
> objects
> and they get marshalled to a managed class of mine and visa versa. Is
> there
> anything wrong with this that might cause .NET problems? My application
> uses
> the STL very genourously (deques, maps, etc.).
>
> 2. Has anyone heard of any bugs relating to .NET's optimizer with mixed
> mode
> dll's? As I stated earlier, turning off opimizations APPEARS to fix the
> problem. But I have enough experience to know that this problem will most
> likely just bite me later on when the application eventually gets
> released. :(
>
> Our unmanaged code runs rock solid in a legacy app where VB is the front
> end. I doubt it's any kind of memory corruption in the unmanaged code.
>
> Thanks for any replies.
5.[std::vector] _CRT_DEBUGGER_HOOK crash in Release mode only -- [SOLVED by work-around]
On Apr 15, 4:33m, "Giovanni Dicanio"
wrote:
> "Ulrich Eckhardt" ha scritto nel messaggionews: abo6do@r.postjobfree.com ...
>
> > Your original code had an index that was out of range, hence at threw an
> > exception which your program was not prepared to handle.
>
> I think that there is something more subtle in OP's code (maybe some
> corruption of something).
>
> In fact, if you read his call stack, you will see that at was called with
> _Pos (index) = 0.
> And OK an exception was thrown.
>
> But, *before* invoking at, there was a check on array index in the OP's
> code:
>
>
>
> f ((size_t)iSubIte> >= size >
> eturn FA>SE>
>
> onst REPORT_DATA_ITEM& data = at (iSubIt>
> So, if the instance of std::vector were in a good state, FALSE sho>ld be
> returned *before* reaching the at method invoc>tion.
> Instead, it seems to me that the if is passed on like if the iS>bItem
> variable stored a good index, and then at crashes with a bad >nd>x.
>
> Moreover, the other strange thing is that std::list version works, i>stead
> std::vector doe> not.
> (And if iterators are properly used, the container class is not impo>tant,
> because the iterator kind of "decouples" the code from the part>cular
> conta>ne>.)
>
> Giovanni
try to define _SECURE_SCL to be 0. notice that you must configure that
in all of your projects!
6. crashes in release mode
7. Mixed code - Crashes in Release Mode
8. [VS2008 SP1][std::vector] _CRT_DEBUGGER_HOOK crash in Release mode only
Post a reply
2 posts Page 1 of 1
Return to VC
Who is online
Users browsing this forum: No registered users and 94 guest
Board index
The team Delete all board cookies All times are UTC
Powered by phpBB c 2000, 2002, 2005, 2007 phpBB Group