Solved

C dlls & VB

Posted on 1998-12-12
1
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 44

Accepted Solution

by:
bruintje earned 200 total points
ID: 1449658
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

732 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