2 Replies - 7924 Views - Last Post: 11 March 2010 - 03:11 PM Rate Topic: -----

#1 Guest_Lori*


Reputation:

How do I call a vb.net form from VB6?

Posted 11 March 2010 - 10:55 AM

I am working on a legacy VB6 application that will eventually be ported to VB.net. In the meantime, all new development will be done in .net and "hooked" into the existing VB6 app. For example, the user will click on a button and instead of a VB6 form loading, I want a .net form to load. Problem is, I don't have a clue how to do this...

Any advice or "how to" links would be greatly appreciated!

Thanks!

-Lori

Is This A Good Question/Topic? 0

Replies To: How do I call a vb.net form from VB6?

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: How do I call a vb.net form from VB6?

Posted 11 March 2010 - 11:45 AM

hardly you can. vb6 will not be supported in next version of windows so to think that some one will make a program that transfer from vb.net to vb6 is unthinkable. not to mention that you will need .net frame work for the code you have made on vb.net so what is the point of using vb6 then?
EDIT: not to mention that vb.net is pure object oriented language and vb6 is not and some functions will never work on it. i suggest you just write it on vb.net. if it is only for the visual effects there is many free out there that looks like .net and you can even write one your self

This post has been edited by NoBrain: 11 March 2010 - 11:51 AM

Was This Post Helpful? 0
  • +
  • -

#3 Guest_Lori*


Reputation:

Re: How do I call a vb.net form from VB6?

Posted 11 March 2010 - 03:11 PM

NoBrain,

Frankly I find your reply rather condescending and feel like you didn't even read my question. I am dealing with a LEGACY application that is written in VB6, wanting to write the NEW functionality in .net. LEGACY means it's an existing system. I am trying to go FROM VB6 TO VB.net, not the other way around.

Luckily I got my answer in another forum. I will post it here for anyone else that is interested.

Have a nice day.

-Lori


Repsonse:
Lori,

YES you CAN call VB.Net code from VB6!

I applaud you for trying to migrate your application to VB.Net, so I want to
provide whatever support I can. Most of that support will be to point you to
the documentation that Microsoft has made available for this issue.

There is a Knowledge Base article entitled "How to call a Visual Basic .NET
or Visual Basic 2005 assembly from Visual Basic 6.0" at
http://support.microsoft.com/kb/817248 that describes the process (which is
moderately complicated) of preparing a .Net "assembly" for access from the
"COM" environment of VB6.

There is an article in MSDN (the MicroSoft Developers Network) entitled "An
Overview of Managed/Unmanaged Code Interoperability" at
http://msdn.microsof...ary/ms973872.as px that describes the
procedures going BOTH ways. The section on "COM Interop" discusses your
issue (calling managed -- .Net -- code from unmanaged -- VB6 -- code). This
article also has a number of references for further reading.

This is NOT the easiest thing to do. However, if you are already familiar
with development in the .Net environment, you WILL be able to grasp the
concepts involved, and you should find it both possible and rewarding.
Was This Post Helpful? 1

Page 1 of 1