Passing array of Strings between VB and VC 
Author Message
 Passing array of Strings between VB and VC

I want to pass an array of strings from Visual Basic to an
ActiveX object in Visual C++. The array is supposed to be
updated and then passed back to VB. I'm using SafeArray
and I've tried to manipulate the array using both
SafeArrayPutElement and SafeArrayAccessData. Everything
look fine but when the function is done I get an Access
Violation i VB (during debug). Why? The method is declared
like this:
GetFileNames(VARIANT * vFileNamesArray)

Has anyone got a clue?
--
Johan Andersson
S66/71
Skandia IT
103 50 STOCKHOLM

Tel.   08-788 49 34



Sun, 03 Dec 2000 03:00:00 GMT  
 Passing array of Strings between VB and VC

I've had no problem doing this using a SAFEARRAY of BSTR's. Why do you use a
VARIANT?

--
Jeremy - my reply address is foiled

Quote:

>I want to pass an array of strings from Visual Basic to an
>ActiveX object in Visual C++. The array is supposed to be
>updated and then passed back to VB. I'm using SafeArray
>and I've tried to manipulate the array using both
>SafeArrayPutElement and SafeArrayAccessData. Everything
>look fine but when the function is done I get an Access
>Violation i VB (during debug). Why? The method is declared
>like this:
>GetFileNames(VARIANT * vFileNamesArray)

>Has anyone got a clue?
>--
>Johan Andersson
>S66/71
>Skandia IT
>103 50 STOCKHOLM

>Tel.   08-788 49 34




Mon, 04 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing string Arrays between VB and VC

2. How to pass a string array from VB to VC

3. How To pass 2D String array to VB from VC++ Using Safe array

4. Passing array from VB to VC

5. HOWTO: Pass VB UDT that contains an array to VC dll

6. Pass array ByRef from VB to VC 6 DLL

7. Passing an VB array by reference to a VC Win32 DLL

8. Passing Arrays from VC to VB funtion

9. passing arrays from vb to vc

10. Passing Strings from VB to VC

11. Passing strings between VC and VB

12. Can I pass string between VC and VB?

 

 
Powered by phpBB® Forum Software