dll调用窗体简单问题! ( 积分: 20 )

  • 主题发起人 主题发起人 雨林18
  • 开始时间 开始时间

雨林18

Unregistered / Unconfirmed
GUEST, unregistred user!
我写了个调用DLL的事件如下<br>procedure&nbsp;TForm1.N1Click(Sender:&nbsp;TObject);<br>var<br>&nbsp;&nbsp;DLLHandle:&nbsp;THandle;<br>&nbsp;&nbsp;DLLSub:&nbsp;InvokeDLLForm;<br>begin<br>&nbsp;DLLHandle&nbsp;:=LoadLibrary(PChar(extractfilepath(application.ExeName)+'dll/'+'prjDLL.dll'));<br>if&nbsp;DLLHandle&nbsp;=&nbsp;0&nbsp;then&nbsp;showmessage('调入失败!');<br>&nbsp;&nbsp;if&nbsp;DLLHandle&nbsp;&lt;&gt;&nbsp;0&nbsp;then<br>&nbsp;&nbsp;begin<br>&nbsp;&nbsp;&nbsp;&nbsp;@DLLSub&nbsp;:=&nbsp;GetProcAddress(DLLHandle,&nbsp;'CreateDLLForm');<br>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;Assigned(DLLSub)&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DLLForm&nbsp;:=&nbsp;DLLSub(Application,&nbsp;Screen);<br>&nbsp;&nbsp;end;<br>&nbsp;&nbsp;end;<br><br>但是现在是在form1主窗体里可以调用多个prjDLL.dll窗口,我现在想form1主窗体里只能调用一个窗口如何判断!高手指点<br><br>还有一个问题,我在dll中定义了一个function&nbsp;saveziyu:boolean;stdcall;<br>在主窗体中如何调用,请高手指点!!!
 
调用后自己在主窗体里作一个标记就,下次调的时候看这个标记,关闭了就发一个消息给主窗体,重置标记
 
有没有更好的方法呢?能不能直接判断prjDLL.dll窗口是否已调用,如果调用就exit我觉得这样更好!
 
办法很多<br><br>既然是“只想要一个窗体实例”,就把长提写成一个单类类吧
 
没人会吗?等待中...
 
没人会吗?只是一个判断dll程序是否释放和主窗体如一个何调用dll的function的问题,高手们帮帮忙,小弟谢谢啦!!万分感激
 
http://www.delphibbs.com/delphibbs/listq.asp?sort=6&amp;type=2&amp;expert=雨林18<br><br>新&nbsp;积分&nbsp;标&nbsp;题&nbsp;提问&nbsp;回复/阅读&nbsp;得分专家&nbsp;最后时间&nbsp;<br>&nbsp;50&nbsp;谁有winmail的破解版呀,注册码也行!!&nbsp;雨林^-^&nbsp;3/57&nbsp;雨林18&nbsp;2006-06-22&nbsp;11:07:21&nbsp;<br>&nbsp;50&nbsp;关于DBGrid的问题&nbsp;雨林^-^&nbsp;10/154&nbsp;雨林18&nbsp;2006-06-22&nbsp;11:07:11&nbsp;<br>&nbsp;20&nbsp;一个sql小问题!!!&nbsp;雨林^-^&nbsp;6/110&nbsp;雨林18&nbsp;2006-06-22&nbsp;11:06:59&nbsp;<br>&nbsp;20&nbsp;一个sql问题!!!!!!急........&nbsp;雨林^-^&nbsp;11/226&nbsp;雨林18&nbsp;2006-06-26&nbsp;17:14:59&nbsp;<br>&nbsp;20&nbsp;一个sql语句&nbsp;雨林^-^&nbsp;9/135&nbsp;雨林18&nbsp;2006-06-26&nbsp;17:16:42&nbsp;<br>&nbsp;20&nbsp;一个sql问题!!!!!!急........&nbsp;雨林^-^&nbsp;6/79&nbsp;雨林18&nbsp;2006-06-26&nbsp;17:18:15&nbsp;<br>&nbsp;50&nbsp;各位大哥,有谁写过年中总结的给份例子来看看!谢谢,急....&nbsp;雨林^-^&nbsp;2/30&nbsp;雨林18&nbsp;2006-06-23&nbsp;15:12:02&nbsp;<br>&nbsp;30&nbsp;HongYuan近来要刚才的sql问题分!!&nbsp;雨林^-^&nbsp;2/33&nbsp;雨林18&nbsp;2006-06-23&nbsp;15:16:23&nbsp;<br>&nbsp;100&nbsp;有谁用asp做过短信发送的例子!&nbsp;雨林^-^&nbsp;8/144&nbsp;雨林18&nbsp;2006-06-23&nbsp;14:49:47&nbsp;<br>&nbsp;20&nbsp;一个简单问题&nbsp;雨林^-^&nbsp;11/167&nbsp;雨林18&nbsp;2006-06-23&nbsp;15:13:50&nbsp;<br>&nbsp;50&nbsp;一个关于jsp的session问题!!急!!!!!!!&nbsp;雨林^-^&nbsp;10/198&nbsp;雨林18&nbsp;2006-06-23&nbsp;15:09:30&nbsp;<br>&nbsp;100&nbsp;关于硬件的问题&nbsp;!急!我的bios被我刷坏了如何恢复!&nbsp;&nbsp;雨林^-^&nbsp;24/280&nbsp;雨林18&nbsp;2006-06-23&nbsp;15:05:27&nbsp;<br>&nbsp;100&nbsp;急,急!一个有关asp访问sqlserver的问题&nbsp;雨林^-^&nbsp;4/84&nbsp;雨林18&nbsp;2006-06-23&nbsp;15:07:43
 
楼上的那都是没回答出来的,回答出来的我都给分的,你不会自己看答案吗?<br>http://www.delphibbs.com/delphibbs/listq.asp?type=2&amp;userfrom=雨林18
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3468391<br>来自:雨林^-^,&nbsp;时间:2006-6-12&nbsp;9:14:00,&nbsp;ID:3468391&nbsp;[显示:小字体&nbsp;|&nbsp;大字体]&nbsp;&nbsp;<br>谁有winmail的破解版呀,注册码也行!!大哥给我一个吧,谢谢啦!&nbsp;<br>&nbsp;<br>来自:goddy,&nbsp;时间:2006-6-15&nbsp;14:58:57,&nbsp;ID:3472041&nbsp;<br>找一下,如果没有就没有了&nbsp;<br>&nbsp;<br>来自:雨林18,&nbsp;时间:2006-6-22&nbsp;11:05:25,&nbsp;ID:3478074&nbsp;<br>找一下,如果没有就没有了&nbsp;&nbsp;&nbsp;<br>&nbsp;<br>来自:雨林^-^,&nbsp;时间:2006-6-22&nbsp;11:07:21,&nbsp;ID:3478083&nbsp;<br>接受答案了.&nbsp;<br>&nbsp;<br>得分大富翁:雨林18
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3380113<br>问题:一个sql小问题!!!&nbsp;(&nbsp;积分:20,&nbsp;回复:6,&nbsp;阅读:110&nbsp;)<br>分类:数据库-C/S型&nbsp;(&nbsp;版主:qince,&nbsp;luyear&nbsp;)&nbsp;&nbsp;<br>来自:雨林^-^,&nbsp;时间:2006-3-13&nbsp;11:51:00,&nbsp;ID:3380113&nbsp;[显示:小字体&nbsp;|&nbsp;大字体]&nbsp;&nbsp;<br>我在sql&nbsp;server&nbsp;里定义了一个字段是image型的<br>如果我想复一个空值给他咋复?<br>例如:如果a1定义的是char型的可以这样写<br>select&nbsp;''&nbsp;as&nbsp;a1&nbsp;from&nbsp;abc&nbsp;<br>这样我就可以把空字串复给a1,但如果是image型的我想复个空值咋做请高手指点!<br><br>来自:wwr74,&nbsp;时间:2006-3-13&nbsp;16:53:41,&nbsp;ID:3380575&nbsp;<br>对于局部变量,text、ntext&nbsp;和&nbsp;image&nbsp;数据类型无效。<br>如果对表中的Image字段赋值,只要update就可以了&nbsp;<br>&nbsp;<br>来自:雨林18,&nbsp;时间:2006-6-22&nbsp;11:06:06,&nbsp;ID:3478076&nbsp;<br>对于局部变量,text、ntext&nbsp;和&nbsp;image&nbsp;数据类型无效。<br>如果对表中的Image字段赋值,只要update就可以了&nbsp;<br>&nbsp;<br>来自:雨林^-^,&nbsp;时间:2006-6-22&nbsp;11:06:59,&nbsp;ID:3478081&nbsp;<br>接受答案了.<br>&nbsp;<br>得分大富翁:雨林18&nbsp;<br><br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2652396<br>问题:一个关于jsp的session问题!!急!!!!!!!&nbsp;(&nbsp;积分:50,&nbsp;回复:10,&nbsp;阅读:198&nbsp;)<br>分类:JSP/Servlet&nbsp;(&nbsp;版主:lnboy,&nbsp;delphiasp&nbsp;)&nbsp;&nbsp;<br>来自:雨林^-^,&nbsp;时间:2004-6-8&nbsp;19:05:00,&nbsp;ID:2652396&nbsp;[显示:小字体&nbsp;|&nbsp;大字体]&nbsp;&nbsp;<br>各位大哥小弟在初学jsp时遇到一个坎过不去请各位大哥帮帮忙!<br>我有两个数组需要隔页传递!我现在只想到用session建立数组的方式实现!但我不知道代码咋写!请各位大哥帮帮忙,给我一个例子,最好是以对象的方式常&nbsp;&nbsp;如:<br>user.username[];<br>user.password[];<br><br>如果谁有其他的方式能实现数组隔页传递的话也可以,谢谢!<br>(注意数组的个数是不定的,所以在定义时不能定义数组的个数)<br>&nbsp;<br>来自:D影子D,&nbsp;时间:2004-7-19&nbsp;20:26:18,&nbsp;ID:2719884&nbsp;<br>request.getSession().setAttribute(&quot;UserID&quot;,&nbsp;userinfo[0]);<br><br>来自:雨林18,&nbsp;时间:2006-6-23&nbsp;15:08:56,&nbsp;ID:3479565&nbsp;<br>request.getSession().setAttribute(&quot;UserID&quot;,&nbsp;userinfo[0]);&nbsp;&nbsp;<br><br>来自:雨林^-^,&nbsp;时间:2006-6-23&nbsp;15:09:30,&nbsp;ID:3479566&nbsp;<br>接受答案了.<br><br>得分大富翁:雨林18
 
原理跟“程序只能运行一次”是一样的。<br>用创建互斥变量的方法比较实用。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部