Solved

C dlls & VB

Posted on 1998-12-12
1
172 Views
Last Modified: 2010-05-03
A C dll has to be called from a VB application. The dll expects a certain structure which has an array of doubles as one of it's members. We create an instance of the structure in VB.
Eg: Let someStruct be the structure
redim someStructure.arrDoubles( 10 )
//then we fill up this structure
someStructure.arrDoubles( 0 ) = 123.123
someStructure.arrDoubles( 1 ) = 0.99
.
.
someStructure.arrDoubles( 9 ) = 1111

When we pass this structure to the dll, the dll is unable to read the elements of this double array.

Is there a special way of passing structures with arrays as members to C dlls. We are using VB6.



0
Comment
Question by:shayad
1 Comment
 
LVL 44

Accepted Solution

by:
bruintje earned 200 total points
Comment Utility
Hi Shayad,

Well found a good article at the Microsoft site

http://premium.microsoft.com/msdn/library/officedev/excel/d12/safa4.htm

It's about passing any type of data form VB to an DLL, they explain there exactly how to pass any kind of array form VB to an DLL.

Hope this helps
br(UINT)je
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now