码迷,mamicode.com
首页 > Windows程序 > 详细

vs编译obj给delphi用 遇到api解决方法

时间:2019-11-19 14:11:43      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:bsp   ola   span   family   off   遇到   warning   back   sage   

 

 #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

 

 

vs编译obj给delphi用 遇到api解决方法

标签:bsp   ola   span   family   off   遇到   warning   back   sage   

原文地址:https://www.cnblogs.com/marklove/p/11888604.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!