difficulty coming up with the right format.
-
hi, i have a managed c++ project using /clr using old syntax. one of the functions in the program has the following argument list: (System::Object __gcc * _gcc yValue[]) i'm trying to pass four doubles in an array, but am having difficulty with the notation. any help? thank you
-
hi, i have a managed c++ project using /clr using old syntax. one of the functions in the program has the following argument list: (System::Object __gcc * _gcc yValue[]) i'm trying to pass four doubles in an array, but am having difficulty with the notation. any help? thank you
Member 3153721 wrote:
i'm trying to pass four doubles in an array
What type of array? An array of System::Object references?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Member 3153721 wrote:
i'm trying to pass four doubles in an array
What type of array? An array of System::Object references?
Mark Salsbery Microsoft MVP - Visual C++ :java:
it can be any one of these types: String DateTime Double Decimal Single Int32 UInt32 Int64 UInt64 it's for a winforms control. here is the link to the full method description: http://support.dundas.com/OnlineDocumentation/WinChart2005/topic1363.html[^] from the documentation, i 'should' be able to just list values in the argument, so AddY(1,2,3,4). however, managed c++ does not convert the values to an array. creating the array first and then passing the variable in the argument will not compile... it apparently does not reconginze the array value. i've come up with a work around using another set of functions in the library, but it's very difficult to get managed code to play nice with windows forms libraries to say the least.
-
hi, i have a managed c++ project using /clr using old syntax. one of the functions in the program has the following argument list: (System::Object __gcc * _gcc yValue[]) i'm trying to pass four doubles in an array, but am having difficulty with the notation. any help? thank you
function declaration should look rather like the following: int AddY(System::Object __gc * yValue __gc []); or int AddY(System::Object* yValue[]);
params
keyword isn't supported in C++, so this function should be called with argument of type array of Object*.int AddY(Object* yValue[])
{
return yValue->Length;
}Object* arr[] = new Object*[2];
ar[0] = __box(1.1);
ar[1] = __box(2.1);
AddY(arr);