Solved

C dlls & VB

Posted on 1998-12-12
1
173 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA saving file message display 5 56
VBA error replacing data 6 37
Excel - Save a copy of work book 13 83
Prevent user closing word document opened with VB6 6 67
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

867 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

23 Experts available now in Live!

Get 1:1 Help Now