vs obj to compile delphi api encountered with solutions

 

 #ifdef _WIN64 extern int MessageBoxA(HWND, LPCSTR, LPCSTR, UINT); .....etc

#pragma warning( disable:4273 )

 

 

A better solution is to rename MessageBoxA in the C code to something like MessageBoxADelphi and declare it extern int MessageBoxADelphi(HWND, LPCSTR, LPCSTR, UINT);
In your Delphi code simply declare it like this:
function MessageBoxADelphi(hWnd: HWND; lpText, lpCaption: PAnsiChar; uType: UINT): Integer; external user32 name 'MessageBoxA';
Now you will not have any warnings.

 

https://www.codeproject.com/Articles/264103/Using-COFF-C-object-files-with-Delphi-X2

 

 

Guess you like

Origin www.cnblogs.com/marklove/p/11888604.html