Click here to Skip to main content
16,015,920 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone

I am writing a C# code that should be able to utilize certain functionalities in an already written code in visual basic. The VB project has its own GUI. My C# GUI should include all inputs to the application that the VB project has and also invoke some of the methods repeatedly. the VB project writes the outcome date into individual flat text files. These data need to be appended into a single file and sorted based on time.
What is the best way to approach this problem. Is there any way to write a wrapper for the vb in C#? if yes, how to approach it? I saw a similar issue in another question between C# and C++. There was a mention of invoking the vb methods through C#? how is this possible with C# and VB? Please provide as much detail as you can since coding is something that I just started doing, which I'm really liking.
This site and it's members have been an extremely big help in my learning process. THANK YOU ALL... :)
Posted

If they are both .NET, then all you need to do is add a reference to the VB project in your C# project. Optionally, you can also add a usi9ng statement to access the namespace. As far as .NET is concerned, it doesn't matter if the code was VB or C# - it can just be accessed. The only difference you may find is that VB is no case sensitive, C# is.

If the VB is VB6 or less, then it gets more complicated.
 
Share this answer
 
Thanks for the answer. Would you please be a little more specific when you mention adding a reference to VB. How do I do that? please provide a quick and sample.
Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900