I have a library written in C ++ and using Visual Studio 2010 Has been compiled as DLL. DLL has multiple export functions Export operations are accessible from Excel using
declared function
. I am trying to implement a new feature in the program which requires the nested structures in the ++ portion which is then accessed from VBA. The C ++ code looks like this.
First Structure
Structure parameter {double value; Four * label; Four * description; Four * units; };
Second Structure
This structure is used as the following structure:
Struct output {parameter field_1; Parameter field_2; Parameter field 4; };
There are a few ways that I am thinking of reaching the structure from VBA. One of these is with the zero
function, such as.
zero function 1 (output * output_function 1);
The second is an action that gives the output
structure, such as
Output function 2 ();
Internal on the two tasks given above does not matter at this point. I have verified that both implementations work as intended in C ++ code.
Issue
I am unable to use either of these two structures using VBA either Function1
or Function2
.
I declared two custom types in VBA.
Type parameter as parameter field 3 as parameter field 2 String termination type type output field 1 string values as string units double as the label value Function1
for the parameter end type
I have declared the exported function as follows.
Sub Function 1 Lib "C: Path \ to \ library.dll" (Output as Bayreaf Output Start)
and
Function2 < For / code>, the following.
declare output
function 2
gives crash excel andFunction1
as sub Function2 Lib "C: \ Path \ to \ library.dll" error mevba byref logic type mismatch
.What am I doing wrong here? What is the right approach?