Home > Back-end >  C builder how to invoke VB to write a DLL?
C builder how to invoke VB to write a DLL?

Time:10-06

Is there a relevant example, thank you!

CodePudding user response:

And call other DLL call

CodePudding user response:

A lot of information,
http://wenku.baidu.com/link? Url=mU_hWa7g7ZZ8KeHmCK_cFNFoa_jKiAhG6g0_c6VkKquvwynnMFiUeo_HK2vYtBovx4I3TDejdsxGb7FW6cTlWDMVPfb_Z5OZj_oRkEfASGu

CodePudding user response:

BCB how VB write Activex DLL? Is this: I want to use VB to write the word's operation code, generate DLL, and then to call by BCB, I want to pass the "Import Component" to load, how ah?

CodePudding user response:

Visual components directly into OCX

CodePudding user response:

I am such operations:
1. In VB generated DLL

2. References in the BCB

3. Add
in BCB
in the.h# include "vbmytestdll_TLB. CPP
"In the.cpp
Void __fastcall TForm1: : Button1Click (TObject * Sender)
{
Mytestdll * a;//mytestdll is VB custom class name
This - & gt; Caption=a - & gt; Dlltest1 ();
A - & gt; Dk ();
}
Compilation, but some error button, please expert guidance, BCB was not familiar to me, thank you!

CodePudding user response:

I use the Delphi can call, the code is as follows:
Var
Aa: Comytestdll;
A: mytestdll;
The begin
A:=aa. Create;
ShowMessage (a. d. lltest1);
end;
But have problem with BCB:
Comytestdll * aa;
Mytestdll * a;
A=aa - & gt; The Create ();
ShowMessage (a - & gt; Dlltest1 ());
Compilation is no problem, but a run this application "access violation at address 769 aefb3 module in 'ole32. DLL" "error, how be to return a responsibility?

CodePudding user response:

A=new Comytestdll mytestdll *;
ShowMessage (a - & gt; Dlltest1 ());

CodePudding user response:

Demon elder brother:
I use a=new Comytestdll mytestdll *; Compilation occurs when the following error:
[BCC32 Error] Unit1. CPP (21) : E2034 always convert 'Comytestdll *' to '_mytestdll *'
Where there is a problem is?

CodePudding user response:

What do you type this Comytestdll and mytestdll are respectively?

CodePudding user response:

Demon elder brother, could you please have a look at it, this is a VB DLL created. H file
# # ifndef vbmytestdll_TLBH
# define vbmytestdll_TLBH

# pragma option push - b - a4 - w - inl

#if ! Defined (__UTILCLS_H)
#include
# endif
#if ! Defined (__UTILCLS_H_VERSION) | | (__UTILCLS_H_VERSION & lt; 0 x0700)
//
//The code generated by The TLIBIMP The utility or The Import | TypeLibrary
//and the Import | ActiveX feature of c + + Builder rely on specific versions of
//the header file UTILCLS. H found in the INCLUDE \ VCL directory. If an
//older version of the file is detected, you probably need an update/patch.
//
# error "This file requires a newer version of the header UTILCLS. H" \
"You need to apply an update/patch to your copy of c + + Builder"
# endif
#include
#include
# if defined (USING_ATLVCL) | | defined (USING_ATL)
#if ! Defined (__TLB_NO_EVENT_WRAPPERS)
#include
# endif
# endif


//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//Forward the reference of some VCL types (to get o STDVCL. HPP)
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
The namespace Stdvcl {class IStrings; The class IStringsDisp; }
Using the namespace Stdvcl;
Typedef TComInterface IStringsPtr;
Typedef TComInterface IStringsDispPtr;

The namespace Vbmytestdll_tlb
{

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//HelpString:
//Version: 1.0
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//


//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//GUIDS declared in the TypeLibrary. Following prefixes are 2:
//the Type Libraries: LIBID_xxxx
//CoClasses: CLSID_xxxx
//DISPInterfaces: DIID_xxxx
//Non - DISP interfaces: IID_xxxx
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
Extern __declspec (package) const GUID LIBID_vbmytestdll;
Extern __declspec (package) const GUID IID__mytestdll;
Extern __declspec (package) const GUID CLSID_mytestdll;

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//the Forward declaration of types defined in TypeLibrary
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
26 eb54be interface DECLSPEC_UUID (" {0 bl3-45 b6 - AF88-9 dd5545dd65f} ") _mytestdll;
Typedef TComInterface<_mytestdll, & amp; IID__mytestdll & gt; _mytestdllPtr;


//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related