We have program Visual Basic .NET 2003 for construction of 3D-Graphics as a
surface z=f (x, y). From VB .NET 2003 we want to transfer coordinates of
this surface as myArrayVB (2000, 1) in myArrayVó [2000, 1] of VC++ .NET
2003 on scheme of "component - client". But there are error 1 and error 2.
For development of a component in VB .NET 2003 we make: File, New, Project,
Visual Basic Projects, Class Library, name of project: ComponentVB. We write
the code:
Imports System.Drawing 'Error 1. Namespace Drawing is absent.
Public Function myFunction1() As Array
Dim myArrayVB As Array = _
Array.CreateInstance(GetType(Single), 2000, 2)
'We write in myArrayVB coordinates of a surface:
. . .
Return myArrayVB
End Function
To apply procedures ScaleTransform and TranslateTransform, we need namespace
Drawing, however this namespace Drawing is absent in this project Class
Library.
For development of the client in VC++ .NET 2003 we make: File, New,
Project, Visual C++ Projects, (.NET), Windows Forms Application (.NET), name
of project: ClientVC. On Form1 we place control PictureBox (on which we want
to build a surface by means of method DrawLine) and we write the code:
#using <mscorlib.dll>
#using "Debug\ComponentVB.dll"
private:
System::Void pictureBox1_Paint(System::Object * sender,
System::Windows::Forms::PaintEventArgs * e)
{
ComponentVB::Class1* myObject = new ComponentVB::Class1();
float myArrayVC __gc[,] = new float __gc[2000, 1];
for (int i = 0; i <= 2000; i++)
for (int j = 0; j <= 1; j++)
myArrayVC->SetValue(myObject->myFunction1(), i, j); //Error 2.
}
The second error consists, that we cannot transfer coordinates of a surface
from myArrayVB in myArrayVC.
Inform, please, how in project VB to import the namespace Drawing, and how
to transfer myArrayVB in myArrayVC?
Beforehand many thanks for the answer, Dr. Zharkov V.A., Moscow, Russia.