Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX - custom method - Can I pass a vector<double> as a parameter 1

Status
Not open for further replies.

joelwenzel

Programmer
Jun 28, 2002
448
I am creating an activeX control and I want to pass a vector containing a bunch of doubles. I know I can pass a pointer to an array of doubles but I would also like to be able to pass a vector from <vector.h>.

Is this possible? It is not in the 'Type ' drop down list.
 
Also, I want to test my control in the test container. The problem is that the method I wish to test requires that I pass an array of doubles to it. Is this possible in this test container?
 
In general, the way to pass a vector to a function expecting an array is to pass the address of the first element (assuming its not empty): &vec[0]

And vectors are in <vector>, not <vector.h> :)
 
yeah , I know. <vector> :)

Anyway, I did not know that I could pass a vector as an array. That is a very useful tip. Thank you.
 
to pase some arrays you should pass a SAFEARRAY

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top