DLL,Borland&很多挫折 [英] DLL's, Borland & alot of Frustrations

查看:53
本文介绍了DLL,Borland&很多挫折的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




如果这不是正确的论坛,我很抱歉,但是因为我用C ++编程,这看起来就像是最好的地方。


我正在尝试为公司制作一个不错的DLL文件,我们在其中放置所有功能,类和定义,以便在我们的各种软件项目中共享。

这些事情都是用C ++编写的。


目前我还没有对文件做过任何特别的事情,包括那些用于出口的魔术__字等。


我们使用CodeGears Borland C ++构建器作为主要开发IDE。

我们的第一个测试是将我们的GDI +包装器放入DLL并从我们的一个项目中调用它。


但我们在链接DLL时遇到了一些问题。

任何人都可以向我提供一些解释,说明为了使DLL内的C ++类可以导出而需要做什么使用Borland CodeGears将DLL链接到我们的项目?



这个IDE让我疯了.....在VS中只需点击几下就可以排序....

Hi,

I''m sorry if this is not the correct forum, but since I''m programming in C++ this looked like the best place.

I''m trying to make a nice DLL file for the company where we place all functions, classes and definitions in it to share amongst our various software projects.
These things are written in C++.

At the moment I havent done anything special yet to the files suchas including those magic __ words for the export etc.

We are using CodeGears Borland C++ builder as main development IDE.
Our first test was to put our GDI+ wrapper in the DLL and call it from one of our projects.

But we have some issues getting the DLL linked.
Can anyone provide me with a explanation as to what needs to be done in order to make the C++ classes inside the DLL exportable and to link the DLL to our projects using Borland CodeGears?



this IDE is driving me nuts.....in VS its just a few clicks to get it sorted....

推荐答案

你使用的是Windows,是吗? br />

首先确定你将使用显式或隐式链接的位置。


显式链接意味着你将调用LoadLibrary来获取DLL然后在DLL中调用函数地址的GetProcAddress,然后你将在该地址调用函数。


隐式链接意味着你将像调用任何其他函数一样调用DLL函数。在这里,您使用DLL构建创建的.h文件。您在该.h中调用的函数执行LoadLibrary,GetProcAddress以及对该地址处的函数的调用。这种隐式链接需要.h文件函数原型中的_dllimport。如果不存在,那么你必须使用显式链接。


也许你可以进一步解释你的链接问题。
You are using Windows, yes?

First decide on where you are going to use explicit or implicit linking.

Explicit linking means you will call LoadLibrary to loas the DLL and then call GetProcAddress for the address of your function in the DLL and then you will call the function at that address.

Implicit linking means you will call the DLL function as you would any other function. Here you use the .h file created by the DLL build. The function you call in that .h does the LoadLibrary, the GetProcAddress and the call to the function at that address. This implicit linking requires a _dllimport in the .h file function prototype. If this is not there, then you have to use explicit linking.

Maybe you could explain further about your linking issue.


是的,

我们正在为Windows Server 2003开发。


基本思想是拥有一个DLL,其中所有类,结构和函数都是我们开发的各种小应用程序之间通常共享。

我最近开发的一个例子是GDI +包装器。


目前我创建了这个包装的头和类文件,并将它们放在DLL项目中。目前还没有别的东西。


现在的想法是,当我创建一个新的应用程序时,我可以简单地键入例如:

Yes,
We''re developing for Windows Server 2003 at the moment.

The basic idea is to have one DLL where all the classes, structs and functions are that are commonly shared between the various small applications that we develop.
An example I recently developed would be a GDI+ wrapper.

At the moment I have created the header and class file for this wrapped and placed them inside the DLL project. Nothing else in it at the moment.

The idea now is that when I create a new application, I can simply type for example:

展开 | 选择 | Wrap | 行号


首先,DLL中的所有代码都可以在C ++ 中除 之外的函数从您的程序调用。


DLL是一个旧的C whiz-bang,你在程序中使用DLL函数的名称:

First, all the code in the DLL can be in C++ except the functions you call from your program.

A DLL is an old C whiz-bang where you use the name of the DLL funcrtion in your program:

展开 | 选择 | Wrap | 行号


这篇关于DLL,Borland&很多挫折的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆