Delphi DLL TDateTime call from C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ManUtdFans
    New Member
    • Jul 2010
    • 2

    Delphi DLL TDateTime call from C#

    I got a Delphi DLL function using D2007 has parameter type of Double (used for as TDateTime).

    I tried to call from C#:
    eg.
    DateTime week;
    week = DateTime.Now;

    myDLLFunc(week. Date);

    I got a runtime error:
    Cannot marshal 'parameter #1': Invalid managed/unmanaged type combination(the DateTime class must be paired with Struct).

    What should I pass the date parameter?
Working...