Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

c file to delphi dll conversion... help!

cristinecristine Member Posts: 13
Hi, how can i convert a C program to a Delphi dll? I need to use the C program as library for my delphi program. How can i link the C program to my delphi program?

thanks!

Comments

  • zibadianzibadian Member Posts: 6,349
    : Hi, how can i convert a C program to a Delphi dll? I need to use the C program as library for my delphi program. How can i link the C program to my delphi program?
    :
    : thanks!
    :
    I don't know how to code the C procedures so that they may be exported. That you should ask at one of the C boards or look up in the documentation. You can link a procedure in Delphi using the external word. Here is a simple example:
    [code]
    function ExternalUppercase(s: PChar): PChar; StdCall;
    external 'mydll.dll';
    [/code]
    Note you need to match the calling type (StdCall, cdecl, etc.) and the number and position of the parameters exactly for this to work.
    After you declared which routines you want to import, you can use them as regular Delphi procedures and functions.
Sign In or Register to comment.