Home Page link  

Creating a DLL in C#

 

Point-Of-Sale Software - - MS Point Of Sale software discussed here

 Post an article  get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content  add this group's latest topics to your Google content  YahooMyWeb Yahoo!  Google Google  Windows Live Favorites Windows Live  del.icio.us del.icio.us  digg digg  Add to Netscape Netscape
Subject Author Date
Creating a DLL in C# Galen Meyer 08-25-2008
Posted by Galen Meyer on August 25, 2008, 2:29 pm
Please log in for more thread options


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;

}
}
}



Posted by C5m7b4 on September 10, 2008, 6:09 pm
Please log in for more thread options



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 in advance,
C5m7b4
-------------------------------------
Galen Meyer wrote:




> 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;

> }
> }
> }







##-----------------------------------------------##
Newsgroup Access Courtesy
http://www.rockryno.com/
Tax and Accounting Software Forums
Web and RSS access
to your favorite newsgroup -
microsoft.public.pos - 34674 messages and
counting!
##-----------------------------------------------##


Posted by Galen Meyer on November 5, 2008, 5:59 pm
Please log in for more thread options

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







>
> 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 in advance,
> C5m7b4
> -------------------------------------
> Galen Meyer wrote:
>
>
>
>
>> 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;
>
>> }
>> }
>> }
>
>
>
>
>
>
>
> ##-----------------------------------------------##
> Newsgroup Access Courtesy http://www.rockryno.com/
> Tax and Accounting Software Forums
> Web and RSS access to your favorite newsgroup -
> microsoft.public.pos - 34674 messages and counting!
> ##-----------------------------------------------##
>



Similar ThreadsPosted
creating offline db July 19, 2005, 8:19 pm
Creating new items - something doesn't add up here September 28, 2005, 6:56 am
Help creating items January 5, 2006, 5:30 pm
Difficulty in creating .Net dll March 21, 2006, 10:01 am
Creating RMS POS Com Object June 26, 2006, 5:27 pm
HQ creating duplicate POs after 340 August 1, 2006, 7:31 pm
Creating PO/transfers August 23, 2007, 10:08 am
Creating New Items and HQ and SO March 28, 2008, 10:53 pm
creating readable barcodes December 26, 2005, 6:46 pm
creating custom buttons February 7, 2006, 10:08 pm

Contact Us | Privacy Policy
This site is not affiliated with Intuit - makers of Quickbooks and Quicken software
This site is not affiliated with Sage Software - makers of Peachtree accounting software
XML SitemapXML Sitemap