>> Reference dotNet.dll

  • Thread starter Thread starter Jonathan
  • Start date Start date
J

Jonathan

Hi, using MS Access 2003 I would like to run a .dll created in vb.net 2008.
When I use Tools/References to select the file I get the error message "Can't
add a reference to the specified file."

Any idea why?

Many thanks, Jonathan
 
On Mon, 17 Nov 2008 17:19:00 -0800, Jonathan

Because MsAccess is not forward compatible. It doesn't know anything
about .NET-style DLLs.
Ask the .NET developer to add a COM wrapper.

-Tom.
Microsoft Access MVP
 
You can get the info in "Inside C#" Second Edition, Microsoft Press, Chapter
22. It is far from being complex. In summary, create an interface for the
method that will be available:


public interface IMyInterface
{
float whatever { get; set;}
void methodOne( );
...
}


and write code to implement it, with the attribute ClassInterface:

[ClassInterface(ClassInterfaceType.None)]
public class MyClass : IMyInterface
{
...
}


Compile the dll, and use REGASM (command line)

regasm MyClass.dll /tlb:MyClass.tlb


and use the tlb file as reference.


More details for the book given as reference:
http://www.amazon.com/Inside-C-Seco...bs_sr_1?ie=UTF8&s=books&qid=1227042782&sr=8-1



Vanderghast, Access MVP
 
Back
Top