For Programmers: Free Programming Magazines  


Home > Archive > VC STL > February 2005 > C++ newbie question about vectors and matrices









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author C++ newbie question about vectors and matrices
NewbieOneKanewbi

2005-02-14, 9:11 pm

I have a c dll that contains mathematical functions. It was written for Excel
originally and uses the XLOPER data structure for passing arrays.

I'm interested in creating a c++ wrapper dll for the functions that allows
the array
inputs to be passed using vector<double> &myArrayInput form. Or some other
form that is more c++ friendly.

ex
vector<double> MyCls::func1( vector<double>&myArr1, vector<double>&myArr2)
{
myArr1[0] = myArr[2] + 1;
return( myArr2 );
}

Some of the functions return arrays as well. I'm wondering if its possible
to build
a wrapper library that passes and returns arrays using the std::vector class
from
the STL. How are they exported and is it difficult to do?

Does anyone know of some good examples that might help with this?

I'm a novice at c++ programming. Any suggestions on a better implementation?

Whats the best way to pass array data to c++ methods?

NewbieOneKanewbi

Gene Bushuyev

2005-02-14, 9:11 pm

You may think twice before proceeding. DLLs are not STL friendly. You must
compile DLLs and other libraries exactly the same way, with exactly the same
STL version, with exactly the same defines, compiler switches, etc., or your
objects will be incompatible, resulting in mysterious crashes.

"NewbieOneKanewbi" wrote:

> I have a c dll that contains mathematical functions. It was written for Excel
> originally and uses the XLOPER data structure for passing arrays.
>
> I'm interested in creating a c++ wrapper dll for the functions that allows
> the array
> inputs to be passed using vector<double> &myArrayInput form. Or some other
> form that is more c++ friendly.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com