Click to See Complete Forum and Search --> : Passing Arrays


msnhari
July 12th, 2000, 11:18 PM
HI Guys!
How to pass an array of strings to a dll ? I have created a dll with declaration as:
Public Function Authorize(Uid as Variant, xyz() as variant).

I can even change the declaration of the function,if necessary, so, any other syntax for declaring the array is welcome.
From my main program how to pass an array say a() to this dll ?

Hand in Hand we Walk towards SUCCESS.

Lothar Haensler
July 13th, 2000, 03:02 AM
is that DLL you want to call a C(++) DLL or an ActiveX DLL?

One way to pass an array:

Dim var() as Variant
var = Array(1, 2, 3)
Call Authorize(null, var)



(tested in VB 6 nt4)

msnhari
July 13th, 2000, 03:26 AM
Thanks Lothar!
Its working. Actually it was an ActiveX Dll. Hey! Lothar, is there any difference between an Windows Dll and an ActiveX Dll ? IS so what are the differences ?


Hand in Hand we Walk towards SUCCESS.

Lothar Haensler
July 13th, 2000, 03:30 AM
>is there any difference between an Windows Dll and an ActiveX Dll ?

certainly. I'm not the expert to tell you all the technical details of those two beast, but:
- an ActiveX dll has a COM interface
you instantiate it via CreateObject or early binding (dim .. as new ...)

you call functions via objectInstanceName.Methodname

- a "normal" DLL is invoke via implicit or explicit linking (LoadLibrary(Ex))
you "call" the functions and "declare" it before you can use them.

There are a couple of other differences (e.g. ActiveXDLL can be easily made "remotable")

msnhari
July 13th, 2000, 04:30 AM
Hi Lothar!
Hey! man thanks for ur few tips, I would build up the rest on it.
Anyway, Lothar, where do u work(Geographical Location) and on what do u work ? I am an Analyst working for Silverline Tech. Inc, Chennai, India.
Bye and Thanks once again.

Hand in Hand we Walk towards SUCCESS.

Lothar Haensler
July 13th, 2000, 04:34 AM
>where do u work(Geographical Location)
Germany
>what do u work
I'm a QA guy.