Deploying COM Component Add-in

I have created a simple COM Component Add-in using MS Visual Studio 2005. I created a Custom POS Button in SO Manager. It works without any errors when the code is compiled using MS VS2005 (using .NET 2.0) and the MS RMS V2 running on the same machine. However the same doesn't work when deployed on customer's machine (when the dll is copied to the AddIns folder of MS RMS). I have tried to register the component using regsvr32.exe but I get an error about the entry point.

Can somebody please let me know the steps that are required to deploy such dlls?

Thanks for you help Code: ================= _ Public Class InvokeDll

#Region "COM GUIDs" ' These GUIDs provide the COM identity for this class ' and its COM interfaces. If you change them, existing ' clients will no longer be able to access the class. Public Const ClassId As String = "323e6dcb-bc7c-43b7-986c-461b34b7e7f8" Public Const InterfaceId As String "ce429c01-c1f8-4aa1-953f-d12184817d86" Public Const EventsId As String = "ae4646a8-ff29-44a7-8442-78a9fa08d60d" #End Region

' A creatable COM class must have a Public Sub New() ' with no parameters, otherwise, the class will not be ' registered in the COM registry and cannot be created ' via CreateObject. Public Sub New() MyBase.New() End Sub

Public Function Process(ByVal mySession As Object) As Boolean

If MsgBox("The current cashier is " & mySession.Cashier.Name & ".", MsgBoxStyle.OkOnly, _ "Test Message") = MsgBoxResult.Ok Then Process = True Else Process = False End If End Function End Class =========================

Reply to
RAJ
Loading thread data ...

Antonio,

Thanks for your reply. I have tried the following:

1.) C:\Program Files\Microsoft Retail Management System\Store Operations\AddIn>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe TestDllCall.dll

Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42 Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully

2) C:\Program Files\Microsoft Retail Management System\Store Operations\AddIn>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe "C:\Program Files\Microsoft Retail Management System\Store Operations\AddIn\TestDllCall.dll"

Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42 Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully

I still get the following error from SO POS: Attempt to execute COM object 'TestDllCall.InvodeDll' Failed. Could not create object.

Not sure what I am doing wrong? Your help is much appreciated.

Reply to
RAJ

Antonio,

Thanks for your reply and the problem has been sorted. I mad the changes as stated by you in the code, recompiled and used regasm and gacutil. However, I have noticed the following: regasm.exe is present in "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" directory. gacutil.exe is present in "C:\Program Files\Microsoft Visual Studio

8\SDK\v2.0\Bin" directory. When I deploy the same to customer's machine, it will not have VS 2005 installed. Can this be done by creating an install, if yes how? If not, can i just copy the gacutil.exe to client's machine and add my dll to global assembly cache?

For your info, I have just put the process here: C:\Program Files\Microsoft Retail Management System\Store Operations\AddIns>"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe" /tlb:TestDllCall.tlb TestDllCall.dll

Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42 Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully Assembly exported to 'C:\Program Files\Microsoft Retail Management System\Store Operations\AddIns\TestDllCall.tlb', and the type library was registered successfully

C:\Program Files\Microsoft Retail Management System\Store Operations\AddIns>"C:\Program Files\Microsoft Visual Studio

8\SDK\v2.0\Bin\gacutil.exe" /i TestDllCall.dll

Microsoft (R) .NET Global Assembly Cache Utility. Version 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved.

Assembly successfully added to the cache

Reply to
RAJ

I think there is a problem in where the dll component is located. Unless the dll is set by gacutil, then it should be in the same directory as the POS program (Store Operations directory). Other options require extra information in the application config file. I copy the correct regasm for the Net framework being used into the the Store Operations directory and run it there on the dll that is also in that directory. You may be running afoul of the way the system hunts for the dll location. It is much easier to use a setup program, but you have to make sure that you check the 'make com visible' box and also that you mark the setup properties to register the assembly.

Reply to
dc

Did you add an setup program to your program? Make sure you set it to check for .net 2.0. You shouldn't have to do any of that reg jazz at all!

Make sure you are setting your process class properly and don't forget return 'true' or process = 'true' ant the end of your class. Also exclude any rms references from your install.

If you get really frustrated I'll look at it for you. We do a lot of this sort of thing. Hope it's in vb! snipped-for-privacy@jrdata.us

Reply to
JerryData

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.