473,471 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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 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
VC6.
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 3277

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

Similar topics

0
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...
12
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...
5
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...
0
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...
0
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...
3
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...
3
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...
1
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...
9
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.