Solved

safearrays

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

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

710 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