Solved

safearrays

Posted on 1998-09-18
2
257 Views
Last Modified: 2012-05-04
hi,
I developed a component in ATL which has a method which accepts no in-parameters but gives an out-parameter as an array.I have used a safearray as an out parameter,but in my client(in vb) i give a variant array to be filled up,this gives an error.I'll give the code also

dim obj as mylib.mycomponent
dim arr()as variant
set obj = createobject("progid")
call obj.mymethod(arr())
        Error occurs in the above statment
how will i solve this problem????
0
Comment
Question by:rvsamuel
2 Comments
 
LVL 13

Accepted Solution

by:
Mirkwood earned 20 total points
ID: 1435489
A variant can be a safearray. So most likely you change the code to the following.

dim obj as mylib.mycomponent
dim arr as variant
set obj = createobject("progid")
call obj.mymethod(arr)

0
 

Author Comment

by:rvsamuel
ID: 1435490
i tried ur code,the problem i face is,the array's second element returns the ubound of the array and the remaining elements return no value,so i cannot solve this problem.
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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

896 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

12 Experts available now in Live!

Get 1:1 Help Now