|
Posted by Glenn Adams [MVP - Retail Mgmt on March 23, 2006, 10:06 pm
Please log in for more thread options Like I said, vb.Net is much easier to deal with... I'm generally
agnostic toward .Net languages, but because of some poor implementation
decisions around RMS, vb.Net seems like an obvious choice for RMS add-ins.
Glenn Adams
Tiber Creek Consulting
http://www.tibercreek.com glenn@tibercreek.com
----------------------------------------------
Please DO NOT respond to me directly but post all responses here in the
newsgroup so that all can share the information.
RetailHero(tm) wrote:
> Glen, Vicky:
>
> using VB isn' really "the only way". You can use method invocation in C#,
> like in the following example. But I must agree with you it is rather very
> painful. I hope Microsoft provides .NET wrapper for QSRules.dll soon. If help
> is needed, Retail Hero is certainly ready to volunteer. :-)
>
> public void ShowTransactionEntriesPrices(object session)
> {
> try
> {
> object transaction = session.GetType().InvokeMember("Transaction",
> BindingFlags.GetProperty, null, session, null);
> object transactionEntries =
> transaction.GetType().InvokeMember("Entries", BindingFlags.GetProperty, null,
> transaction, null);
>
> int transactionEntriesCount =
> (int)transactionEntries.GetType().InvokeMember("Count",
> BindingFlags.GetProperty, null, transactionEntries, null);
>
> for (int i = 0; i < transactionEntriesCount; i++)
> {
> object transactionEntry =
> transactionEntries.GetType().InvokeMember("Element",
> BindingFlags.GetProperty, null, transactionEntries, new object[] {i + 1});
>
>
> MessageBox.Show(transactionEntry.GetType().InvokeMember("Price",
> BindingFlags.GetProperty, null, transactionEntry, null).ToString());
> }
> }
> catch(Exception ex)
> {
> MessageBox.Show(ex.Message);
> }
> }
>
>
> "Glenn Adams [MVP - Retail Mgmt]" wrote:
>
>> The only way I was ever able to get a C# add-in to work was to create a
>> vb.net add-in to catch the COM call from the RMS hook then invoke my c#
>> add-in from there. Your problem is really with COM Interop, not
>> specifically with RMS - there is some information on MSDN that should
>> help you get past the strong naming issue, but there are going to be
>> more roadblocks after that. vb.net is much easier to deal with...
>>
>> Glenn Adams
>> Tiber Creek Consulting
>> http://www.tibercreek.com
>> glenn@tibercreek.com
>> ----------------------------------------------
>> Please DO NOT respond to me directly but post all responses here in the
>> newsgroup so that all can share the information.
>>
>>
>> Vicky wrote:
>>> I am using C# .Net to customize the RMS. As RMS is in VB, the customization
>>> guide is not so usefull for me. How should I create my .Net dll ?? I have
>>> added QSResult reference to my project, but as QSResult does not have a
>>> strong name I am not able to create a strong name for my project dll also..
>>>
>>> Can any help me out and tell me the steps to create, deploy and invoke .Net
>>> dll in RMS...
>>>
>>> Waiting for reply... :-(
>>>
>>> Vicky... :-)
|