[问题] BCB 6 动态连结dll问题

楼主: huang1000   2015-04-14 23:55:12
开发平台(Platform): bcb 6.0 in Windows XP
额外使用到的函数库(Library Used): No
问题(Question):我使用bcb开发一个dll library和一个tool去使用自已写的dll档,
但是发现我在call dll的function的时候(代入很多指标的参数),发现在执行完
function后,有些指标的address会变动到,但function内其实根本没动到,不懂为何会被
更改到。
喂入的资料(Input):
uStatus = SetCardMode(&uhndlDrive,upDriveSettingTable,upParamTable,upStatus);
其中SetCardMode是dll function,其他参数如upDriveSettingTable,upParamTable,upStatus
都是unsigned char *型别。
预期的正确结果(Expected Output):
call此function后其实是想修改upParamTable这个array的值,但现在只是空function,即
没做任何事情就跳出去,但一出function后我的upParamTable的address就被改掉了。
错误结果(Wrong Output):
在call此function前的upParamTable Address为42118232,一做完些function就变成1900。
程式码(Code):(请善用置底文网页, 记得排版)
upParamTable = new BYTE[cParamTableSecCnt*cSingleSectorByte];
uStatus = SetCardMode(&uhndlDrive,upDriveSettingTable,upParamTable,upStatus);
大概就这样,SetCardMode是dll function
补充说明(Supplement):
dll function是使用动态连结的方式。不知道跟这个有没有关系。
麻烦各位如果有想法可以告知一下吗?
谢谢各位大大^^
作者: TobyH4cker (Toby (我要当好人))   2015-04-15 02:37:00
资讯不够,无法判断前后程式码、DLL function原型宣告、引用方式、哪一行之后出问题都提供才知道
作者: Push5F (帐号已卖)   2015-04-15 06:34:00
prgma 1@.@?

Links booklink

Contact Us: admin [ a t ] ucptt.com