[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | Microsoft Visual Basic |
|
Moderator: | TAMARA::DFEDOR::fedor |
|
Created: | Thu May 02 1991 |
Last Modified: | Thu Jun 05 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 2565 |
Total number of notes: | 10453 |
2547.0. "How to Pass Integer arrays and arrays of strings from Vb to DLL" by ZPOVC::VBALA () Fri May 02 1997 02:19
Hi,
I am facing problems in passing arrays of integers and
strings from VB to DLL. Any information regarding this will
be appreciated.
In VB
------
Dim a(20) as long
Dim str(20) as string *80
status = foo(a(0),str(0))
Declaration in VB
-----------------
Declare function foo lib "mydll" (byref a() as long,
byref str() as string) as long
IN DLL
------
int FAR PASCAL foo(int *a[], char *str[][80])
{
*a[0]=20;
*a[1]=30;
strcpy(str[0],"FIRST");
strcpy(str[1],"SECOND");
return 0;
}
I tried to run the above program in VB and it was not successful.
Thanks in Advance,
Bala
T.R | Title | User | Personal Name | Date | Lines |
---|
2547.1 | | EVTSG8::TOWERS | | Fri May 02 1997 11:59 | 8 |
| Bala, both the problems in writing DLLs in other languages to supply
routines to be called from VB and the particular problems concerned
when you try and pass strings to routines in such DLLs have been
covered extensively in this conference. All you need to do is search
for them.
Cheers,
Brian
|