由于纪录的数据在物理上是连续的,因此, 可以把Info强制转化为字符串数组来进行传递也就是,发送端,将info内容送入一个字符串数组内, 接受方再将接受到的数据写到info内,如var MyInfo:Info; pc:Pchar; pc:=pchar(Info); for i:=0 to SizeOf(MyInfo)-1 do pc[i]:=CharArray[i];charArray是接受过来的数组以上随手写的,原理就是这样的
终于成功的跟踪了一个com程序,具体过程为:先在d5下创建com 程序及其测试程序,无法跟踪,在d5下选中 project\options\include TD32 infomation and include remote debuf symbolrebuild 可以跟踪再去掉以上选项,仍然可以跟踪然后在d6下重新编译,仍然可以跟踪但翻过来,在d6创建的com程序,d6下无法跟踪,在d5下重新编译,d5可以跟踪, d6仍然不行,真是活见鬼
w2k重装,delphi5重装,delphi5又不能跟踪了, 没办法,只能怪自己命不好
贴上来一点DELPHI6调试COM+的DEBUG设置,收藏用。 //======================================How to debug a COM+ component in Delphi. - by Borland Developer Support StaffAbstract: Debugging a COM+ component on Windows 2000. Assuming you have already created a COM+ component in Delphi, these are steps for debugging: 1. In Delphi, go into the menu option Project | Options | Linker and setting the Include remote debug symbols option. 2. Go into the menu option Run | Parameters. On the Local tab, under Host Application enter C:\WINNT\system32\dllhost.exe Under Parameters enter /ProcessID:{GUID} where GUID is the Application ID for your application. This GUID can be obtained by going into Control Panel | Administrative Tools | Component Services Locate the COM+ application under Component Services | Computer and open its properties. On the first page below, the description box, is the Application ID. After you have entered these parameters you can run the app (F9) to begin debugging. --------------------------------------------------------------------------------Add or View comments on this articleProducts: Borland Delphi 6.x
com对象功能已经实现,可以被应用程序成功的调用,
就是不能跟踪,如果是因为设置问题,我也很迷惑,我没有发现和其他工程的不同,
或许是我看得还不够仔细,我在试试看有没有镇江地区的程序员,南京也行,我可以专程到把程序带过去,
一块探讨
我感觉我心力交瘁,
望着程序,
才知陌生
已经检查过,只用一个dll,我已经build N 边了
project options 已经快能背下来了,
还是看不出w2k比我还稳定,我都快崩溃了
哈欠一下子也没有有用的建议,呵,只是叫您崩溃.
我把硬盘格式化,重装w2k,delphi6,
所有的com军无法跟踪,我写了一个最简单的com,
从创建到编译成功,不做任何设置上的改变,
依然无法跟踪,
用bcb5试了一下,bcb5下的com可以跟踪,
我猜想delphi5下也能跟踪,如果是这样,
宝兰公司 #¥%$##$^&*#$!%)WE()QE)_E&*&QW^%TEwq
那就太可恶了,
5555555555555555555555555555,
我的程序已经使用delphi6谢了很多,
难道让我退到d5?
谢谢跟贴,我也怀疑是设置问题,所以,
我把d6卸了,重装,完全按照默认,重建com,
仍然无法跟踪,于是又打补丁pack2,仍然无效,
今天上午又到公司,在其他机器上试,均无效在没有重装w2k前,机器中先装的d5,后来装d6,
com可跟踪,直到遇到一个com应用程序无法跟踪,
实在没办法,w2k重状,没装d5,结果发现,所有
的com程序均无法跟踪,公司的机器上也都没有d5,
也都无法跟踪,难道和d5有关系?我觉得不可能,我猜测,可能和注册表有关系,也许是
d6疏忽了,某个注册项值不正确,d5下是正确的,因此,
有d5的可以跟踪,反之无法跟踪也不知道对不对,我先装d5试试
因此,通过这种技术,各种语言可以无缝连接
我以为你已逃离,原来还在,能不能帮我试试,
看看在你的机器上能跟踪吧,com应用程序如果不能跟踪,还不如杀了我
delphi5下也不能跟踪了,
这是从来都没有过的事情,
我哭!!!!!!!!
不过,这基本上能证明不是delphi6的问题,应该是配置问题,
可是该怎么配置呢?
我已在迷雾中,
com应用程序已经写了一年多了,从来没有跟踪失败过,
我已经三天没做事了,都是com惹的祸
另外,我这机子上是安装得有BCB5的,不太清楚调试COM的机制,也许跟这下面文件有关吧。
我DELPHI BIN目录下:
BORdbg60.exe
BORdbg61.exe
BCB5 BIN目录下的是
bordbg51.exe.....想一会儿再说。。
可能我脑袋已经转不过弯来了,我机器上现在有bcb5 delphi5 delphi6,
我要下网,出去走一会,让我冷静一下,希望你帮我好好想一下,你在
project\options下都做过什么设置,我已经乱的一团麻了,昨天晚上
2点多才睡觉,装了两遍delphi6,一个小时后我再来
你说的这种情况仍然是可以跟踪的,我在贴子
http://www.csdn.net/expert/topic/666/666261.xml?temp=.3560144
中已有回答,偏偏我自己的就不能跟踪了
一个小时后我再来
删掉临时文件,重新BUILD一下试试..呵呵...只有乱指点了.
我现在做两个程序,让两个程序A,B之间可以通信,
比如:
type Info=Record
PMessage:Integer;
Buffer:Array[0..100]Of char;
End;
我想把程序A的结构体Info里的数据发送到B,B收到后根据内容来做事情。
我用DLL只能传输字符串,但不知传输结构体的技巧?
不知有谁知道,?
我需要源程序,要不你把步骤写清楚
可以把Info强制转化为字符串数组来进行传递也就是,发送端,将info内容送入一个字符串数组内,
接受方再将接受到的数据写到info内,如var
MyInfo:Info;
pc:Pchar;
pc:=pchar(Info);
for i:=0 to SizeOf(MyInfo)-1 do
pc[i]:=CharArray[i];charArray是接受过来的数组以上随手写的,原理就是这样的
project\options\include TD32 infomation and include remote debuf symbolrebuild 可以跟踪再去掉以上选项,仍然可以跟踪然后在d6下重新编译,仍然可以跟踪但翻过来,在d6创建的com程序,d6下无法跟踪,在d5下重新编译,d5可以跟踪,
d6仍然不行,真是活见鬼
没办法,只能怪自己命不好
//======================================How to debug a COM+ component in Delphi. - by Borland Developer Support StaffAbstract: Debugging a COM+ component on Windows 2000.
Assuming you have already created a COM+ component in Delphi, these are steps for debugging: 1. In Delphi, go into the menu option Project | Options | Linker and setting the Include remote debug symbols option. 2. Go into the menu option Run | Parameters.
On the Local tab, under Host Application enter C:\WINNT\system32\dllhost.exe
Under Parameters enter /ProcessID:{GUID}
where GUID is the Application ID for your application. This GUID can be obtained by going into Control Panel | Administrative Tools | Component Services
Locate the COM+ application under Component Services | Computer and open its properties.
On the first page below, the description box, is the Application ID. After you have entered these parameters you can run the app (F9) to begin debugging. --------------------------------------------------------------------------------Add or View comments on this articleProducts:
Borland Delphi 6.x
delphi下也跟过,这次的不能跟踪,我几乎可以保证不是自己设置
上的原因,不过现在又能跟踪了,我不知道为什么不能跟踪,也不知道为什么又能跟踪,莫名其妙