473,386 Members | 1,674 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,386 software developers and data experts.

Is there a way to convert VB forms to VC?

I have a program written in Visual Studio 2003 Visual Basic. I would like
to move it to Visual C++. Is there an automated or relatively automated way
of doing that, or do I need to recreate all the windows by hand?

Thanks in advance,

Marco

-------------------------------------------------
Marc Reinig
Laboratory for Adaptive Optics
UCO/Lick Observatory
Nov 21 '05 #1
27 1725
http://www.kamalpatel.net/

Marc Reinig wrote:
I have a program written in Visual Studio 2003 Visual Basic. I would like
to move it to Visual C++. Is there an automated or relatively automated way
of doing that, or do I need to recreate all the windows by hand?

Thanks in advance,

Marco

-------------------------------------------------
Marc Reinig
Laboratory for Adaptive Optics
UCO/Lick Observatory


Nov 21 '05 #2
Thanks for the response.

This seems to convert to from VB to C#, which I have never used. What is
the relation between C# and C++?

Thanks again,

Marco

-------------------------------------------------
Marc Reinig
Laboratory for Adaptive Optics
UCO/Lick Observatory

"Supra" <su*****@rogers.com> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
http://www.kamalpatel.net/

Marc Reinig wrote:
I have a program written in Visual Studio 2003 Visual Basic. I would like
to move it to Visual C++. Is there an automated or relatively automated
way
of doing that, or do I need to recreate all the windows by hand?

Nov 21 '05 #3
c# is older version
c++ is better than c# but faster than c#.
better use vc.net

Marc Reinig wrote:
Thanks for the response.

This seems to convert to from VB to C#, which I have never used. What is
the relation between C# and C++?

Thanks again,

Marco

-------------------------------------------------
Marc Reinig
Laboratory for Adaptive Optics
UCO/Lick Observatory

"Supra" <su*****@rogers.com> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...

http://www.kamalpatel.net/

Marc Reinig wrote:
I have a program written in Visual Studio 2003 Visual Basic. I would like
to move it to Visual C++. Is there an automated or relatively automated
way
of doing that, or do I need to recreate all the windows by hand?



Nov 21 '05 #4
"Marc Reinig" <Ma***@newsgroups.nospam> schrieb:
I have a program written in Visual Studio 2003 Visual Basic. I would like
to move it to Visual C++.


/Why?/

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #5
I have code written in VB.NET and Code written in C. I need to consilidate
the projects into individual projects. I would like to have a project that
is relatively self contained rather than part written in VB and part written
in C (DLL's). Some of the C code also needs to be used in other OS's that
don't support VB.

--
Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:un**************@TK2MSFTNGP12.phx.gbl...
"Marc Reinig" <Ma***@newsgroups.nospam> schrieb:
I have a program written in Visual Studio 2003 Visual Basic. I would like
to move it to Visual C++.


/Why?/

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6
* Marc Reinig:
[top-posting]
Don't top-post.
I have code written in VB.NET and Code written in C. I need to consilidate
the projects into individual projects. I would like to have a project that
is relatively self contained rather than part written in VB and part written
in C (DLL's). Some of the C code also needs to be used in other OS's that
don't support VB.


If the code is well-structured then you can use it directly from Managed
C++.

What is the problem?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Nov 21 '05 #7
what is really the most annoying thing on usenet??? people complaining about
how someone else tries to help! top post, bottom post, interleaved post,
all are great as long as they contribute to the thread.

now of course i should write that the most really annoying thing is people
complaining about people complaining... but i'll leave that to your
imagination.

"Alf P. Steinbach" <al***@start.no> wrote in message
news:41*****************@news.individual.net...
* Marc Reinig:
[top-posting]


Don't top-post.
I have code written in VB.NET and Code written in C. I need to consilidate the projects into individual projects. I would like to have a project that is relatively self contained rather than part written in VB and part written in C (DLL's). Some of the C code also needs to be used in other OS's that don't support VB.


If the code is well-structured then you can use it directly from Managed
C++.

What is the problem?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Nov 21 '05 #8
* Anonymous Dave:
[Trolling]


Troll, go away.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Nov 21 '05 #9
Are you saying that in a single project, I can intermingle C++ and VB using
managed code? I've never dealt with that feature.

Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics
Nov 21 '05 #10
Unfortunately Marc, I cannot provide an answer to your question, but ...

"Alf P. Steinbach" <al***@start.no> wrote in message
news:41*****************@news.individual.net...
Troll, go away.


Pot ... meet kettle ...

I couldn't resist.
Nov 21 '05 #11
* Marc Reinig:
Are you saying that in a single project, I can intermingle C++ and VB using
managed code? I've never dealt with that feature.


You can use Managed C++ classes from VB.NET, and vice versa; I think
you're well aware of that and simply trolling.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Nov 21 '05 #12
* Craig:
Unfortunately Marc, I cannot provide an answer to your question, but ...
Then you should not be posting.

"Alf P. Steinbach" <al***@start.no> wrote in message
news:41*****************@news.individual.net...
Troll, go away.


Pot ... meet kettle ...

I couldn't resist.


When you can't resist the urge of namecalling it usually means you have
low self-esteem. Sometimes there are other reasons, typically also of a
personal nature. On what grounds are you calling me "pot" or "kettle"?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Nov 21 '05 #13
"Dave" <no***@nowhere.com> schrieb:
what is really the most annoying thing on usenet??? people complaining
about
how someone else tries to help! top post, bottom post, interleaved post,
all are great as long as they contribute to the thread.


For those interested in improving their posting style:

The seven don'ts of Usenet
<URL:http://www.cs.tut.fi/~jkorpela/usenet/dont.html>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #14
My last post was not top posted. Seems to me you're an obsessive compulsive
on the topic and are more interested in being the local style police and
calling people trolls than in providing help. If you don't like my posting
style, don't respond.
-------------------------------------------------
Marc Reinig
Laboratory for Adaptive Optics
UCO/Lick Observatory

"Alf P. Steinbach" <al***@start.no> wrote in message
news:41*****************@news.individual.net...
* Marc Reinig:
Are you saying that in a single project, I can intermingle C++ and VB
using
managed code? I've never dealt with that feature.


You can use Managed C++ classes from VB.NET, and vice versa; I think
you're well aware of that and simply trolling.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Nov 21 '05 #15
* Marc Reinig:
My last post was not top posted.


Grow up.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Nov 21 '05 #16
Hi Marco,

We can use the VB.NET code in VC++.NET(managed code).
In fact, after the .NET code has been compiled(whatever VB,NET C#.NET and
so on), they will be compiled into MSIL code which is kind of Assembly
language based on .NET framework, in this level whether it is written with
VB,NET C# or else is not important as long as they are managed code.

But unmanaged code(e.g. pure C++) can not access to the managed code
directly, we need expose the mananged code as a COM Server, so that the
unmanaged code can access it as COM. But we still need .NET framework
support to run the manged code as a COM server.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #17
Supra <su*****@rogers.com> wrote in news:u9KpUZYzEHA.3656
@TK2MSFTNGP09.phx.gbl:
c++ is better than c# but faster than c#.
better use vc.net


Older version? What are you talking about?

C# is a managed language like VB.NET. It has all the features of VB.NET and
a couple of extras (VB.NET will probably get those extra features next
version around).

C++ on the other hand is an unmanaged language (but there is a C++ Managed
version too) which you to write native code from VS.NET.

VB.NET, C#.NET, etc all the .NET languages compile to an intermediatary
language for the .NET runtime... so theoretically writing for C++ should be
faster and often is.

The drawback? C++ is more difficult to write for and you need to becareful
in regards to garbage collection, memory access, etc, because all of these
features are no handled by C++ and you must do it yourself.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #18
al***@start.no (Alf P. Steinbach) wrote in news:419cec10.1450428953
@news.individual.net:
Some of the C code also needs to be used in other OS's that
don't support VB.


If the code is well-structured then you can use it directly from Managed
C++.

What is the problem?


But managed C++ only runs on Windows doesn't it? What happens if he wants
to compile for Linux or Solaris?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #19
v-******@online.microsoft.com ("Peter Huang") wrote in
news:j0**************@cpmsftngxa10.phx.gbl:
But unmanaged code(e.g. pure C++) can not access to the managed code
directly, we need expose the mananged code as a COM Server, so that the
unmanaged code can access it as COM. But we still need .NET framework
support to run the manged code as a COM server.


Can't you use the DECLARE FUNCTION command in VB to tap into Windows DLLs?
While not as nice as a COM server, wouldn't this save you some time?

Nov 21 '05 #20
i threw away c++....good new for vb.net :-P

Lucas Tam wrote:
Supra <su*****@rogers.com> wrote in news:u9KpUZYzEHA.3656
@TK2MSFTNGP09.phx.gbl:
c++ is better than c# but faster than c#.
better use vc.net


Older version? What are you talking about?

C# is a managed language like VB.NET. It has all the features of VB.NET and
a couple of extras (VB.NET will probably get those extra features next
version around).

C++ on the other hand is an unmanaged language (but there is a C++ Managed
version too) which you to write native code from VS.NET.

VB.NET, C#.NET, etc all the .NET languages compile to an intermediatary
language for the .NET runtime... so theoretically writing for C++ should be
faster and often is.

The drawback? C++ is more difficult to write for and you need to becareful
in regards to garbage collection, memory access, etc, because all of these
features are no handled by C++ and you must do it yourself.


Nov 21 '05 #21
I'm still unclear. If I have C or C++ code that doesn't make any calls to
managed resources, they only provide algorithm execution and access to
capture devices through 3rd party DLL's::
1. Can I integrate these modules with VB.NET directly and compile a single
executable?
2. Do I have to do something to the code to make it integrate with VB.NET
(besides translating to VB)
3. Must I make these modules into DLL's?

Thanks in advance,

Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics

"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
al***@start.no (Alf P. Steinbach) wrote in news:419cec10.1450428953
@news.individual.net:
Some of the C code also needs to be used in other OS's that
don't support VB.


If the code is well-structured then you can use it directly from Managed
C++.

What is the problem?


But managed C++ only runs on Windows doesn't it? What happens if he wants
to compile for Linux or Solaris?

Nov 21 '05 #22
I have C and C++ modules that simply implement algorithms and talk to
external 3rd party hardware through DLL's and their drivers. What is
involved in using them with VB.NET, short of making them DLL's. How can I
make them managaged code. They are not accessing any classes, they either
take an array of data, process it and return it or are told to retrieve
images, get them, process them and return them.

Thanks in advance,

Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics

"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
Supra <su*****@rogers.com> wrote in news:u9KpUZYzEHA.3656
@TK2MSFTNGP09.phx.gbl:
c++ is better than c# but faster than c#.
better use vc.net


Older version? What are you talking about?

C# is a managed language like VB.NET. It has all the features of VB.NET
and
a couple of extras (VB.NET will probably get those extra features next
version around).

C++ on the other hand is an unmanaged language (but there is a C++ Managed
version too) which you to write native code from VS.NET.

VB.NET, C#.NET, etc all the .NET languages compile to an intermediatary
language for the .NET runtime... so theoretically writing for C++ should
be
faster and often is.

The drawback? C++ is more difficult to write for and you need to becareful
in regards to garbage collection, memory access, etc, because all of these
features are no handled by C++ and you must do it yourself.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 21 '05 #23
"Marc Reinig" <Ma***@newsgroups.nospam> wrote in
news:OH*************@TK2MSFTNGP12.phx.gbl:
I'm still unclear. If I have C or C++ code that doesn't make any
calls to managed resources, they only provide algorithm execution and
access to capture devices through 3rd party DLL's:: 1. Can I integrate these modules with VB.NET directly and compile a
single executable?
No, as far as I am aware, you cannot mix and match different languages
within the same project. HOWEVER, mixing of language is a feature of
VS.NET 2005.

What you can do is create a managed C++ project, build a DLL, and then
reference the DLL from your VB.NET project.

OR, you can stick with unmanaged C/C++ code, build a Windows API DLL,
declare the functions in VB.NET, and use the functions via the DLL.

OR lastly, you can convert your C/C++ code into a COM object and
reference it in VB.NET via interops (Interops are automatically
generated by VS.NET).
2. Do I have to do something to the code to make it integrate with
VB.NET (besides translating to VB)
Make a note that VB.NET doesn't really support pointers and direct
memory access. So if you're doing alot of unmanaged operations, the
logic may need to be rewritten.
3. Must I make these modules into DLL's?


No, you can always create a new class and compile it into your .exe (and
not expose the files as a library).
Nov 21 '05 #24
> We can use the VB.NET code in VC++.NET(managed code).
In fact, after the .NET code has been compiled(whatever VB,NET C#.NET and
so on), they will be compiled into MSIL code which is kind of Assembly
language based on .NET framework, in this level whether it is written with
VB,NET C# or else is not important as long as they are managed code.
So, lets say I have two projects, one a VB.NET project and another a
VC++.NET project. How would I combine them into a single project so I don't
have to rewrite them? i.e. if I wanted to use a set of forms or modules I
had done in VB in the C++ or vice versa.
But unmanaged code(e.g. pure C++) can not access to the managed code
directly, we need expose the mananged code as a COM Server, so that the
unmanaged code can access it as COM. But we still need .NET framework
support to run the manged code as a COM server.


If I had a set of routines written in C ort C++ (not .NET) that execute an
algorithm on an array of data and make no calls to any of the classes in
..NET (assume they take a two dimensional array of INTEGERS and perform some
mathematical process of them, can my VB.NET project incorporate these
routines? What would I have to do to them to incorporate them?

Thanks in advance,

Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics
Nov 21 '05 #25
* Marc Reinig:
I'm still unclear. If I have C or C++ code that doesn't make any calls to
managed resources, they only provide algorithm execution and access to
capture devices through 3rd party DLL's::

1. Can I integrate these modules with VB.NET directly and compile a single
executable?
No.

2. Do I have to do something to the code to make it integrate with VB.NET
(besides translating to VB)
Presumably you mean, "other than the option of translating the code to
VB".

It depends.

Assuming you want to call C++ code from VB.NET (this includes the case
of calling C code), you can:

A Package the C++ code as an ordinary unmanaged DLL, then use platform
invoke to access the DLL functions from VB.NET.

B Package the C++ code as a COM class, e.g. a DLL, and use the .NET
tool to automatically create a .NET wrapper class for a COM class,
which you can then use from VB.NET as any other .NET class (if it's
already available as a COM/ActiveX class this would be natural).

C Package the C++ code as a .NET class or classes, physically in a
DLL (which means you do all the managed <-> unmanaged glue code in
C++), which you can then use from VB.NET as any other .NET class.

Option C is possibly the cleanest approach, because at the VB level you
then only have .NET data types.

But there are many other approaches than directly calling the code from
VB. For example, you could make a C++ process that communicated with
the VB.NET GUI via mailslots or files or whatever. It's difficult to
say without knowing more about the concrete problem.

3. Must I make these modules into DLL's?


No, but you _can_ do that, and it's probably the most practical way to
go.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Nov 21 '05 #26
Hi

I am sorry what I mean is from access managed code from unmanaged code, the
COM Interop will be a better solution.
If you want to access unmanaged code(C++) from managed code(VB.NET), we can
use the P/Invoke(i.e. what you have said declare function...).
I am sorry for my confustion.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #27
Hi
So, lets say I have two projects, one a VB.NET project and another a
VC++.NET project. How would I combine them into a single project so I don'thave to rewrite them? i.e. if I wanted to use a set of forms or modules I
had done in VB in the C++ or vice versa.

I assume what what you mean here is all in the managed category. We can not
use both .vb source code file and .cpp source code file in one project,
because they will be compiled by two different compiler(vbc.exe and
cl.exe). For your scenario, we have to use two project, or you can build
the one of the project into an assembly, and add reference to that assembly
in another project.

If I had a set of routines written in C ort C++ (not .NET) that execute an
algorithm on an array of data and make no calls to any of the classes in
.NET (assume they take a two dimensional array of INTEGERS and perform somemathematical process of them, can my VB.NET project incorporate these
routines? What would I have to do to them to incorporate them?


Based on my understanding, you wants to call unmanaged code(pure C++) from
VB.NET(managed code).
For this scenario, we can expose the C++ function as DLL export function so
that we can use VB.NET to call them via P/Invoke just as we call win32 API
in VB.NET.
Also you may try to write the C++ dll as a COM server, so that in VB.NET we
can directly add reference to the COM dll and call its method.

For detailed information you may try to take a look at the link below.
Interoperating with Unmanaged Code
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconinteroperatingwithunmanagedcode.asp

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #28

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

Similar topics

11
by: Altramagnus | last post by:
I have a complicated Region object, which I need to draw the outline, but not fill How can I convert the Region object to GraphicsPath object? or How can I draw the outline of the Region object?
4
by: Guy | last post by:
I got a big Access file (1 400 tables) to convert to SQL and I would like to be provided with some automated tools, except upsizing wizard and DTS, to convert it on my own. I got a lot of forms...
4
by: Tamir Khason | last post by:
How can I convert (elegant way) Collection to Array without looping and new instances. E.G: I want to add elements of one menu to other, so secondMenu.MenuItems.AddRange(firstMenu.MenuItems);...
3
by: James | last post by:
Need help to convert a RGB (jpg) image to CMYK colors... Is it possible to convert i using GDI+? Can someone please give me som guide lines. Thanks for you help and time. Best Regards...
2
by: Ronchese | last post by:
Hi all. Is possible I coerce a value to a determined type informed by a string? See the sample: dim obj as Object obj = SomeConversionType(2, "System.Windows.Forms.DockStyle")
2
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with...
14
by: Me | last post by:
Hi all I am getting a really bizzare error on when I convert a string into a datetime: The code is : DateTime dt1 = Convert.ToDateTime("10 Sep 2005"); Console.WriteLine(dt1.Year);
2
by: Galil | last post by:
I have a subroutine I need to convert from vb.net 2005 to visual C++ ( .net 2005) The function only allows specific characters to be typed into a textbox. the backspace and 0 -9. Private Sub...
2
by: rahuldev999 | last post by:
Hi Can anyone please convert the below access query to the equivalent stored procedure.No problem with the IIF() function but the condition in the "where" clause making problem.so please put some...
6
by: Tony | last post by:
Hello! It seems to me that both Int32.Parse(..) and Convert.ToInt32(...) static methods works in exactly the same way. Both can throw an exeption. So is it any different at all between these...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.