473,472 Members | 1,715 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 3278

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
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,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.