Finally i achieved that to work as a .net code... but there's still a
problem: at runtime, when i try to access to the library method, get an
'object required' exception
(system.runtime.InteropServices.COMException).
how can i solve that? have i to place my library in any special path?
thanks to all!
JAUME
(E-Mail Removed) wrote:
> First of all, thanks for the answers!
>
> At runtime, my library is not in the same folder even the same disk
> than the code i'm executing, but the dll is registered in the system,m
> i thought it should be enough. Where i should to place the library,
> according the code?
>
> Anyway, i added my library to the reference list (i don't know whether
> as a COM object or not), but i'm still unable to us it as a .net
> code...
>
> Thanks!
>
> JAUME
>
> Ignacio Machin ( .NET/ C# MVP ) wrote:
> > Hi,
> >
> > <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > | Hi,
> > |
> > | I've a vb dll with a function that i want to access from C#. I'm using
> > | the following:
> > |
> > | public class library
> > | {
> > | [DllImport("myDll.dll", CharSet = CharSet.Auto, EntryPoint =
> > | "clsLibrary")]
> > | public static extern void create();
> > | }
> >
> > IIRC VB never generated native win32 dll, but COM dlls, if that is so all
> > you have to do to include your dll is select Add a Reference, go to COM and
> > look for it. This will create a wrapper to your dll that you can use
> > directly in your code as any other .NET namespace.
> >
> >
> > --
> > Ignacio Machin
> > machin AT laceupsolutions com