⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 importing-c++-classes.txt

📁 这是一段游戏修改工具的源代码.ring3功能由dephi开发,驱动是C开发.希望对大家有帮助
💻 TXT
字号:
Any shared library that wishes to export C++ classes to UC
must be relinked with the ucstub.cpp file. This redefines operator
new and delete, so that both UC and the DLL use the same allocation
strategy for objects.  In particular, an object from an imported
class with virtual methods needs extra room for both a UC virtual
method table (VMT) and a native virtual function table (vftable).

Update: vs 1.2.0

This is no longer always necessary, since UC 1.2 will choose an
alternative strategy for associating the VMT with instances of imported
classes. It will be somewhat slower, however. Also, you have to switch off
global overallocation in UCW using the -O command line switch.

In the case of Linux, shared libraries automatically use the overloaded 
new & delete operators in UC, so the issue doesn't arise.

To build a DLL using the MS command-line tools:
c:\ucw\import-examples> cl -LD import5.cpp ucstub.cpp

Where ucstub.cpp is no longer absolutely essential! If it wasn't there,
then run ucw like so:

c:\ucw\import-examples> ucw -O

Then in your UC code have:
 #lib import5.dll
 #include "import5.h"
 #lib

To use GCC, either on Linux or Win32 (the Mingw release):

~/stuff/ucw/import-examples$ g++ -shared import5.cpp -o import5

The import1 example uses a 'fake' standard string class. Unfortunately
UC can't cope with the real standard string (yet!) and so we have to
use something which is similar.


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -