Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 534
  • Last Modified:

write C header files for Delphi DLLs

Hi,

I need a doku how the C header file for my delphi dll should look like , any tutorial / example ?
0
BdLm
Asked:
BdLm
  • 3
  • 2
1 Solution
 
MerijnBSr. Software EngineerCommented:
See for a tutorial here: http://www.esanu.name/delphi/DLL/Calling%20delphi%20DLL%20from%20MS%20Visual%20C.html

It's somewhat old but still a good help.

Rule #1: Don't use strings in your dll's calls.
0
 
BdLmAuthor Commented:
HI used strings delphi -> delphi .dll with sharemem, works fine.  :-))

 What has the C programmer to do ? MYFunction (a Str : String) : String    ->  MyFunction (a Pchar) : PChar  in C++ ??
0
 
MerijnBSr. Software EngineerCommented:
If you can use a Delphi DLL in which you use Delphi strings from C at all, it will be very difficult.

Hence: look at rule #1 I posted above! :)
0
 
BdLmAuthor Commented:
is it for the C programmer more easy If i use in the function declaration only PChar ?
0
 
MerijnBSr. Software EngineerCommented:
yes definitly, that's the way it should be done (that's why all windows api calls work with pchars)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now