Conversion vb6 to VB 2008 Express

  • Thread starter George W. Barrowcliff
  • Start date
C

C

Some of the options available is KBasic. It's is similar to features to
VB.Net, but 100% VB6 code compatible, according to the author. It's open
source, and written in VC++ 2008. It uses Qt as GUI toolkit, and compiled
code runs on Windows/Linux/Mac. I haven't tried it myself, so you may want
to check it out:

http://www.kbasic.comhttp://en.wikipedia.org/wiki/Qt_toolkit

I have checked various clones and none of them are 100% compatible. I
think it was in K Basic that you have declare every control object
manually and give it a number. Jabaco is one of the nicer options but
not very compatible with VB6.

I have to learn VB.net. That is decided. I can still decide to convert
the old codes or redesign and recode some of them. I am inclined to
learning for another few months with trial and error before starting
recoding.
 
K

Kevin Provance

| > Despite what others say, if you want at the end a
| > program that is 10 times faster then VB6 (what is
| > possible with VB for Net) . . .
|
| Put your money where your mouth is fatty. And change that picture on your
| MVP profile. You look like a child molester with his head on upside down.

..Nxt faster than VB6? LMAO!!!

I have to agree with Mike, what would know about speed waddling the way you
must.
 
N

Nobody

C said:
I am inclined to
learning for another few months with trial and error before starting
recoding.

F2 is your friend then. It brings up Object Browser, which is the quickest
way to learn .Net framework. Try searching for "graphics" for instance.

Also, download MSDN Library so you have full reference. Here is the download
link:

http://www.microsoft.com/downloads/...FamilyID=7bbe5eda-5062-4ebb-83c7-d3c5ff92a373

You need to uninstall the Express version of the library before installing
the full version as the second note in the link above says.
 
T

Tom Shelton

| > Despite what others say, if you want at the end a
| > program that is 10 times faster then VB6 (what is
| > possible with VB for Net) . . .
|
| Put your money where your mouth is fatty. And change that picture on your
| MVP profile. You look like a child molester with his head on upside down.

.Nxt faster than VB6? LMAO!!!

I hate to tell you this kev - but, it actually is for somethings. Not
everything... For instance, winforms uses GDI+ graphics, which is still
usually slower then the old GDI based forms used in VB6 - so, complex graphics
operations are definately slower.

But, I've been working on converting Olaf's Mandlebrot demo to .net (as time
permits) - and while the screen drawing is slower (though, I could probably
fix that if I used the API instead of the normal .net graphics methdos) -
when run in multithreaded mode, it is often twice as fast to do the actual
calculations on a large image. When run single threaded, it usually runs
about the same speed :)

That said, Cor does tend to exageration and misrepresentation of the speed
side of things - but, your personal attacks on him are to put it mildly,
disgusting.

So, STFU
 
K

Kevin Provance

| That said, Cor does tend to exageration and misrepresentation of the speed
| side of things - but, your personal attacks on him are to put it mildly,
| disgusting.
|
| So, STFU

Blah blah blah. Bite me, bit<h
 
A

Alex Clark

Mike,

I'd be happy to take that challenge. Case study:

Recordset with 10,000+ records which need to be written out to a file in CSV
format. Fairly standard, run of the mill export operation that you find in
loads of LOB apps these days. Oh, and we're working with strings so VB6
should be far quicker than .NET... right?

Let's see what you can do, and I guarantee .NET will better it in terms of
performance.

Alex
 
M

Mike Williams

I'd be happy to take that challenge. Case study: Recordset with 10,000+
records which need to be written
out to a file in CSV format . . . Let's see what you can do
and I guarantee .NET will better it in terms of performance.

That wasn't the challenge, dick brain. The challenge was to attempt to prove
the claim made by one of your fellow conspirators that VB.Net is *** ten
times faster *** than VB6. In any case, I wasn't talking to you, Dick Brain
or Alex or Bill or whatever you are currently calling yourself. I was
talking to the other troll, fatty Ligthert. You remember, the short fat ugly
MVP who looks like a paedophile. He claimed that VB.Net is *** ten times
faster *** than VB6. Not just as fast, or nearly as fast, or somewhat
faster, but actually *** ten times as fast ***.

So, come on fatty, wherever you are, come on out of your little fat hiding
place Ligthert and take up the challenge. Let's write some code to load a
1024 x 768 pixel full colour .bmp file from disk (an image that would
typically contain hundreds of thousands of different colours, as do most
photos) and count the number of unique colours it actually contains. I've
specified a .bmp because such image files always contain an accurately
countable number of unique colours and so we can accurately compare our
results if we use the same .bmp image. The code should work on all machines
of course, regardless of the colour depth at which they are currently
running, and it should return the same number of unique colours for the same
..bmp file on all of them.

Your timer should count the total time to both load the .bmp file from disk
and count the unique colours, just to ensure that you can't cheat by
spending extra unmetered time loading the bitmap in such a way as to make it
easier for your timed code to deal with. For test purposes both the VB.Net
version and the VB6 version should be run on the same machine. We'll take an
average of the first ten calls to the routine, with the routine itself each
time loading the .bmp from disk anew and counting the colours as would
normally be the case when writing a general purpose function to which the
user can pass the name of any desired .bmp file. Let's provide a Button that
the user can click so that the function is run anew each time he clicks the
button, with the time displayed for each run on the Form somewhere, and then
you can just add up the times manually and take the average.

The code should be run in the condition that it would normally be delivered
to the user, which in the case of a VB6 program is a native code compiled
exe (we'll leave out any special compiler speed options for the time being
just to see how it works without them). Okay, fatty. Are you up for it?
Remember, your own VB.Net code needs to be *** ten times faster *** than my
VB6 code in order for you to win and prove your claim. Also remember that it
was you who made the claim fatty, so it should be your own code. Don't
cheat. Let me know when you've finished your VB.Net version and tested it,
and let me know how fast it is and we'll see whether or not it is ten times
faster than my own VB6 code, as per your claim. We can then swap code online
so others can try the two versions to see whether your *** ten times faster
than VB6 *** claim is another one of your lies or not. How about it, fatty?

Mike
 
A

Alex Clark

Mike Williams said:
That wasn't the challenge, dick brain. The challenge was to attempt to
prove the claim made by one of your fellow conspirators that VB.Net is ***
ten times faster *** than VB6.

And as I said, that's the example above. Put your money where your mouth
is, Kevin/Mike - I'm TELLING you that VB.NET will be faster than VB6 for
that particular example.

Or are you afraid you'll be proven wrong? Again.
 
M

Mike Williams

And as I said, that's the example above. Put your money
where your mouth is, Kevin/Mike

I didn't put my mouth anywhere, Clark/McCarthy, so I don't need to put my
money there either. It is your little fat accomplice Ligthert who was
shouting his mouth off, telling everyone that VB.Net is ten times fatser
than VB6, so it is your little fat accomplice who needs to put his money
where his mouth is.
I'm TELLING you that VB.NET will be faster than
VB6 for that particular example [saving some data
in CSV format to disk].

You can tell me whatever you like. It doesn't matter. You are a dick head
troll and what you say is completely irrelevant. VB.Net may or may not be
faster than VB6 for that specific task. I never made any statement in that
regard either way. VB.Net will be faster for some tasks and slower for
others. Horses for courses. In fact, completely contrary to what you said
yourself, string handling is not VB6's forte due to the fact that VB always
uses two bytes per character for standard strings whereas many other things
do not, and various under the hood conversions occur when performing some
tasks, and it is therefore quite likely that VB.Net may be a little faster
for the specific task you have in mind. Not that it matters anyway
Clark/McCarthy because you are a total irrelevance in this matter, which is
between myself and your little fat accomplice. If you want to help your
little fat accomplice out with the challenge I have set him (although I
suspect your help would actually hinder him) then feel free to do so.
Remember, you're out to prove your little fat friend's stupid statement that
VB.Net is ten times faster than VB6.

Mike
 
S

Scott M.

Since I've got some of the trolls blocked and can't respond to them
directly, I'll add this here:

http://www.google.com/url?q=http://...result&usg=AFQjCNE6dCe-oU9HY0Sn-dparQZWWzXw2Q

Now, keep in mind that this article/paper was written about the 1.0
framwork.

But, I really think the issue comes down to this.

VB 6 developers who want to move to .NET largely don't believe that they
have to spend the time to start all over and learn .NET from scratch because
they've seen VB .NET code and, at first glance, recognized many of the
language's keywords and come to the conclusion that VB .NET is just VB 6
with new stuff added.

Now, let me take a minute to qualify those statements. I am the
owner/operator of an IT training company and have been training folks from
all kinds of backgrounds (VB 6, COBOL, Java, new programmers) in .NET since
its inception. And, by the way, I myself, was a VB 6 developer/trainer
before .NET came out so I initially grappled with all this myself. I've
seen literally thousands of VB 6 developers move to .NET and honestly 90
somthing percent of them believe that they do not need any training in VB
..NET because of the VB 6 experience they already have.

This is very difficult to try to convince the VB 6 developer that, although
they may have many years of experience with classic VB, they really don't
know very much at all about .NET.

Now, here's where rumors and mis-information begins... Those VB 6 developers
who go off into the VB .NET world without proper instruction obviously start
by writing what they already know. The use MsgBox(), CStr, CLng, CDate, and
all the other code they've come to know and love. And you know what? That
code compiles, which reinforces that person's beliefs that they don't need
training in .NET because they are able to write functioning code.

Now, the next phase of this VB 6 developer's journey to .NET goes something
like this... The developer get's more adventurous and writes something
beyond a "Hello World" application and, much to their suprise the
application runs slowly. Slower, in fact, than it did in VB 6! Yet, since
the code they wrote compiled and does ultimately do the job, they believe
that they have coded the applicaiton correctly.

This is where posts in NG's that VB .NET sucks and runs slower than VB 6
come from. Developer's who haven't taken the time to learn about the
environment that they are working in and are uneducated as to how to code in
..NET properly.

I see this all the time and not just on the individual developer's part, but
with large Fortune 500 companies as well. I can't tell you how many times
I've been called in to figure out why a VB 6 application that was sent
off-shore to be "converted" to VB .NET came back running slower than when it
was sent out. The answer 100% of the time is that the applcation was only
converted to the point that it would compile. Older, antequated VB 6 code
that stull functions, but is not optimal was left in the application.

One of the simplest examples to illustrate this point is this:


[VB 6]

'Collect some data from the outside world
Dim age As Integer
age =CInt(txtAge.Text)


'Convert the data for internal program use
Dim agePlus100 As Long
agePlus100 = CLng(age) + 100

Now, to "convert" this code to VB .NET, you'd find that you don't have to do
anything at all. The code compiles and runs as is! But, the code is not
written properly to efficiently run in .NET. But, how would the VB 6
developer who is just plugging their way through VB .NET going to know that?
They won't. As far as they can tell, the code is correct because it compiles
and runs.

But, with a further understanding of how .NET works, we can see that this
code causes an unnecessary boxing and unboxing operation on the heap as well
as creating an unecessary object in memory.

Value types (Integers) are stored in .NET managed stack of memory, while
Reference types (objects and other class instances) are stored on the
managed heap.

The CLng() function accepts an "object" parameter in .NET, meaning that the
age parameter (which is already a value type of Integer and stored on the
stack with 4 bytes of memory) will be "boxed" up into an "object" type and
stored on the heap. This means that the data is now on the stack and the
heap and an extra object has been created in the process. But, wait it gets
better....

Now that the input (age) has been placed into an object on the heap, the
conversion can take place whcih results in a Long Integer being creaed on
the stack (8 bytes) and the data from the heap object is copied into it.

So, to get to the desired Long Integer, we have to create memory on the
heap, copy data over to it then copy data out of it and put the data into a
Long on the stack.

But, to do this properly and effectively in .NET, you shouldn't be using the
VB 6 conversion functions at all. You should write:

[Proper VB .NET]
'Collect some data from the outside world

Dim age As Integer
Dim result As Boolean = Integer.TryParse(txtAge.Text, age)

'Convert the data for internal program use
If result then
Dim agePlus100 As Long = Convert.ToInt64(age) + 100
End If

This is just one simple example of how applications written using VB 6
coding cause poor results and create a bad impression of how it performs.
There are MANY MANY other situations similar to this.

The fact is that, given proper instruction and understanding of how to code
agains the .NET Framework (not how to write VB .NET), you will create
efficient and effective code.

-Scott
 
S

Schmidt

I'd be happy to take that challenge. Case study:

Recordset with 10,000+ records which need to be written out
to a file in CSV format. Fairly standard, ...

Ok, in case you want to play with FileIO and String-Handling
(parsing, concatenating) - I'd be willing to take up this
"challenge", in case we can leave out the "DB-stuff", since
that would make the examples easier to implement on
both sides.

What, if the "Raw-Data" does not come from a DB, but from
a 'Src.csv'-File instead?

The task would then be, to read-in (parse) the 'Src.csv',
order the records by a certain String-Field and write the
sorted results back to a 'Dst.csv'.

Timing would then be measured "over-all" (parsing the Src.csv,
sorting, writing back to Dst.csv).

Here comes a concrete task-proposal:
Download 'holdings.csv' from:
http://www.archive.org/details/LibraryHoldingsData
which is ~8MB gz-compressed and unpacks to an about
80MB csv-File with "non-quoted string-field-content".

It contains only 4 Fields per record:
ISBN (String)
CarnegieNr (Integer)
LibName (String)
LibURL (String)

So, let's just parse that in, perform a simple binary sort (or
if you want, then also a caseinsensitive one) on the third
Field: LibName (String) - and write the sorted records
back to a Dst.csv in ascending (LibName) order.
To prevent "record-copy-over-trickery" at the ByteLevel,
there should be an additional condition, to write out each
String-Field content of the new File within additional
csv-quotes ("...").

That's an easy enough task-description, dealing with Files
and Strings, leaving out any ADO/ADO.NET- and DB-
dependencies.

If you agree about the outlined task, then we could start
immediately with that.

Olaf
 
N

nabh

I have an application developed by someone else using VB6 that needs a few
changes.  Last guy is gone, so is VB6 environment.
I downloaded and installed 2008 Express, then converted application.

from the tone of the above you seems to have born right into dotnet.
No any umbilical relation with vb6 whatsoever.

and it explicitly shows you are a fresher at dotnet as well.

If you have some reasonable knowledge about VB6 and atleast 1 week
acquaintance with dotnet you wouldnt have imagined a
single click would convert a vb6 project into a dotnet one. It is a
near impossibilty to do it with even a 1000 clicks.
MS shouldnt have included a CONVERT option. Only Elementary school
level (Or shall I say 'Hello world Level') vb6 projects can be
converted into
dotnet with the conversion wizard

... just putting your foot inside dotnet and you dared to declare
'gone, xxx VB6 environment'

But sure, VB6 wont officially make any return. (MS never acknowledge
their blunders, never learns from their errors, even the whole world
protests or cry foul they wont give a damn. Why should they? there is
not even a single competetor worth calling a competetor. Those who are
jumping into the fray do not attempt anything new, original, they are
obsessed with the success of MS and imitate MS products making one or
two tweakings here and there, and the end result always is a product
that is packed with more blunders than the original. Glaring example
FireFox.)

And Google? Google is the marvel of the IT world, as far as its search
engine is concerned, also google earth and many more. But when they
wanted to create a browser they were no better than the others in the
ring. Competetor? Sun is a gone case. Google seems to have the
resources, power and everything to be one, but somewhere, somehow they
are missing something; some lack of coordination? lack of streamlined
guidelines? not sure

VB6 wont comback. Dotnet will never be a replacement either. What
transpires next depends on who emerges as a threat to MS. if there is
no threat they will play this and that seldom caring for anyone. if
someone pose some real threat, they may change their attitude and
perhaps bring out another vb6 bottled in an entirely new name but a
clone of vb6 by soul, looks and manners.

Let us see
 

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