VC头文及输出函数如下:
#ifndef _CTSDLL_H
#define _CTSDLL_H
extern "C" __declspec(dllexport) BOOL WindowShow();#endif其中输出函数extern "C" __declspec(dllexport) BOOL WindowShow();
的功能是显示一个VC的界面(窗体),该界面中用到了线程、Socket等一些知识。用VC调用没问题,可是我在DELPHI中调用就出问题。我在DELPHI中调用如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ComCtrls, StdCtrls, Buttons, DB, DBTables;type
TForm1 = class(TForm)
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
function WindowShow():boolean; Stdcall;external 'ctsdll.dll';
implementation{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);
begin
windowshow();
end;end.
我的目的是想通过DELPHI程序调用CTSDLL.DLL来显示VC做好的界面。可是却出错,错误信息如下:
弹出个对话框,内容是:Debug Assertion Failed!
program:"c:\project1.exe"
file:afxwin1.inl
line:22 for information on how you program can cause an
assertion failure, see the visual c++ documentation on asserts. (press retry to debug the application)
下面是三个"终止"、“重试”、“忽略”。按键后进入了读地址错误。我在DELEPHI里跟踪不到VC程序中去,该怎么办??请指教!
#ifndef _CTSDLL_H
#define _CTSDLL_H
extern "C" __declspec(dllexport) BOOL WindowShow();#endif其中输出函数extern "C" __declspec(dllexport) BOOL WindowShow();
的功能是显示一个VC的界面(窗体),该界面中用到了线程、Socket等一些知识。用VC调用没问题,可是我在DELPHI中调用就出问题。我在DELPHI中调用如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ComCtrls, StdCtrls, Buttons, DB, DBTables;type
TForm1 = class(TForm)
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
function WindowShow():boolean; Stdcall;external 'ctsdll.dll';
implementation{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);
begin
windowshow();
end;end.
我的目的是想通过DELPHI程序调用CTSDLL.DLL来显示VC做好的界面。可是却出错,错误信息如下:
弹出个对话框,内容是:Debug Assertion Failed!
program:"c:\project1.exe"
file:afxwin1.inl
line:22 for information on how you program can cause an
assertion failure, see the visual c++ documentation on asserts. (press retry to debug the application)
下面是三个"终止"、“重试”、“忽略”。按键后进入了读地址错误。我在DELEPHI里跟踪不到VC程序中去,该怎么办??请指教!
解决方案 »
- 在delphi中怎么按照一定的时间间隔动态的画出数据变化曲线?
- 求助,有关主窗体和子窗体的问题
- 怎样才能点击关闭按钮(就那个叉叉)后让它产生Application.Terminate的效果?
- 一个复杂的问题
- 求DevExpress for D5 整套控件下载,100分相送!!!!
- 如何读取outlook express里的邮件帐号?就好像icq的邮件设置那样,可以有一个列表显示全部帐号
- 我有个DBEDIT,想显示日期,但不想自己手工输入,想点击框右边的一钮马上显示象个月历表样的日期,很方便的选择,不知各位大侠,能否教小
- delphi源代码编辑器右键问题
- 运行客户端产生Dax error!!ErrorMessage:Name not unique in this context.????????????
- 我虽没分但我讲义,绝不食言?请帮我最后一次
- 100分请大家来讨论如何在字符串中替换指定的字符。。。在线。。。
- 有人做过PDF417码,交流一下经验?
var LibHandle: THandle;
WindowShow: TWindowShow;
begin
LibHandle := SafeLoadLibrary('ctsdll.dll');
if LibHandle > 0 then
try
@WindowShow := GetProcAddress(HInst, 'WindowShow');
if Assigned(@WindowShow) then
WindowShow();
finally
FreeLibrary('ctsdll.dll');
end;
end;
,@WindowShow := GetProcAddress(LibHandle, 'WindowShow');
FreeLibrary(LibHandle);
?把stdcall换成cedcl safecall等看看
最好
把你的Delphi程序给写DLL的人调一下那个DLL看看
我检查了afxwin1.inl这个文件也没有看出所以然来,反正根这个文件和声明有关!
Sorry,没能解决问题,看有没有高手来指导了!