freelanceprogrammers.org Forum Index » C

Hi guys ... Reg passing array frpom VB


View user's profile Post To page top
surender_527 Posted: Tue Jan 04, 2005 11:00 am


Joined: 04 Jan 2005

Posts: 1
Hi guys ... Reg passing array frpom VB
Hi guys.

This is Surender . I have a question .

1. How to pass an Array from VB to VC++ DLL

Can any 1 help me . I`ll be gr8full .
Pls. Mention some code
Waiting for reply as soon as possible....


Thank q
-Surender.
--
Surender Ameelpur
surcom527@...
Reply with quote
Send private message
View user's profile Post To page top
mayank_khare@... Posted: Tue Jan 04, 2005 3:34 pm


Joined: 04 Jan 2005

Posts: 2
Hi guys ... Reg passing array frpom VB
Hi Surender
I believe the problem is in the way that VB stores the arrays. It keeps a
header around to help it do its access. when you pass an array to a DLL, you
do it by not using the ByVal, and passing the first element. What gets sent
is the address, which you then use as a pointer to the rest of the array.

further u can get a code from the following URL...

http://www.codeproject.com/dll/ctovbarray_passing.asp


Bye
Thanks & Regards
Mayank Khare



>From: "Surender Ameelpur" <surcom527@...>
>Reply-To: Programmers-Town@yahoogroups.com
>To: Programmers-Town@yahoogroups.com
>Subject: (PT) Hi guys ... Reg passing array frpom VB
>Date: Mon, 03 Jan 2005 21:00:22 -0800
>
>
>
>
>Hi guys.
>
> This is Surender . I have a question .
>
>1. How to pass an Array from VB to VC++ DLL
>
>Can any 1 help me . I`ll be gr8full .
>Pls. Mention some code
>Waiting for reply as soon as possible....
>
>
>Thank q
>-Surender.
>--
> Surender Ameelpur
> surcom527@...
>
>
>
>

_________________________________________________________________
The real power of teamwork. Experience it in real time.
http://www.microsoft.com/india/office/experience/ Experience MS Office
System.
Reply with quote
Send private message
View user's profile Post To page top
kith_kahnan Posted: Thu Jan 06, 2005 12:04 am


Joined: 04 Jan 2005

Posts: 13
Hi guys ... Reg passing array frpom VB
>
>
> Hi Surender
> I believe the problem is in the way that VB stores the arrays. It keeps
a
> header around to help it do its access. when you pass an array to a DLL,
you
> do it by not using the ByVal, and passing the first element. What gets
sent
> is the address, which you then use as a pointer to the rest of the array.
>
> further u can get a code from the following URL...
>
> http://www.codeproject.com/dll/ctovbarray_passing.asp
>
>
> Bye
> Thanks & Regards
> Mayank Khare
>
>
>
> >From: "Surender Ameelpur" <surcom527@...>
> >Reply-To: Programmers-Town@yahoogroups.com
> >To: Programmers-Town@yahoogroups.com
> >Subject: (PT) Hi guys ... Reg passing array frpom VB
> >Date: Mon, 03 Jan 2005 21:00:22 -0800
> >
> >
> >
> >
> >Hi guys.
> >
> > This is Surender . I have a question .
> >
> >1. How to pass an Array from VB to VC++ DLL
> >
> >Can any 1 help me . I`ll be gr8full .
> >Pls. Mention some code
> >Waiting for reply as soon as possible....
> >
> >
> >Thank q
> >-Surender.
> >--
> > Surender Ameelpur
> > surcom527@...
> >

I think you`ll need to use COM in C++ with horrible IDispatch
implementation. In particular, with the SAFEARRAY structure (look at
msdn.microsoft.com for more on this).

Regards,
Fernando.
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help