Link to home
Start Free TrialLog in
Avatar of chj
chj

asked on

C Code in Delphi ?

Is it possible to include c code within a delphi program. If so please supply an example of a Delphi Program calling a C routine.

thanks

Chris
Avatar of slp
slp

When you say "include c code" do you mean having actual C code embedded in your Delphi/Object Pascal code?  Like:
 
begin
  // start coding in C
  int y ;
  int x = 10 ;
  for y = 2 ; y <= x ; y++ {
  dosomestuff( y ) ; }

  // now back to Pascal
  for a := 1 to 10 do
  begin
    dosomestuff( a ) ;
  end ;
  ...
end ;  

or are you asking if you can call functions written in C that are compiled into other "libraries" (e.g. DLLs, Object Files, etc.)?

A bit more info please.

SLP
 
ASKER CERTIFIED SOLUTION
Avatar of mheacock
mheacock

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chj

ASKER

Comment to slp

I should have guessed as much, but when I look through Delphi's help files, there are references to routines startings of with a void statement. This to me implies c. This may be part of the InstallShield help though, and there I belive you can imped c code.

WhatI realy need to do is to have e-mail functionality from my program. I have access to the c code for mail programs and I believe that you can run external exacutable from C but not Delphi.

How would you go about givving sendmail capability to a program you were developing?

Thanks

Chris