dll中的问题 ??

hzhxxx 2002-07-29 11:42:28


1. 我写了一个dll,原来还可以,我也不知道改变了什么,现在编译时报错:

[linker error] Unresolver external '_InitVCl' referenced from D:\CBuilder5\lib\cp32mti.lib crtlvcl

是什么错误,怎么解决??,我已经在工程中加入了 cp32mti.lib


2. 在 dll 中使用 HWND的接口问题

首先是说没有HWND 这个类型,在 dll 中使用 HWND 定义窗口变量要包含那些头文件,

比如我在VB或 PB 中得到了一个 long 类型的 窗口句柄,我怎么才能在

CBC 中的 dll 中得到这个句柄,操作这个窗口

例如:
a. 在pB中,VB 中也一样 :
long l_hwnd
l_hwnd = handle(w_test)
//l_hwnd 在 PB 中唯一的标识了 w_test 这个窗口,应当是指向指针的指针


在 CBC dll 中
//目的是输出一串文本
HWND hwnd;
hwnd = (传入的窗口句柄,是 long 类型);
HDC hdc;
hdc = GetDC(hwnd);
AnsiString s_show = "test hwnd !";
TextOut(hdc,100,100,s_show,s.Length());
ReleaseDC(hwnd,hdc));

默认中:
Packages标签 :去除Builder with runtime packages检查框。
Linker标签 :去除Use dynamic RTL检查框。

去除Use dynamic RTL检查框 时报错更多



...全文
26 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
hzhxxx 2002-07-30
  • 打赏
  • 举报
回复
complie 的问题解决了,可能是 VCL 的组件问题和 BPL的问题
也可能是在主 *.bpf 中没有 USEUNIT(*.CPP)的原因!

现在是 long 的窗口句柄和 HWND 窗口句柄的问题

hzhxxx 2002-07-30
  • 打赏
  • 举报
回复
TO : jishiping(JSP 季世平) ( ) 信誉:100

我写的是 dll,默认就是去掉了这个选项!
CBC5.0 + win2000 + PB7.0 ,谢谢你的回答

我现在也只留了 标准的控件!



hzhxxx 2002-07-30
  • 打赏
  • 举报
回复
我试过了,也重启动了!,还是不对!
Bird1945 2002-07-30
  • 打赏
  • 举报
回复
头文件没有包含.

[Project]中没有设置正确可以引起这个错误,
我想,你不大可能去改Project 的.

BCB常常出一些奇怪的错误,你重起一下BCB看看.
hzhxxx 2002-07-30
  • 打赏
  • 举报
回复
谢谢,我试一试!
zhangchao_7622 2002-07-30
  • 打赏
  • 举报
回复
什么错误??
kingcaiyao 2002-07-30
  • 打赏
  • 举报
回复
#include <Windows.h>
jishiping 2002-07-30
  • 打赏
  • 举报
回复
我也遇到过,但是我也一直搞不清楚为什么。解决的方案是:选择[Project]
/ [Options],然后选择 Packages page ,将下面的“Build with runtime
packages check box”前面的钩去掉,或者将下面的编辑框里的无用的包去
除,只保留你需要的包。如BCB5里,如果你的程序只用到Windows的标准控
件,只保留Vcl50;Vclx50。
gfh21cn 2002-07-30
  • 打赏
  • 举报
回复
// Important note about DLL memory management when your DLL uses the
// static version of the RunTime Library:
//
// If your DLL exports any functions that pass String objects (or structs/
// classes containing nested Strings) as parameter or function results,
// you will need to add the library MEMMGR.LIB to both the DLL project and
// any other projects that use the DLL. You will also need to use MEMMGR.LIB
// if any other projects which use the DLL will be performing new or delete
// operations on any non-TObject-derived classes which are exported from the
// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling
// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases,
// the file BORLNDMM.DLL should be deployed along with your DLL.
//
// To avoid using BORLNDMM.DLL, pass string information using "char *" or
// ShortString parameters.
//
// If your DLL uses the dynamic version of the RTL, you do not need to
// explicitly add MEMMGR.LIB as this will be done implicitly for you
//
gfh21cn 2002-07-30
  • 打赏
  • 举报
回复
去除Use dynamic RTL检查框 好象也要加个什么东西进来的
你看看

// If your DLL uses the dynamic version of the RTL, you do not need to
// explicitly add MEMMGR.LIB as this will be done implicitly for you
hzhxxx 2002-07-29
  • 打赏
  • 举报
回复
难道没有人可以帮忙吗 ???
hzhxxx 2002-07-29
  • 打赏
  • 举报
回复
高手请救救我!!
hzhxxx 2002-07-29
  • 打赏
  • 举报
回复
help

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧