Pipi.兄请近! By 沈前卫(100分)

  • 主题发起人 主题发起人 沈前卫
  • 开始时间 开始时间

沈前卫

Unregistered / Unconfirmed
GUEST, unregistred user!
Pipi.你好<br>&nbsp; 我现在有个程序,随机性出现GAPI32.DLL访问地址出错,你有没有遇到过此<br>问题。大概是什么地方出错!
 
我没遇到过。<br><br>GAPI32.dll 和邮件有关的吗?不知道是你写的程序还是别人的程序?<br><br>我的outlook倒是经常出错,不过没注意。<br>
 
你写我的名,其他知道的可能都不进来看怎么办
 
我的程序哪,主要是用了许多的二次循环,等待外部环境的同步。是不是与此有关。<br>我查了以下,RichEdit使用了此GAPI32.DLL,蛋我将所有与RichEdit有关的语句都<br>用try..except &nbsp;showmessage end还是得部到出错得地方
 
我到忘记了,没关系,我再在外面提个问题!
 
奇怪啊,和richedit有关系吗?<br>gapi32的说明是:<br>Microsoft Mail Configuration Library
 
我大概看了Delphi得源码,好象GAPi32是动态装载得。(再看看,看有没有看错)
 
你有没有试过<br>出错的时候在该程序按 F12 &nbsp;就会进入delphi或者bcb的cpu调试窗口<br>或者在delphi按暂停进入汇编的调试?
 
看错了! {B-)<br><br>不过我得程序更本都没有与Mail有关啦,是不是我得程序内存消耗大,NT给我发Mail<br>通知我呢. &nbsp;{B-)<br><br>出错是随机性! 我曾是过在IDE中运行,只让IDE在地址访问出错时才中段我得程序,<br>可是让我等到得时候,一按确定键,连IDE都退出了!
 
不是你的问题,richedit确实用了gapi32<br>不过是在 riched32.dll 装入的用quickview看看他引用了gapi32的<br>一些输入、字处理、语言方面的函数,可能你想办法换换这2个dll吧
 
我想还是跟我得程序有关了,我贴部分代码吧!
 
//需要提醒得是我得程序调用此过程非常频繁 &nbsp;5times/second<br>procedure TPrintOutForm.AddPrintOutText(sText:string);<br>var<br>&nbsp; i:integer;<br>&nbsp; TempStrings:TStringList;<br>begin<br>&nbsp; try<br>&nbsp; &nbsp; PrintOutRichEdit.SelStart:=Length(PrintOutRichEdit.Text)-1;<br>&nbsp; &nbsp; PrintOutRichEdit.SelLength:=1;<br>&nbsp; &nbsp; PrintOutRichEdit.SelText:=sText+' ';<br><br>&nbsp; &nbsp; if (PrintOutRichEdit.Lines.Count&gt;fMaxLine) then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; TempStrings:=TStringList.Create;<br>&nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; TempStrings.Clear;<br>&nbsp; &nbsp; &nbsp; &nbsp; TempStrings.AddStrings(PrintOutRichEdit.Lines);<br>&nbsp; &nbsp; &nbsp; &nbsp; for i:=0 to (fMaxLine div 2) do<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TempStrings.Delete(0);<br>&nbsp; &nbsp; &nbsp; &nbsp; PrintOutRichEdit.Clear;<br>&nbsp; &nbsp; &nbsp; &nbsp; PrintOutRichEdit.Lines.AddStrings(TempStrings);<br>&nbsp; &nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; PrintOutRichEdit.Clear;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; TempStrings.Free;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; SendMessage(PrintOutRichEdit.Handle,EM_ScrollCaret,0,0);<br>&nbsp; except<br>&nbsp; &nbsp; on Exception do ShowMessage('PrintOut Error');<br>&nbsp; end;<br>end;<br>
 
还有个地方使用了richedit<br><br>var<br>&nbsp; i:integer;<br>&nbsp; TempStrings:TStringList;<br>begin<br>&nbsp; try<br>&nbsp; &nbsp; StateRichEdit.SelAttributes.Color:=clMsgColor;<br>&nbsp; &nbsp; StateRichEdit.Lines.Add(sMsg);<br>&nbsp; &nbsp; if (StateRichEdit.Lines.Count&gt;MAIN_MAX_SHOW_LINES) then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; TempStrings:=TStringList.Create;<br>&nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; TempStrings.Clear;<br>&nbsp; &nbsp; &nbsp; &nbsp; TempStrings.AddStrings(StateRichEdit.Lines);<br>&nbsp; &nbsp; &nbsp; &nbsp; for i:=0 to (MAIN_MAX_SHOW_LINES div 2) do<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TempStrings.Delete(0);<br>&nbsp; &nbsp; &nbsp; &nbsp; StateRichEdit.Clear;<br>&nbsp; &nbsp; &nbsp; &nbsp; StateRichEdit.Lines.AddStrings(TempStrings);<br>&nbsp; &nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; StateRichEdit.Clear;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; TempStrings.Free;<br>&nbsp; &nbsp; end;<br><br>&nbsp; &nbsp; SendMessage(StateRichEdit.Handle,EM_ScrollCaret,0,0);<br>&nbsp; except<br>&nbsp; &nbsp; on Exception do ShowMessage('Error ShowTracingMessage');<br>&nbsp; end;<br>end;<br>
 
多线程、单线程?
 
单线程,用Timer
 
Pipi.不会打扰你休息吧
 
你的这2个函数可能没问题吧,<br>while true do<br> begin<br> ppp('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');<br> Application.ProcessMessages();<br> end;<br><br>这样都没问题<br><br>另外我设置最大行数10000,你不会更大吧?<br>我这里是nt4 sp5 装了ie4 <br>riched32 版本 4.00.835.1381 (1996-11-27)<br>gapi32.dll 版本 4.0 (1996-11-27)
 
我倒是曾经试过richedit输出一段时间中文变乱码(整个过程仅改变颜色,<br>未改变font),后来发现原来是95才会这样,98/nt都正常,所以和dll可能会有关系<br>换其他机、其他操作系统看看?<br><br>我,我要走了。bye
 
Pipi.<br>&nbsp; 谢谢。<br>&nbsp; 气愤得时程序每次我在计算机旁时,怎么弄都不出现那个异常。<br><br>还有个现象,就是当我人工按出错得消息框后,一般程序又可以正常运行。只有一两<br>次只有CTrl+Alt+Del.最近得一次出现,调用此AddPrintOutText得在出现异常后<br>还是将结果显示了地,(Timer),但另一个函数就没有显示,这说明了什么问题呢?<br>&nbsp;
 
我看你又没有用不同的颜色、不同字体,还不如先用 TMemo 交差好了
 
后退
顶部