6 to .Net probs

kraggoth

Newcomer
Joined
Sep 15, 2003
Messages
1
Hi, I had a working program in 6, then converted it to .Net and its riddled with problems. the following occured:

<vb>
public String strstandard
Public strstandard As String
Dim strstandard As String
</vb>

3 different ways of setting it, all returned an error."Statament is not valid in a namespace" how do i sort that out?

<vb>
Public Filesystemobject fso
</vb>

says an end of statement is expected, it wasnt expected in VB6.

<vb>
Public Sub SetFilePaths()
</vb>

every sub in the program says "Statament is not valid in a namespace". what the hell does that even mean?

:confused: :confused: :confused:
 
In .Net everything must be in classes/modules, use the upgrade wizard but expect nasty results, if you don't understand how to declare a class you should read a guide on VB.Net, VB.Net leans more towards C++ giving much more power with the same ease of use, once you get used to it
 
Last edited:
You need to have all of your declarations and procedures within your class.

At the very top of your code view window, it should say "Public Class Form1" or whatever the form is called.

all procedures and declarations MUST be typed between that statement and "End Class".

If something happened and its not there, copy all your code and start a new project.

I start my code just below the grey text "Windows Form Designer generated code"
 
Don't use the import wizard. It generates very bad code. If you really want to port to .NET properly, rewriting your project is largely required.
 
Back
Top