Solved

safearrays

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Looking for VB6 code to read SQL table export it to ascii 8 38
Added a column screws up code 5 57
Advice in Xamarin 21 79
Automatic Email Reminder 4 37
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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 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…

773 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