Creating a DLL in C#

We are in the process of evaluating RMS 2.0 for use in our company. As part of this process we are trying to create a DLL, in Visual Studio 2005, to add certain functionality to the POS. So far, I am able to create a DLL in Visual Basic, register it using regasm, and it works. The intellisense works fine in C# but not in VB, so I thought I would try it in C# I am getting several errors.

I get the following warning during build: "prowiz.dll does not contain any types that can be registered for COM Interop"

I get the following error when attempting to use the DLL: " Attempt to execute COM object prowiz.wiz failed. Could not create object.

I have Register Comm Interop set to true; I would much rather use C# than VB and any help would be greatly appreciated. Following is the code I am using in the C# Class. Any ideas?

Thank you,

Galen Meyer

************************************************************************ using System.Collections.Generic; using System.Runtime.InteropServices; using System.IO; using System.Text; using QSRules;

namespace prowiz { [Guid("02a53f8e-0609-4db9-ab4c-53aaa67f1831")] public interface Addin_Interface { [DispId(1)] bool Process(QSRules.SessionClass mySession); }

[Guid("02a53f8e-0609-4db9-ab4c-53aaa67f1831"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]

public interface Addin_Events { }

[Guid("02a53f8e-0609-4db9-ab4c-53aaa67f1831"), ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(Addin_Events))] [ComVisible(true)]

public class wiz : Addin_Interface { public bool Process(QSRules.SessionClass mySession) { if (DialogResult.OK == MessageBox.Show(string.Format("The current cashier is .", mySession.Cashier.Name.ToString()))) { return true; } else return false;

} } }

Reply to
Galen Meyer
Loading thread data ...

Hey, I was wondering if you had any luck with C#? I too can fairly easily create my Addin that I need with VB, but I have left VB a long time ago and I really dont like going back and developing the BAD habits that I will need to use VB. I pretty much have my Addin for VB written, but there are some more advanced things that I would like to do with it and i think I can accomplish this a little easier if I could use C#. I have tried a few different things but I was unable to get any success using C#. I am trying to write it in VS2003, but I would use 2005 or 2008. I just figured it might be a little more forgiving with an older version of Visual Studio. I would love some insight if you have been able to run across a way to start talking to QSRules with C#. I have the customization guide, but it is pretty vague, and I am not finding what I am looking for.

Thanks > We are in the process of evaluating RMS 2.0 for use in our company. As > part

##-----------------------------------------------## Newsgroup Access Courtesy

formatting link
Tax and Accounting Software ForumsWeb and RSS access to your favorite newsgroup - microsoft.public.pos - 34674 messages and counting! ##-----------------------------------------------##

Reply to
C5m7b4

I did have some luck with C#. We were creating a new customer setup wizard and have been able to do it in C#;

Using Visual Studio 2008 all you have to do is right click on the project and choose 'properties'.

On the Application Tab, click on the 'assembly information' button and check 'Make Com Visible' checkbox

On the 'Build' Tab Set the output path to to the RMS Addinis directory. That way Visual Studio copies all the files needed to the proper place. There are several files that will be added besides the dll. Also check the 'Register for Com Enterop' checkbox towards the bottom.

On the 'signing' tab, check the checkbox 'sign the assembly' and on the dialog that pops up give the file a name and it will create a SNK file in the project directory. There is no need to use a password.

That is all the changes you need to make. VS will create the strongly named key, register the assembly, add it to the GAC, and create the dll in the addinis folder.

To get the intellesense to work, in the "process" entry point, where RMS passes the session class, assign the session to a new variable. For instance this code, where MySes is the session passed from RMS, will assign the session to 'ses' and then the intellesense will work for the variable 'ses'. Don't ask me why you have to do that but that is the only way I've found to get it to work. public bool Process(QSRules.SessionClass MysSes){

QSRules.SessionClass ses = new SessionClass();

ses = MysSes;

}

Hope this helps. And sorry it took so long to reply. I just happend to be scrolling through old posts and came accross it.

Galen

Reply to
Galen Meyer

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.