COM array trouble 
Author Message
 COM array trouble

VB6 SP5, Win2000
I made a DLL that resides on a remote machine. It's installed with component
services and exported and installed. All the functions seem to work on my
local machine, exept this one:

Remote function in the DLL:
Public Sub GetAppDummy(ByVal CalName As String, ByVal TheStart As String, _
    ByVal TheEnd As String, ByRef TheApp() As String)

Local function
myapp.GetAppDummy urlQueryFld, SQLStartDate, SQLEndDate, TheArr

where TheArr is an array of string. I tried it with
dim TheArr(1 to 100) as string
and
dim TheArr() as string, with Redim Preserve in the remote code
I also tried using ByVal

Nothing works.

So
1) Is it impossible to pass arrays to remote components and back?
2) If so, how do I work around this?

Thx Steven



Wed, 27 Oct 2004 04:07:07 GMT  
 COM array trouble

Quote:

> 1) Is it impossible to pass arrays to remote components and back?

In COM you have to use special memory allocation routines.
See IMalloc interface.

Also it's probably better to use a Variant containing an
array of Strings.  You don't want to let VB garbage collection
mess with stuff allocated someplace else.  That's what IMalloc
and related items are for.

--

"Only choice is an oxymoron."



Fri, 29 Oct 2004 03:48:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Trouble calling xmethods.com WebServices

2. Trouble with COM PORT

3. Trouble with COM objects and databases

4. Trouble with a COM object and a Database

5. Trouble with COM

6. trouble with Word.Application in an COM object

7. Com trouble

8. Having Trouble populating an array from table values

9. Trouble with arrays

10. BitBlt - copymemory - Image -> array troubles

11. byte arrays, winsock, and other trouble

12. Trouble to recognize caracter in text array field !!

 

 
Powered by phpBB® Forum Software