P
Patrick Wolf
Hi,
I am trying very hard to use RegFree Com from Microsoft Access 2003 on XP
Pro .NET 2.0.
I made a class library project in VS 2005 C# (Service.cs & Assembly.cs).
When referencing in from a local installed Access it works fine.
When trying to run it from a different workstation where Test.API.COM.dll is
not registered it doesnt work.
When I put all files into the Office11 folder Access says on startup
"The application has failed to start because the application configuration
is incorrect.."
When I remove this line from the manifest Access starts again but it still
doesnt work to call Test.API.COM.dll
<typelib
tlbid="{2af5c211-13bf-43f9-b200-dce012140422}"
version="1.0.0.0" helpdir="" resourceid="0" flags="HASDISKIMAGE" />
Thank you very much for your help
Patrick Wolf
www.patrickwolf.net
----------------------------------------------------------------------------------------------
Service.cs (in VS 2005 project)
----------------------------------------------------------------------------------------------
using System.Runtime.InteropServices;
using Microsoft.VisualBasic;
namespace Test.API.COM
{
// [ComVisible(true)]
[ComClass(Service.ClassId, Service.InterfaceId, Service.EventsId)]
public class Service
{
#region "COM GUIDs"
public const string ClassId = "D50636AF-44BF-4A4C-BF41-713070D9ECA2";
public const string InterfaceId = "FBA843CB-D290-4C95-8D04-C72B51A29F06";
public const string EventsId = "491518C7-D50F-4A36-A490-75A93C168E44";
#endregion
public Service():base() {}
public string GetMe(string test){return "return value: " + test;}
}
}
----------------------------------------------------------------------------------------------
AssemblyInfo.cs (in VS 2005 project)
----------------------------------------------------------------------------------------------
.....
[assembly: ComVisible(true)]
[assembly: Guid("2af5c211-13bf-43f9-b200-dce012140422")]
.....
----------------------------------------------------------------------------------------------
MsAccess VBA Code
----------------------------------------------------------------------------------------------
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim d As Test_API_COM.Service
Set d = New Test_API_COM.Service
MsgBox (d.GetMe("HIPAT"))
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox err.Description & err.LastDllError & err.Source & err.Number
Resume Exit_Command0_Click
End Sub
----------------------------------------------------------------------------------------------
MSACCESS.EXE.CONFIG
----------------------------------------------------------------------------------------------
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
----------------------------------------------------------------------------------------------
MSACCESS.EXE.MANIFEST
----------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="10.0.4302.0" processorArchitecture="X86" name="MSACCESS.EXE"
type="win32"
/>
<file name="Cafe.Amanda.API.COM.dll"
xmlns="urn:schemas-microsoft-com:asm.v1">
<typelib
tlbid="{2af5c211-13bf-43f9-b200-dce012140422}"
version="1.0.0.0" helpdir="" resourceid="0" flags="HASDISKIMAGE" />
<comClass
clsid="{D50636AF-44BF-4A4C-BF41-713070D9ECA2}"
threadingModel="Apartment"
tlbid="{2af5c211-13bf-43f9-b200-dce012140422}"
progid="Cafe_Amanda_API_COM.Service"
name="Cafe_Amanda_API_COM.Service"/>
</file>
</assembly>
----------------------------------------------------------------------------------------------
I am trying very hard to use RegFree Com from Microsoft Access 2003 on XP
Pro .NET 2.0.
I made a class library project in VS 2005 C# (Service.cs & Assembly.cs).
When referencing in from a local installed Access it works fine.
When trying to run it from a different workstation where Test.API.COM.dll is
not registered it doesnt work.
When I put all files into the Office11 folder Access says on startup
"The application has failed to start because the application configuration
is incorrect.."
When I remove this line from the manifest Access starts again but it still
doesnt work to call Test.API.COM.dll
<typelib
tlbid="{2af5c211-13bf-43f9-b200-dce012140422}"
version="1.0.0.0" helpdir="" resourceid="0" flags="HASDISKIMAGE" />
Thank you very much for your help
Patrick Wolf
www.patrickwolf.net
----------------------------------------------------------------------------------------------
Service.cs (in VS 2005 project)
----------------------------------------------------------------------------------------------
using System.Runtime.InteropServices;
using Microsoft.VisualBasic;
namespace Test.API.COM
{
// [ComVisible(true)]
[ComClass(Service.ClassId, Service.InterfaceId, Service.EventsId)]
public class Service
{
#region "COM GUIDs"
public const string ClassId = "D50636AF-44BF-4A4C-BF41-713070D9ECA2";
public const string InterfaceId = "FBA843CB-D290-4C95-8D04-C72B51A29F06";
public const string EventsId = "491518C7-D50F-4A36-A490-75A93C168E44";
#endregion
public Service():base() {}
public string GetMe(string test){return "return value: " + test;}
}
}
----------------------------------------------------------------------------------------------
AssemblyInfo.cs (in VS 2005 project)
----------------------------------------------------------------------------------------------
.....
[assembly: ComVisible(true)]
[assembly: Guid("2af5c211-13bf-43f9-b200-dce012140422")]
.....
----------------------------------------------------------------------------------------------
MsAccess VBA Code
----------------------------------------------------------------------------------------------
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim d As Test_API_COM.Service
Set d = New Test_API_COM.Service
MsgBox (d.GetMe("HIPAT"))
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox err.Description & err.LastDllError & err.Source & err.Number
Resume Exit_Command0_Click
End Sub
----------------------------------------------------------------------------------------------
MSACCESS.EXE.CONFIG
----------------------------------------------------------------------------------------------
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
----------------------------------------------------------------------------------------------
MSACCESS.EXE.MANIFEST
----------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="10.0.4302.0" processorArchitecture="X86" name="MSACCESS.EXE"
type="win32"
/>
<file name="Cafe.Amanda.API.COM.dll"
xmlns="urn:schemas-microsoft-com:asm.v1">
<typelib
tlbid="{2af5c211-13bf-43f9-b200-dce012140422}"
version="1.0.0.0" helpdir="" resourceid="0" flags="HASDISKIMAGE" />
<comClass
clsid="{D50636AF-44BF-4A4C-BF41-713070D9ECA2}"
threadingModel="Apartment"
tlbid="{2af5c211-13bf-43f9-b200-dce012140422}"
progid="Cafe_Amanda_API_COM.Service"
name="Cafe_Amanda_API_COM.Service"/>
</file>
</assembly>
----------------------------------------------------------------------------------------------