473,320 Members | 1,839 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,320 software developers and data experts.

Getting mixed C++ code to work as a .NET assembly using MSDN article 814472

Thanks in advance for anyone reading this.

I have a body of MFC C++ code that I put a managed C++ wrapper around
(using VS 2003) to expose as a .NET assembly (as a set of public
classes) for a .NET web application. It mostly worked fine; however,
periodically the ASPX pages would return an error trying to instantiate
one of the classes in this assembly, which could then only be resolved
by restarting the WWW service.

Researching the situation, I am now trying to apply the instructions in
MSDN article 814472. One of the tasks in that article is to link in
msvcrt.lib into the project, but I cannot successfully do so. Prior to
this, the project had the following files in the Ignore Specific
Library section:
libc.lib;libcmt.lib;nafxcw.lib
and the following files in the Additional Dependencies section:
nafxcw.lib libcmt.lib libc.lib

I have tried every combination I can think of to add msvcrt.lib, but I
always get link errors. Either it conflicts with libc and/or libcmt
(multiply-defined symbols) or, if they are removed, some symbols are
unresolved (e.g., __argc, __argv). However, I have been able to get a
successful link without msvcrt.dll.

So, my first question is, "Do I still need to link in msvcrt.dll, and
if so, then how?"

Separately, assuming I get this to work, I'm trying to figure out how
to manually initialize the CRT from outside of the assembly. The MSDN
article showed a snippet of C++ code, but I will be working with VB in
a series of ASPX files. An object of a class from this assembly will be
instantiated and used multiple times in different web pages. Should I
preface each instantiation with a ManagedWrapper.minitialize() and
ManagedWrapper.mterminate()? Or should I just call them once?

Thanks again.

Marc

Nov 17 '05 #1
0 1100

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

Similar topics

0
by: Peter Kwan | last post by:
I have an assembly that contains both managed and unmanaged code. According to Microsoft knowledge base 814472, I have to link /NOENTRY and manually call __crt_dll_initialize(), etc. The steps...
2
by: Yang Pang | last post by:
I have a project where the GUI is in VB.NET, the libraries in unmanaged C++ which is wrapped in managed C++ and compiled as DLL. The application runs fine on Windows 2000 with VC++ development...
8
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock...
1
by: Roy Chastain | last post by:
I have read and re-read KB 814472. There appears to be a little 1984 New Speak in it. I am referring to option 3. DLL that contains consumers that use managed code and dll exports or managed...
1
by: Steve Terepin | last post by:
I've found some rather worrying articles (Mixed Mode Library Assembly bug, Richard Grimes, Windows Developer Network Sept 2003 ; and Knowledge Base Article 814472 ) that point out the need to use...
9
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...
2
by: chuck rudolph | last post by:
The project that I am on is going to require me to mix managed and unmanaged code. I created a vc++ class library (.net) project bane TestLib. I inserted the following test code in testLib.h. The...
0
by: samsonfr | last post by:
Hello, I have read KB 814472 and the article "How To: Remove Dependency on _vcclrit.h" (http://msdn2.microsoft.com/en-us/library/ms173267(en-us,vs.80).aspx) which confirmed that VS.NET 2005...
2
by: Ubergeek | last post by:
I recently came accross an article that stated that there were unresolved issued with calling native (i.e. "unmanaged" C++) from managed C++. Does anyone know what the precise details of this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.