473,320 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to transfer an array from VB .NET in VC++ .NET?


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.
Nov 17 '05 #1
0 1323

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Carson | last post by:
Hi , Is there a very efficient way to set a double array to 0 ? (I have tried memset, but the result doesn't look correct.) Carson
2
by: Owen Woo | last post by:
My activeX control developped in VC++ has following method: void AppendData(double* databuf) How can I call this method in C# and transfer the databuf parameter to it?
11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
1
by: david | last post by:
I have a question (not sure if just a newbie one, or a stupid one) whose answer I couldn't find on the C# books and tutorials I could put my hands on. Consider the following useless class (could...
2
by: david | last post by:
Well, as a matter of fact I_HAD_MISSED a basic thing or two, anyway, although Ollie's answer makes perfectly sense when dealing with classes, it doesn't seem to me to apply as well if you have to...
15
by: Kueishiong Tu | last post by:
How do I convert a Byte array (unsigned char managed) to a char array(unmanaged) with wide character taken into account?
11
by: Dr. Zharkov | last post by:
We want to export myArrayVB (2000, 2) of VB .NET 2003 in myArrayVó of VC++ .NET 2003 on scheme "component - client". But there is an error. For development of a component in VB .NET 2003 we...
2
by: Todd | last post by:
Hello Folks I am trying to create an xml file from a class containing a polymorphic array. The example: AutoCompany contains an array of Vehicles(base class) which can either be Cars or...
4
by: Charles | last post by:
Hello Everyone, I have been gettting great feedback from microsoft.public.vc.language group but after doing more searching I think my post should be directed to this group. I am trying to make...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.