We help IT Professionals succeed at work.

convert vb6 business objects to c#

JakeyCakes
JakeyCakes asked
on
Medium Priority
260 Views
Last Modified: 2010-04-16
Hi

is it possible to convert vb6 code to c# as there some features in c#  which I want to use and obviously don't exist in vb6.

Let me explain further:

I want to create a wizard which either gives the user the option of running specific stored procedures for one program that does not have business objects, or to fire information at  a program that has vb6 business objects, or to fire information at a program that has  c# business objects.

Could I achieve this in c#?
Comment
Watch Question

Carl TawnSenior Systems and Integration Developer
CERTIFIED EXPERT

Commented:
You would have to manually recode it in C#, but it should certainly be possible. Obviously some of the constructs will be different because C# is fully OO and VB6 isn't.

If your VB6 business objects are DLLs then you should be able to reference them in your C# code if you need to.

Author

Commented:
carl,

Its all the business objects are stored in one DLL. How could I reference the dill in my c# code?
Carl TawnSenior Systems and Integration Developer
CERTIFIED EXPERT

Commented:
In the project just go to Project > Add Reference. Then your VB6 DLL should appear under the COM tab. If it doesn't, go to the Browse tab and add it manually.

Author

Commented:
Ok referenced. how can I use the dll now in code

e.g. To add a company.
Carl TawnSenior Systems and Integration Developer
CERTIFIED EXPERT

Commented:
You should just be able to reference the classes as you would any other type:

    ProjectName.ClassName obj = new ProjectName.ClassName();

Author

Commented:
carl,

I get  told that certain classes are iinaccessible due to its protection level. What is meant by that?
Senior Systems and Integration Developer
CERTIFIED EXPERT
Commented:
It means that they are flagged as private or some other non-public setting. In terms of VB classes you will need to look at the Instancing property for your class.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.