Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2001, 06:54 AM
wyghf wyghf is offline
Junior Member
 
Join Date: Jan 2001
Posts: 2
Default How to call a func in a DLL written by Delphi in VC6.0?

I write a DLL using Delphi5.0.I can call it in Delphi or BCB.
Unfortunately,Ican not call it in VC6.0.
Reply With Quote
  #2  
Old 01-10-2001, 12:14 PM
williamda williamda is offline
Junior Member
 
Join Date: Jan 2001
Posts: 7
Default RE: How to call a func in a DLL written by Delphi in VC6.0?

Delphi has several different calling conventions for functions, some of then are not compatible with VC++.

By default, Delphi uses a calling convention named "register" which is not compatible with VC++. You must manually specify the "stdcall" or "cdecl" calling conventions on exported functions in your DLL. For example:

function SomeFunction : Integer; stdcall;

Also note that the String type of Delphi is not supported by VC++, so you have to use PChar instead.

Review the online help for additional info on calling conventions and String types.
Reply With Quote
  #3  
Old 01-11-2001, 05:36 AM
wyghf wyghf is offline
Junior Member
 
Join Date: Jan 2001
Posts: 2
Default RE: RE: How to call a func in a DLL written by Delphi in VC6.0?

Mr williamda:
Thank you.I am sorry I can not accept your answer.I specify the "stdcall" for my function and I don't use 'string' type.
I can call my function in VC6.0 using dynamic loading(
LoadLibrary,GetProcAddress...).But I cannoot call these
function using Static loading in VC6.0(I can call these functions in Borland c++ builder 5.0 in both ways successfuly) .
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 08:00 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.