DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: szliyu112358
今日帖子: 49
在线用户: 11
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 jackalan (nVicen) ★☆☆☆☆ -
盒子活跃会员
2022/5/9 16:13:33
标题:
Delphi 11编译的程序提示不是有效的WIN32程序,求解。 浏览:1049
加入我的收藏
楼主: Delphi 11编译的程序提示不是有效的WIN32程序,求解。
手里没有XP,客户说程序运行在XP提示不是有效的WIN32程序。
谢谢!!!
----------------------------------------------
简单做人,认真做事。
作者:
男 hq200306 (200306) ★☆☆☆☆ -
普通会员
2022/5/9 16:20:22
1楼: 工程加

{$SETPEOSVERSION 5.0} 
{$SETPESUBSYSVERSION 5.0}
----------------------------------------------
-
作者:
男 keymark (嬲) ▲▲▲△△ -
普通会员
2022/5/9 19:26:06
2楼: 好像还有这个问题
https://github.com/ccy/WS2_32_XP
----------------------------------------------
[alias]  co = clone --recurse-submodules  up = submodule update --init --recursiveupd = pullinfo = statusrest = reset --hard懒鬼提速https://www.cctry.com/>http://qalculate.github.io/downloads.htmlhttps://www.cctry.com/
作者:
男 jljaaj (小强) ▲▲▲△△ -
普通会员
2022/5/9 19:38:52
3楼: Windows Socket 2.0 32-Bit DLL Fix for RAD Studio 10.2.2 and above
Introduction
When launch an application built with runtime packages compiled by RAD Studio 10.2 update 2 in Windows XP, an error prompt

The procedure entry point inet_pton could not be located in the dynamic link library ws2_32.dll.
The application works fine from Windows Vista onwards.

As stated in InetPton function:

The InetPton function is supported on Windows Vista and later.
RAD Studio 10.2 update 2 has a new update in unit :Windows.WinSock2.pas

function inet_pton; external ws2_32 name 'inet_pton';
The function is bind statically when application was launch. There is no way to patch the source code easily. A quick workaround solution is built the application as single executable file instead of runtime packages.

Solution: Deploy a proxy DLL to original WS2_32.dll
This project attempt to define proxy functions to all exported functions of original Windows XP's including that was missing in Windows XP's . It tricks the Windows XP application process to think that is available and not prompting any errors.WS2_32.dllinet_ptonWS2_32.dllinet_pton

Please note that the DLL shall deploy to Windows XP only.
此帖子包含附件:jljaaj_202259193852.zip 大小:18.1K
----------------------------------------------
-
作者:
男 jackalan (nVicen) ★☆☆☆☆ -
盒子活跃会员
2022/5/10 9:54:42
4楼: 查了一些资料,据说要改两个地方,楼上说的WS2的问题非常感谢。
我马上编译一个版本测试一下,稍后回复结果到2CCC,感谢各位!

Can no longer build executables for Windows XP without customization:
Project Options->Building->Delphi Compiler->Linking->Set OS Version fields in PE Headers (and Set SubSystem Version fields in PE Headers" to 5.1 (it now defaults to 6.0)

If you use System.Threading, then need to change GetTickCount64 references to a new routine matching something like the code below and then use a modified system.thread.dcu in your projects (or update \lib\win32\debug and \lib\win32\release with new versions of System.Threading.dcu)
More info from Michal Mutl on Delphi PRAXIS forum message

function _GetTickCount64: UInt64;
begin
if TOSVersion.Major<6 then
  Result := TThread.GetTickCount
else
  Result := TThread.GetTickCount64;
end;
----------------------------------------------
简单做人,认真做事。
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行117.1875毫秒 RSS