Visual Studio Development Bookmark and Share   
 index > Visual C++ Express Edition > SAFEARRAY example
 

SAFEARRAY example

I have a C++ COM wrapper for my C# dll

I need to pass an array of doubles (double*) to my C# function (double[])

After doing some googling, I find I need to convert my double* to a SAFEARRAY

However I cannot figure out how to do it from the docs and I havent found a suitable example online.

Any help is appreciated.
clam61  Sunday, February 03, 2008 8:18 AM
A SAFEARRY can store all type of datatype so there is no need of any conversion .And from SafeArray you can check if you datatype is a type of double you can do it with the help of VT_DECIMAL and VT_R8 .Which is tore in varDataType.vt where vardataType is a Type of VARIANT and i can get value in this by calling SafeArrayGetElement

Thanx
Pintu Shukla  Tuesday, February 05, 2008 12:51 PM
bump
clam61  Tuesday, February 05, 2008 12:52 AM
A SAFEARRY can store all type of datatype so there is no need of any conversion .And from SafeArray you can check if you datatype is a type of double you can do it with the help of VT_DECIMAL and VT_R8 .Which is tore in varDataType.vt where vardataType is a Type of VARIANT and i can get value in this by calling SafeArrayGetElement

Thanx
Pintu Shukla  Tuesday, February 05, 2008 12:51 PM

You can use google to search for other answers

Custom Search

More Threads

• How to Display a menu bar on dialog bar?
• Unable to add class
• My dll is moody...
• vC++ and Masm??
• Compiler Code Genreation Options....
• noob
• Cannot register filter with win98se
• adding libc library to Visual C++
• C++/CLI 's INotifyPropertyChanged Problem.
• Class copy constructor