Dieter K�hler
This is how I created the .lib file from the .dll and tried to compile a test program (hw.c):
C:\temp\hw>implib dllTest.dll Reading dllTest.dll GetDelphiString Writing library DLLTEST.lib for DLLTEST.DLL 1 members, NrOfSymbols 4
C:\temp\hw>bcc32 hw.c DLLTEST.lib
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
hw.c:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: 'C:\TEMP\HW\DLLTEST.LIB' contains invalid OMF record, type 0x21 (possibly
COFF)
This is my Delphi dll project: ------------------------------
library dllTest;
uses Windows;
{$R *.res}function GetDelphiString: PChar; cdecl;
begin
MessageBox(0, 'Click OK and GetDelphiString will return a string!', 'Info',
MB_OK or MB_TASKMODAL);
result := PChar('This is a string passed from a Delphi DLL');
end;
exports
GetDelphiString;begin
This is the C file (hw.c): --------------------------
#include <stdio.h> #include "DLLTEST.h"
int main(void)
{
char* S = GetDelphiString();
puts(S);
return 0;
}This is the C header file (DLLTEST.h): -------------------------------------- char* __cdecl GetDelphiString(void);
_______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
