My project has both managed & unmanaged code. I wrote a class cIVR in managed code, while defining it in an unmanaged cpp file. The project has been working fine for some time. Now I need to call a member function of one of objects in array 'arrChannels' from another function in the same file.
During array definition it's not allowing me to declare as static due to managed code, so I want to pass a reference to my array in a global pointer so I can access member function throughout the file.
Kindly help, I use several code from Google but have been unsuccessful. I am using .Net 2008.
main() {
array<cIVR^>^ arrChannels = gcnew array<cIVR^>(num_devices); //MAXCHAN
for(int i=0; i< num_devices; i++){ //MAXCHAN
arrChannels[i] = gcnew cIVR();
}
////I want some thing like ->
cIVR *ch; //global
ch = arrChannels; //last in above code
func2(int index){
ch[index]->setNumber("123");
}