Solved

C dlls & VB

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one 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…
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 …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

617 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