By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,967 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,967 IT Pros & Developers. It's quick & easy.

how to call vc6 dll from vc2005

P: n/a
Thanks in advance. I have a vc6 dll that is currently called by a vc6 exe
and want to call it from a vc2005 dll. The vc6 exe using the following header

[DllImport("cMath.lib")]
extern "C" __declspec(dllimport) int Estimate (int Task2Do,...);

Can someone please point me in the right direction for calling this function
from vc2005? Also, is it possible to expose the vc6 class and use that
directly?
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
....using this in the vc2005 dll
__declspec( dllimport ) int Estimate (
int Task2Do, int EstimateID, char dsn[], char UID[], char PWD[],
float pIn, float pOut, int iPrint, int DosWindow,
int m1, int d1, int y1, int m2,int d2, int y2,
char dteTS[], float AOV[],
float Actual[], float Predicted[], float Residual[]);
I get this error:
Linking...
Estimator_BLL.obj : error LNK2020: unresolved token (0A000009)
"int __cdecl Estimate(int,int,char * const,char * const,
char*const,float,float,int,int,int,int,int,int,int ,int,char *
const,float * const,
float* const,float * const,float * const)"
(?Estimate@@$$FYAHHHQAD00MMHHHHHHHH0QAM111@Z)
Estimator_BLL.obj : error LNK2001: unresolved external symbol
"int __cdecl Estimate(int,int,char * const,char * const,
char * const,float,float,int,int,int,int,int,int,int,int,
char * const,float * const,float * const,float * const,float * const)"
(?Estimate@@$$FYAHHHQAD00MMHHHHHHHH0QAM111@Z)
C:\Code\Estimator\Estimator_GUI\Debug\Estimator_BL L.dll :
fatal error LNK1120: 2 unresolved externals
I have cMath.lib and cMath.dll in c:\windows\System32
"indiana" wrote:
Thanks in advance. I have a vc6 dll that is currently called by a vc6 exe
and want to call it from a vc2005 dll. The vc6 exe using the following header

[DllImport("cMath.lib")]
extern "C" __declspec(dllimport) int Estimate (int Task2Do,...);

Can someone please point me in the right direction for calling this function
from vc2005? Also, is it possible to expose the vc6 class and use that
directly?

Nov 17 '05 #2

P: n/a
.... some additional information on the problem.
It seems that vc2005
1) will not read a simple __cdecl export and
2) is adding to the mangled name under a __stdcall export

from DumpBin on cMath.lib
?Estimate@@YGJJJQAD00MMJJJJJJJJ0QAM111@Z (long __stdcall Estimate (...
?LiZhou1@@YGHXZ (int __stdcall LiZhou1(void))

from C++2005 Error
(?Estimate@@$$J280YGHHHQAD00MMHHHHHHHH0QAM111@Z)
(?LiZhou1@@$$J10YGHXZ)

"indiana" wrote:
Thanks in advance. I have a vc6 dll that is currently called by a vc6 exe
and want to call it from a vc2005 dll. The vc6 exe using the following header

[DllImport("cMath.lib")]
extern "C" __declspec(dllimport) int Estimate (int Task2Do,...);

Can someone please point me in the right direction for calling this function
from vc2005? Also, is it possible to expose the vc6 class and use that
directly?

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.