RE: Use DLL in Windows app problem

From: Tor Bådshaug (TorBdshaug_at_discussions.microsoft.com)
Date: 11/17/04


Date: Wed, 17 Nov 2004 14:07:04 -0800

It seems to me you are mixing namespaces and classes.

Based on your descriptions and code, I will assume that
"Solution6.Cio.FileOpening" refers to the namespace you wish to use.
It does not make sense to instantiate a namespace (which is what it seems
like you attempt to do in your "...As New..." code).

You need to identify the class within the "Solution6.Cio.FileOpening"
namespace
you want to use. When you have done so, you can instantiate it using "...As
New MyClass".
There is no need to explicitly qualify the class with
"Solution6.Cio.FileOpening" -
the imports is simply a means to avoid the hassle of having to fully qualify
classes all over the place.

Hope this helps.

"Eric" wrote:

> I have a "Sol6.dll" that I am trying to use from a windows app. I added the
> DLL as a reference and included the namespace with "Imports" as seen below.
> The problem is far below where the "Dim Sol6 As New
> Solution6.Cio.FileOpening". I get a code error with the definition of "Type
> Expected". I simply wish to use a public method like "Sol6.GetNames()" . Code
> is below. thanks
>
> Imports Solution6.Cio.FileOpening
> Public Class Form1
.... Dim Sol6 As New Solution6.Cio.FileOpening



Relevant Pages

  • Re: ProgID in .NET?
    ... The ProgID has the form Project.ClassName.Version. ... version it is possible to instantiate COM objects from different versions ... When a class from a .NET assembly is instantiated its namespace and class ... The nice part about COM is that you can choose as a developer if you want to use a specific version of a COM object or not without the vendor of the DLL facing the problem we ran now into: If we don't change the namespace you can't use different versions in the same process. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Can we create an_object = object() and add attribute like for a class?
    ... Is there any reason that under Python you cannot instantiate the object ... which may make little sense for a namespace). ...
    (comp.lang.python)
  • Re: Can we create an_object = object() and add attribute like for a class?
    ... Is there any reason that under Python you cannot instantiate the object ... I was under the impresssion that instances of type object did have a __dict__ but was hidden for some reason. ... which may make little sense for a namespace). ... any natural way of declaring a namespace SHOULD allow ...
    (comp.lang.python)
  • Gettype() returning a null
    ... html = "Hello World" ... public string emit{ ... In my webpage, I am trying to instantiate myObject dynamically, like ... My Type t will return null unless I include the CMS namespace in the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Submitting an Array to a Webservice.
    ... You have to create an class with the structure of your array... ... instantiate it where you want to use...see... ... Namespace DataTypesVB.Enumerations ... Public Class Sku ...
    (microsoft.public.dotnet.framework.webservices)

Loading