473,785 Members | 2,777 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Mixed ATL DLL Project Crash At Exit with VS.NET 2005

Hello,

I have read KB 814472 and the article "How To: Remove Dependency on
_vcclrit.h"
(http://msdn2.microsoft.com/en-us/lib...us,vs.80).aspx)
which confirmed that VS.NET 2005 don't need the "/noentry + MSVCRT.LIB
+ __DllMainCRTSta rtup@12 + __crt_dll_initi alize, and
__crt_dll_termi nate" fix anymore ...

I used the article "How to: Compile MFC and ATL Code with /clr"
(http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx)
as a guide to configure a mixed ATL DLL project.

The problem I have happens under Windows XP SP2, with a mixed ATL DLL
developped with VS.NET 2005 and VB6 SP4 as a COM client. I needed a DLL
that could be called from COM clients (VB6 and ASP) but that would also
have access to a .NET component. I decided to use a mixed ATL dll
(using the /clr switch).

The code works but it causes an Access violation when the COM client
closes.

It happens with attribute-based ATL or traditionnal ATL.

You can create a simple test case to reproduce the problem :

Mixed ATL DLL
1- Create a new ATL project in VS.NET (attribute-based or not)
2- Insert a new ATL Simple Object
3- Add a method named 'Test'
4- Use the /clr compiler switch to enable the use of .NET from that
DLL. Use the "How to: Compile MFC and ATL Code with /clr" article to
guide you
5- Compile the DLL
6- Manually register the DLL using regsvr32.exe as mixed DLL don't seem
to register automatically

COM client :
1- Create a new VB6 application
2- Reference you mixed ATL DLL
3- Write the code to create an instance and call the 'Test' method
4- Compile the application, close VB6 and run the compiled EXE.
5- An error should occur when closing it

The only way to make this crash go away is to add the /noentry +
MSVCRT.LIB + __DllMainCRTSta rtup@12 settings. But those are supposed to
be for the dealock problem under VS.NET / VS.NET 2003. It is supposed
to be irrelevant for VS.NET 2005 ... :-(

Note that my test case doesn't include a single managed line of code.
Removing the /clr switch removes the problem completely ...

Anybody can confirm they experiment the same problem using my test
case?

Somebody at Microsoft knows what I am missing ..?

Thanks!

Frederick Samson
COM / .NET Developer

Nov 17 '05 #1
0 1478

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

Similar topics

8
4616
by: Jean-Marc Blaise | last post by:
Hi, I'm on Linux Intel, V8.1 / FP4. I have an instance crash. The test case: db2set DB2_FMP_COMM_HEAPSZ = 0 db2stop db2start db2mtrk -i -d -p -v ==> Instance is crashed.
5
3886
by: NG | last post by:
Hi, We are having DB2-V7.2 DB on AIX 5.2 machine. Recently we upgraded our system to fixpack 13 and activated activate AIX asynchronous IO function. Our DB is going to crash recovery with this error 0xFFFFF707. I have attached the related details. Any suggestions is much appreciated.
9
2592
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and explain it. I have some questions about the instructions for creating a mixed mode DLL in the MSDN topic "Converting Managed Extensions for C++ Projects from Pure Intermediate Language to Mixed Mode" in the "Managed Extensions for C++ Reference"....
1
1080
by: Ramsey | last post by:
When I first started my project I was using stl for all the real processing and managed c++ for all the pretty forms. But after a while the project became too large to manage. Now I am thinking of breaking up the project into dlls/lib files but I am running into the following problems. My project can be logically broken into 4 groups of code. 2 that use stl and 2 that use managed c++.
1
2229
by: bvisscher | last post by:
I posted this recently in microsoft.public.vc.language and was redirected here. I also searched this ng and found some relavant threads. The most relavent I found was: http://groups.google.com/group/microsoft.public.dotnet.languages.vc/browse_frm/thread/dac4c07f8678cc0a/32919fdc1ee07313?q=static+initialization+mixed&rnum=2#32919fdc1ee07313
0
1469
by: Sericinus hunter | last post by:
This post is mostly for picking up by Google and information purposes. The problem itself is solved for me. Generally, debugging .Net COM dll should not pose any problems, but you will be experiencing difficulties when debugging with VS2003 while there is .Net 2.0 installed. .Net 2.0 execution engine (mscoree.dll) will not allow VS2003 debbuger through, and problems which occur in this scenario may range from IDE crash to "unable to...
7
4809
by: =?Utf-8?B?SmltIFdhbHNo?= | last post by:
I'm new to working with mixed assemblies. All of my previous experience has been with VC++/MFC in native, unmanaged applications. When I create a mixed assembly in which one or more of the files compiles with /clr the instructions say that I need to change the switch for Debug information format from Program Database for Edit & Continue to disabled. At runtime I find that I am not able to set breakpoints in the managed code, nor trace...
1
1646
by: =?Utf-8?B?SmltIFdhbHNo?= | last post by:
VS2005 - VC++/MFC: most modules compiled as native. Two modules compiled as /clr (managed). One of these two modules uses a .NET C# Windows form User control in an MFC dialog box. The program seems to run fine, but crashes when I exit. The same crash occurs even if I immediately exit when the program window opens. I have reproduced the problem on two development systems. While the final
20
6021
by: Aek | last post by:
We recently moved our large codebase over from VS7 to 8 and found that we now get access violations in atexit calls at shutdown when debugging the application in VS2005. This occurs in static members / singletons (especially meyer type singletons) which use locally declared static variables. These variables are normally cleaned up automatically at shutdown of the application by registering with the atexit. I break point the destructor on...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10327
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10151
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8973
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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 we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.