[AccessD] Creating Managed Add-ins for Access 2007

Jim Lawrence accessd at shaw.ca
Fri Nov 3 08:33:55 CST 2006


Great stuff Marty....

There does seem to be a number of considerations, before using this 
http://msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/default.aspx?loc=&
side=true#a
..and it is available at:
http://download.microsoft.com/download/2/e/9/2e9bde04-3af1-4814-9f1e-733f732
369a3/RegFreeCOM.exe

Just a comment
Jim 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of MartyConnelly
Sent: Thursday, November 02, 2006 3:37 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Creating Managed Add-ins for Access 2007

BTW, did you ever try to use Registration-Free COM
(http://msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/), which William
mentioned here some time ago?

Yup it works calling a VB.Net wrapped com class dll from Access However the
download from the article is missing  a comclass.zip It is only 2 or 3 K,
you need this to build any new classes. It is installed by Visual Studio but
not VB Express. I don't have Visual Studio  but found it in a .msi file
downloadable from this simlar article by same author below. Just install it
in the directory indicated in the article then it will appear in temporary
templates in vb.Net IDE. It contains the COM Class template necessary for
building new class projects.
I suppose you could workaround it with your own GUID's but don't know the
pitfuls.

Visual Basic Fusion: Best Practices to Use Visual Basic 6 and Visual Basic
.NET Together

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html
/vbbestprac.asp

 You may have a  problem in the registering of the dll.

Two ways to do this

Install the project and open it in VB.Net, then do a Build this will
register the dll with the com registry. There are step by step instuctions
except for doing the final build in the first article. The build will also
create a new tlb file and register the assembly in the GAC and register the
dll. There are also standalone routines to do this too.

To use Access set a reference to the tlb file that will be in a directory
like below depending on where you installed the project. C:\Access
files\VBFusion\VB2005\FX20Wrapper\bin\Release\FX20Wrapper.tlb
The tlb will allow Access to see the class definitions and do a compile.

Then just run your routine.

The other way is to use the included  install.bat to register the dll It
uses regasm and gacutil to remove any previously named dll and reinstall in
the registry. Haven't tried this method. See

http://samples.gotdotnet.com/quickstart/howto/doc/Interop/Building_Samples_C
OM2NET.aspx

install batch file looks like this

regasm
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\system.windows.forms.dll"

gacutil -u FX20Wrapper
regasm /u "VB2005\FX20Wrapper\bin\Release\FX20Wrapper.dll"

regasm /tlb "VB2005\FX20Wrapper\bin\Release\FX20Wrapper.dll"
gacutil -i "VB2005\FX20Wrapper\bin\Release\FX20Wrapper.dll"


Shamil Salakhetdinov wrote:

>Yes, Marty, it should be doable just using VB 2005 Express.
>
><<<
>installing with GPAC's instead of a created msi from a wizard.
>  
>
>Yes, should be doable - but also .NET Framework SDK is needed I think 
>to extract type library from shared add-in's assembly using TlbExp.exe 
>utility, which is delivered in SDK or is tlbexp.exe also delivered in 
>.NET Framework itself?...
>
>BTW, did you ever try to use Registration-Free COM 
>(http://msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/), which 
>William mentioned here some time ago?
>
>If that works OK then a Shared/COM Add-in can be probably installed 
>using xcopy given:
>
>- its assembly and related files;
>- its typelib;
>- its manifest file for RegFree COM (open question here is how(/what is 
>its
>format) to make it?)...
>
>That would be great if it would work this way - it still might need to 
>set several registry entries to "inform" MS Access about presence of 
>com-add-in to load but this should be as easy as running once a .reg 
>file with needed registry entries...
>
>--
>Shamil
> 
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of 
>MartyConnelly
>Sent: Thursday, November 02, 2006 11:43 PM
>To: Access Developers discussion and problem solving
>Subject: [AccessD] Creating Managed Add-ins for Access 2007
>
>Interesting article from Ken Getz
>Creating Managed Add-ins for Access 2007 
>http://msdn2.microsoft.com/en-us/library/aa902693.aspx
>
>You can probably do this without installing Visual Studio Tools and 
>just VB 2005 express but it might require filching the Shared Add-in 
>template class and installing with GPAC's instead of a created msi from 
>a wizard.
>
>  
>

--
Marty Connelly
Victoria, B.C.
Canada

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list