DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: cdk19821
今日帖子: 35
在线用户: 11
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 yvxiang (yvxiang) ★☆☆☆☆ -
盒子活跃会员
2011/3/1 9:24:43
标题:
delphi2010开发的程序无法在客户的win2000或者xp下运行 浏览:2055
加入我的收藏
楼主: 已经是第二个程序了,第一次是在客户那里(有两台机器),装xp的能运行,装win2000的不能运行,结果就只在装xp的机器上运行。第二次是昨天,装xp的机器不能运行我修改后的程序,修改前的程序运行的尚好,不管怎么就是弹不出登陆窗口。
   有点郁闷了,不知道是不是.net 2.0的问题,由于delphi2010越来越重视.net,我猜可能是不是.net环境的问题。有谁能指点一下?
   偏偏这些程序在我的本机跑起来一点问题都没有
   实在不行,我考虑找台机器装delphi7,重新编译
----------------------------------------------
-
作者:
男 tintin1943 (零输好) ★☆☆☆☆ -
盒子活跃会员
2011/3/1 9:37:55
1楼: 唉,,,,怎么说你才好呢?
delphi 的IDE只是依赖于.Net,,,但编译出来还是win32原生程序!

除非你有特殊的环境(如带包编译)和功能,否则在XP、win7、win2K下都是没有问题,再说,你也不给一个错误的信息,,,,叫上帝帮你揣摩吗?
----------------------------------------------
不喧哗 自有声 心静 思远 志行千里
作者:
男 briankuo (briankuo) ★☆☆☆☆ -
盒子活跃会员
2011/3/1 9:54:33
2楼: Delphi 2010 是有一个 bug,编译的程序不能在 Win2k SP4 以前的版本之中运行的,因为 VCL 里面用了一个 Win2k SP4 后才有的 Win32 API 参数
----------------------------------------------
-
作者:
男 wr960204 (武稀松) ★☆☆☆☆ -
盒子活跃会员
2011/3/1 10:20:46
3楼: Delphi的IDE是要.NET的.而开发出的程序不需要.NET.
应该是你缺少某些组件的BPL(那些组件只提供了或你只选择了运行时包)或者缺少某些依赖的DLL.
----------------------------------------------
武稀松http://www.raysoftware.cn
作者:
男 yayongm (昵  称) ★☆☆☆☆ -
盒子活跃会员
2011/3/1 11:27:38
4楼: unit D2009Win2kFix;

{
  Inno Setup
  Copyright (C) 1997-2010 Jordan Russell
  Portions by Martijn Laan
  For conditions of distribution and use, see LICENSE.TXT.

  When Windows 2000 with SP<4 is detected, this unit reverts the change in
  Delphi 2009 Update 3 that causes VCL apps (even new, empty projects) to
  crash on startup when run on Windows 2000 with no SP/SP1/SP2/sometimes SP3.

  This should be at the top of the .dpr's "uses" clause to ensure it runs
  before any VCL code.

  $jrsoftware: issrc/Projects/D2009Win2kFix.pas,v 1.1 2010/03/03 18:50:21 jr Exp $
}

interface

implementation

{$IFDEF VER200}
  {$DEFINE Delphi2009Or2010}
{$ENDIF}
{$IFDEF VER210}
  {$DEFINE Delphi2009Or2010}
{$ENDIF}

{$IFDEF Delphi2009Or2010}   { Only Delphi 2009/2010 }
uses
  Windows, SysUtils;

{
  Details:
  In Delphi 2009 Update 3 (or possibly one of the previous updates),
  TUTF8Encoding.Create in SysUtils was changed to set the
  MB_ERR_INVALID_CHARS flag:

         original: inherited Create(CP_UTF8);
    with Update 3: inherited Create(CP_UTF8, MB_ERR_INVALID_CHARS, 0);

  It appears that when used with CP_UTF8, the MB_ERR_INVALID_CHARS flag is
  only supported beginning with Windows 2000 SP4 and Windows XP. On Windows
  2000 with no SP, MultiByteToWideChar() fails with ERROR_INVALID_FLAGS.

  In Delphi 2010 Update 1 this change is still present.

  This code changes TEncoding.UTF8's private FMBToWCharFlags field from
  MB_ERR_INVALID_CHARS back to 0 when Windows 2000 (5.0) with SP<4 is
  detected.

  Note: This won't fix any other instances of TUTF8Encoding, but there
  shouldn't be more than just the one. (Inside the Delphi RTL/VCL,
  TEncoding.GetUTF8 is the only place where TUTF8Encoding.Create is called.)
}

function NeedWin2kFix: Boolean;
var
  Info: TOSVersionInfoEx;
begin
  Result := False;
  Info.dwOSVersionInfoSize := SizeOf(Info);
  if GetVersionEx(Info) then
    if (Info.dwMajorVersion = 5) and (Info.dwMinorVersion = 0) and
       (Info.wServicePackMajor < 4) then
      Result := True;
end;

procedure ApplyWin2kFix;
type
  PLongWordArray = ^TLongWordArray;
  TLongWordArray = array[0..6] of LongWord;  { 28 bytes }
var
  U: SysUtils.TEncoding;
begin
  U := SysUtils.TEncoding.UTF8;
  if (U.ClassType = SysUtils.TUTF8Encoding) and
     (U.InstanceSize = 28) and
     (U is SysUtils.TMBCSEncoding) and
     (SysUtils.TMBCSEncoding.InstanceSize = 28) then begin
     if (PLongWordArray(U)[3] = 65001) and  { verify that FCodePage = CP_UTF8 }
        (PLongWordArray(U)[4] = 8) and      { verify that FMBToWCharFlags = MB_ERR_INVALID_CHARS }
        (PLongWordArray(U)[5] = 0) then     { verify that FWCharToMBFlags = 0 }
       PLongWordArray(U)[4] := 0;          { change FMBToWCharFlags to 0 }
  end;
end;

initialization
  if NeedWin2kFix then
    ApplyWin2kFix;
{$ENDIF}
end.
----------------------------------------------
弱小和无知不是生存的障碍,傲慢才是!
作者:
男 yvxiang (yvxiang) ★☆☆☆☆ -
盒子活跃会员
2011/3/1 15:08:53
5楼: 谢谢各位,让我明白了很多,其实这两次还是有共同点的,都是使用了XLSWRITER II软件,最近一次是新增了excel文件导入功能,然后其他语句(不用控件的)加了几十条。我再检查一下,看看是否是导入控件发布造成的(发布时没考虑该控件),我装的是源码版XLSWRITER II4.0
----------------------------------------------
-
作者:
男 yvxiang (yvxiang) ★☆☆☆☆ -
盒子活跃会员
2011/3/1 16:42:11
6楼: 找到原因了,可能让大家吐血。第二个事情,由于那台机器很慢,今天总算弹出数据库连接错,昨天在登录窗口就死掉,没有反应,也没有提示,我一检查,我拿了稍早一点的版本修改,把ip地址设置错了。犯了一个不应该的低级错误
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行70.3125毫秒 RSS