How to declare a function in Delphi that can be alled from 
a VC++ DLL:

1) Define a type:

type IntProcVarType = procedure(x: Integer; y:Integer); stdcall;

2) Declare a var of that type in the record/struct to pass to C:

   IntCallbackVar: IntProcVarType;

3) Make the callback function:

   decl:   procedure procname (x: Integer; y: Integer); stdcall; export;

   define:
   
   procedure procname(x:integer; y:integer);stdcall;export;
   begin
      showmessage('got ' + IntToStr(x) + ', ' + IntToStr(y));
   end;

4) Assign proc's addr to the record/struct to pass to C:

   IntCallbackVar:=procname;



How to declare a function pointer in VC++ to hold the addr of a 
Delphi function:

1) Define a type DLLCALLBK - takes 2 int's and returns void

typedef __declspec(dllimport) void (CALLBACK *DLLCALLBK) (int, int);

2) Declare a var of new type:

DLLCALLBK callback;

3) Assign the Delphi addr to it:

   callback=StructFromDelphi->fname;

4) To call Delphi's function:

   callback(1234, 5678);
