New To Visual Basic 2005

R

RFleming

I am not trying to come across as trying to get all my questions
answered without doing any work, I am just hoping for someone(s) to
suggest the best places and terminology to use when trying to get my
answers.

I am a fairly advanced Visual Basic 6 programmer. I decided to give
VB 2005 a try (I gave up on .net but decided to try again). I picked
a fairly simple program code wise (about 100 lines of code) but one
that uses an activeX control I wrote, several APIs, declares and
types, and a Hook (call back function) for a window.

I was able to load the project into VB 2005 Express and it converted
it, but has several issues. The first one I came across and cannot
solve is several of my API declares uses Any, for example

Declare Function FormatMessage Lib "kernel32" Alias
"FormatMessageA" (ByVal dwFlags As Integer, ByRef lpSource As Any,
ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, ByVal
lpBuffer As String, ByVal nSize As Integer, ByRef Arguments As
Integer) As Integer

I looked on MSDN and the LpSource is defined as LCPVOID????? That is
where I got stuck. I did searches on VB 2005 API Viewer, and many
others but came up with zero.

I really would like to learn, but I don't have the 5 years it took me
to get where I have been for 4 years now with VB 6. Anyone willing to
through some good books, suggest things I am overlooking like maybe
APIs are not called APIs in VB 2005?? Anyhow I appreciate anyone
willing to point me in a good direction!

Thanks

Ryan
 
C

Cor Ligthert [MVP]

RFleming,

If you want to go on VB6 programming wit VBNet then better is to use VB6.
With VB.Net you will than get worse programs than you would have had with
VB6.

However if you use right VB.Net programming than your program can maybe 10
times as fast and 10 times as small. To start here.

http://msdn2.microsoft.com/en-us/library/aa302340.aspx
(it are not real API's but that is for guys like you)


Maybe this as well
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dbnetlib/htm/dbnetlib.asp

I hope this helps,

Cor
 
R

RobinS

I think what Cor is trying to say, is you should try to figure out how this
is done in VB2005 rather than just trying to convert the VB6 commands.

The converter for converting from VB6 to VB2005 is strictly a syntax thing,
it doesn't tell you anything about methodology.

If you want to read an entertaining and informative book about VB2005,
check out Tim Patrick's Start-to-Finish VB2005. It covers a lot of info, is
humorous, and you build an entire application while you work through the
book.

If you want to learn how to build a 3-layer app, with different layers for
your business layer, data access layer, and UI, check out Deborah Kurata's
new book "Doing Objects in VB2005". This one actually really, really helped
me understand classes and inheritance, and make the jump from VB6 to
VB2005.

Good luck.

Robin S.
 
C

Chris Dunaway

I was able to load the project into VB 2005 Express and it converted
it, but has several issues. The first one I came across and cannot
solve is several of my API declares uses Any, for example

As far as API declares go, try pinvoke.net
 
L

lord.zoltar

I was able to load the project into VB 2005 Express and it converted
it, but has several issues. The first one I came across and cannot
solve is several of my API declares uses Any, for example

Declare Function FormatMessage Lib "kernel32" Alias
"FormatMessageA" (ByVal dwFlags As Integer, ByRef lpSource As Any,
ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, ByVal
lpBuffer As String, ByVal nSize As Integer, ByRef Arguments As
Integer) As Integer

hehe my VB6 is probably about as good as your VB .NET. I'll try anyway
with the "Any" problem:
Is it possible to re-write parts of the API? As I recall, Any was used
for any type in VB6. In VB .NET, the closest you would have is to
declare lpSource as an Object. Object is kind of ugly though, so I try
to use generics when I can.

I have to say, I agree with the others, though, when they say it might
be better to learn the new ways of doing things, rather than convert
old VB6 code. I've been in a couple conversion projects now. I don't
even bother anymore testing the converted code to see if it will
compile, I just start working on ".NET"-ing it right away (as long as
I have a working VB6 version beside me so I can see how it *should*
work).
VB6 and VB .NET are quite different. There is a bit of a learning
curve, but having gone through it, I definitely think it's worthwhile.
 
A

aaron.kempf

hey lord zol

if you don't know Vb6 then why don't you STFU instead of flame me when
I speak the truth?
 
A

aaron.kempf

I would honestly hold off until Visual Fred version 3.0 comes out this
summer.

Seriously here; ADO.net is going to change EVERYTHING
OOP is going to change EVERYTHING

now is not the time to jump on the VB.net train

I've been using VB6 forever; and basic since 1982.

and I won't use .NET until it is a complete replacement for VB
 

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