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