Can I build COM add-in using C#

Can I build COM component add-in using C# instead of VB? When I build an add-in using C#, the compiler complains Session (object) does not contain a definition for 'Transaction' however, VB project build id successful.

Please advise.

P.S. I am a C# programmer, not VB.

Reply to
lzcouponex
Loading thread data ...

The only way I managed to get this to work was to build a VB.Net wrapper to catch the COM call from RMS, then call a c# component to provide the functionality. Unfortunately, I don't remember what the issue with calling c# directly was...

Reply to
Glenn Adams [MVP - Retail Mgmt]

Yes.. you can, but for interoperability (sorry if my word is not correct) your environment (I think that you work with Visual Studio ..) you have the same object with suffix Class..

Example:

TransactionClass TransactionEntryClass SessionClass..

After, you need to compile your library with flag for COM-interoperability, or it's work only from .NET software.

For my experience with POS.. I have a bit of diffidence for hook. The ..NET environment is big .. and the POS load/destroy everytime hooks... and it's not good for performance.

Bye Antonio

p.s. thank you to all for *ENGLISH* school.. tomorrow I hope to buy a school-book of english :P

Reply to
Antonio Mazzeo

There is something that I don't understand. When I build add-in in C#, the compiler complains session object does not contain Transaction however, builing an add-in in VB.NET was successful. Both don't import SessionClass namespace, why VB works, C# does not?

Please advise.

Reply to
lzcouponex

VB or VB.net ?

If with vb.net, they are no difference with c#... when you open a C# project do you have into reference the QSRules.dll ? If no.. you must include it

antonio

Reply to
Antonio Mazzeo

VB has always been a very forgiving environment and that seems to have carried forward into the .Net world as well. I ran into the same thing but never took the time to resolve it. Like I said, if you use VB to take care of the COM InterOp, you can still build your functionality in c# and call it from VB.Net, passing the QSRules session object with no trouble.

Reply to
Glenn Adams [MVP - Retail Mgmt]

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.