CopyingFiles (Control)

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
i saw the multiple posts asking about copying numbers of files so i thought why not just make a control

seeing as i'm not good at making controls, i'm a little stuck when it comes to testing the control, i add a reference then when i go to declare a variable, i get a TypeExpected compile error, perhaps someone with a bit more knowledge could assist

this is for VS2003/.Net 1.1
 
CopyFiles is both the name of your namespace and class. If you write Dim x As New CopyFiles you get the 'type expected' error because you have only referenced the namespace and not specified a type within that namespace. Now if you write Dim x As New CopyFiles.CopyFiles you will be ready to use this type instance. Even if you import the namespace Imports CopyFiles, then in code create an instance as you tried first, the editor still don't find the type CopyFiles because it is ambiguos with the namespace which takes precedence.

I think it is confusing using the same name for both the namespace and a class in that namespace, and Developers Guide Guidelines for Names agrees with this. See the links in that page for Classes and Namespaces. Your 'company' namespace could be 'JB' and this library namespace could be 'IO' and the class could be 'FileCopy' for example.
 
gotcha, i hadn't thought of that. i actually made it so when people on this forum ask about copying files, there would be a control that would be available (i also may have a use for it elsewhere sometime too)

but i'll give it the 'proper' namespace and proper class names
however does the control currently work? since that's the other reason it's in this forum category
 
ok, i think i've got it working now and i've fixed the namespace stuff too, to use it, it's JB.IO.CopyFiles

does anyone see anything wrong with it? or does anyone see anything that could be added? i wouldn't mind this control being made by the whole forum
 
Back
Top