Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

how to call vc6 dll from vc2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
indiana - 19 Mar 2005 19:03 GMT
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?
indiana - 19 Mar 2005 19:57 GMT
...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_BLL.dll :
   fatal error LNK1120: 2 unresolved externals
I have cMath.lib and cMath.dll in c:\windows\System32

> 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
[quoted text clipped - 5 lines]
> from vc2005?  Also, is it possible to expose the vc6 class and use that
> directly?
indiana - 20 Mar 2005 03:11 GMT
... 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)

> 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
[quoted text clipped - 5 lines]
> from vc2005?  Also, is it possible to expose the vc6 class and use that
> directly?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.