473,239 Members | 1,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,239 software developers and data experts.

AfxGetThread and AfxGetApp return NULL on a derived CWinApp inside a DLL


I have a huge VC6 MFC project that was converted to Visual Studio 2005
beta2. After the conversion, the application crashes because
AfxGetThread() returns NULL and thus fail on pThread->InitInstance()
inside AfxWinMain().

I have a CWinApp derived class (e.g. CBaseWinApp) exported from a DLL.
This derived class is inherited inside the main app (e.g.
CDerivedWinApp : public CBaseApp) and serves as the global app.
instance (e.g. CDerivedWinApp theApp; ).

I can't reproduce the crash in a synthetic test environment.

Does anybody have an idea what's going on? It works perfectly OK in
Am I missing some preliminary call to some magic macro such as
AFX_MANAGE_STATE (which doesn't contribute in my case)??

Jul 31 '05 #1
0 3235

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: zhiqiang | last post by:
I use AfxGetApp() in my Add-in application as follows. AfxGetApp()->LoadIcon(IDI_ICON); AfxGetApp()->BeginWaitCursor(); AfxGetApp()->EndWaitCursor(); AfxGetApp()->PumpMessage() It works well...
by: David Sobey | last post by:
Hi everyone I'm having huge difficulties overriding a virtual function with a function that returns a covariant type. I'd be grateful if someone could show me some code where this is done: - A...
by: Dan Trowbridge | last post by:
Hi All, I'm in the middle of porting code to VS.NET from VS6.0. My code compiles fine under DEBUG mode but under RELEASE mode I get a compile-time error: C:\Program Files\Microsoft Visual...
by: Atul | last post by:
I have a .Net Managed C++ wrapper control for a MFC control. When using the ..Net control in a Visual Studio 2005 Beta 2 C# project and running in Debug mode, I get a crash saying something like...
by: bagnjm | last post by:
Hi, I have a huge VC6 MFC project that was converted to Visual Studio 2005 beta2. After the conversion, the application crashes because AfxGetThread() returns NULL and thus fail on...
by: bonk | last post by:
I have created an MFC project that links MFC MFC as shared dll and uses /MD . This MFC application loads another dll B via Loadlibrary that has /MD too and also links MFC as shared dll. Dll B again...
by: kikazaru | last post by:
Is it possible to return covariant types for virtual methods inherited from a base class using virtual inheritance? I've constructed an example below, which has the following structure: Shape...
by: RiaanDP | last post by:
Hi, I'm currently working on integrating our company's management system into .NET. The system was originally created in Visual C++ 6.0, but new requirements point to that we may need to make use...
by: Alexander Widera | last post by:
hi, is it possible to return an object of an unknown (but not really unknown) type with an method? i have the following situation: - a variable (A) of the type "object" which contains the...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.