Solved

safearrays

Posted on 1998-09-18
2
256 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…

758 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

20 Experts available now in Live!

Get 1:1 Help Now