C++ Builder 带VCL 的DLL
来源:互联网 发布:淘宝上的vr靠谱吗 编辑:程序博客网 时间:2024/06/16 08:56
- 建立DLL工程
- 编写DLL 文件的出口函数
- 带VCL的程序与普通程序不同之处为在调用函数进行FORM 定义,否则会出现,“Access Vio…”内存溢出报错。
操作 参考:http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Creating_DLLs_Containing_VCL_Components_(C%2B%2B)
4.编写调用程序入口函数:
#include <vcl.h>#include <windows.h>#include "TS.h"#include "data.h"#pragma hdrstop//---------------------------------------------------------------------------// 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//---------------------------------------------------------------------------extern "C" __declspec(dllexport) __stdcall int Ts(float *pTS,int a, int *pData,ShortString *MatType,int *TypeCount) ;#pragma argsusedBOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved){ return 1;} __declspec(dllexport) __stdcall int Ts(float *pTS,int a, int *pData,ShortString *MatType,int *TypeCount) //导出函数{}//以下是调用程序 #include <vcl.h>#pragma hdrstop#include "DB.h"//---------------------------------------------------------------------------#pragma package(smart_init)#pragma resource "*.dfm"extern "C" __declspec(dllimport) __stdcall int Ts(float *pTS,int a, int *pData,ShortString *MatType,int *TypeCount);
阅读全文
0 0
- C++ Builder 带VCL 的DLL
- C++builder RTL与VCl
- BORLAND C++BUILDER VCL的内存管理函数
- C++Builder、C#、VC调用 C++Builder制作的DLL
- 用C++Builder 6编写VCL控件
- DevExpress VCL for C++BUILDER XE6
- DevExpress VCL for C++BUILDER XE6
- c++builder调用vc的dll
- c++builder调用vc的dll
- C++ Builder VCL的字符串函数(2)
- c++builder调用VC的dll以及VC调用c++builder的dll
- C++Builder调用VC的dll以及VC调用C++Builder的dll
- c++builder调用VC的dll以及VC调用c++builder的dll
- 用C++Builder 建立数据库VCL使用经验
- DevExpress VCL 2014将只支持Delphi/C++Builder XE
- DevExpress VCL 2014.1.2 for C++BUILDER XE6
- 在C#中调用C++Builder编写的DLL
- C++Builder及VC的DLL相互调用
- IntelliJ IDEA使用技巧一览表
- 人机猜拳互动游戏
- Python中读取,显示,保存图片的方法
- 优质嵌入式C程序
- java线程中的interrupt,isInterrupt,interrupted方法以及如何终止线程(二)
- C++ Builder 带VCL 的DLL
- 各种气象数据下载地址推荐
- 上篇:基于球面调和基的实时全局光照明
- Cocos2d-x 3.x游戏开发之旅---(TMXMap的操作)
- 虚拟机安装linux与远程登录
- 2017年浙江中医药大学大学生程序设计竞赛-B:一生之敌(思维)
- css处理浏览器输入框记住账号密码后的背景色
- SAS中的report过程简介
- 分布式跟踪系统调研