Win32 API in VB.Net

B

Bo Gusman

Hi.

I'm porting a 250KLOC VB6 app to .Net this coming year. In order to
overcome some of the deficiencies in various version of VB (the app
originally began its life as a Quick Basic app and has gone through all
iterations of VB from 3 onward!), especially related to drawing, the
original authors (one of whom is my boss) made extensive use of the
Win32 API.

Has anyone else done such a porting job and can provide me with lessons
learned? Does anyone have a compelling argument that I can use to
convince my boss that rewriting it all using .Net Framework calls is the
right way to go? Any other advice besides shaving my head and joining a
monastery?

TIA!

Bo
 
H

Harvey Triana

Bo.

Looking for framework classes. Maybe you have not to call an API again. --
After Whidbey, at least---

However, we can declare API function using namespace
System.RunTime.InteropServices .. Approach sample:
<DllImport("kernel32.dll")> _
Public Shared Sub Sleep(ByVal dwMilliseconds As Long)
End Sub






--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Harvey Triana
Well Tracks .NET Developer (VB Hero)
(Software Engineer) ...Yet
VB Clásico: http://www.mvps.org/vexpert
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Las cosas deben ser sencillas pero no más. A.E.
 
V

Vincent Finn

Hi.

I'm porting a 250KLOC VB6 app to .Net this coming year. In order to
overcome some of the deficiencies in various version of VB (the app
originally began its life as a Quick Basic app and has gone through all
iterations of VB from 3 onward!), especially related to drawing, the
original authors (one of whom is my boss) made extensive use of the
Win32 API.

Check for a library version of any API first since it'll be easier to
use but if there isn't one check PInvoke.net for it before writing
your own (http://www.pinvoke.net/)
Has anyone else done such a porting job and can provide me with lessons
learned? Does anyone have a compelling argument that I can use to
convince my boss that rewriting it all using .Net Framework calls is the
right way to go? Any other advice besides shaving my head and joining a
monastery?

Don't think there is a compelling argument, VB.Net is better than VB
(by better I mean more stable, better libraries and easier to extend)
and with support for VB being dropped you will have to move some time

One other piece of advice is to do it by hand
start a new project and code in .Net
the conversion wizard is awful and seems to cause more trouble
(depending how you coded the original) than it is worth

Vin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top