AttachAddIn() problem

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 6, 2018
Company: Bodega LLC

Hello!

I have another question. I have two usb rfid-card reader which are working as a keyboard. I want to know wich reader sends codes of card. I found such kind of program pice but it did not work...

//Компонента AddHook.dll служит для перехвата событий клавиатуры.
//Подключение внешней компоненты AddHook.dll должно находиться в процедуре "ПриНачалеРаботыСистемы" или "ПриОткрытии".
//Переменную "GlobalReg" нужно объявить в глобальном модуле (Перем GlobalReg Экспорт;).
Процедура ПриНачалеРаботыСистемы()
   ЗагрузитьВнешнююКомпоненту("AddHook.dll");
   GlobalReg = Новый("AddIn.AddHookExtension");
   GlobalReg.HookEnabled = 1;    // Включаем Hook
КонецПроцедуры


//В процедуре "ПередЗавершениемРаботыСистемы" необходимо отключить внешнюю компоненту AddHook.dll
Процедура ПередЗавершениемРаботыСистемы(Отказ)
   GlobalReg.HookEnabled = 0;
   GlobalReg = 0;
КонецПроцедуры


//Обработка событий клавиатуры должна находиться в процедуре "ВнешнееСобытие(Источник, Событие, Данные)"
Процедура ВнешнееСобытие(Источник, Событие, Данные)
   Если Данные = "00038" Тогда
       Сообщить("Нажата кнопка Стрелка вверх");
   КонецЕсли;
КонецПроцедуры

Note: "ExternalEvent" can use for such kind of situations?

 
#2
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 6, 2018
Company: Bodega LLC

Or is there any way to understand entering data is coming from barcode-reader or keyboard?

 
#3
People who like this:0Yes/0No
Interested
Rating: 16
Joined: Dec 4, 2017
Company:

Dear eyup yilmaz!

When you have several devices working in keyboard mode, in general there is no way to distinguish the output of one device from that of another device. It all comes from keyboard.

You can use a trick: add a particular prefix to the output of a particular device. Say, the "#" prefix for your RFID reader, and the "*" prefix for your barcode scanner. As a result, you will be able to see what comes from which device.

Best regards,
Vladimir Gurov

1C Company support team
 
#4
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 6, 2018
Company: Bodega LLC

Hello Vladimir Gurov!

Thanks for your attention about my problems:) That is a good idea using prefix,but these devices are prepared in factory and i am not planing to prepare my own one. Is it possible to reach network datas, for example if i connect a device which have ethernet interface?

 
#5
People who like this:0Yes/0No
Interested
Rating: 16
Joined: Dec 4, 2017
Company:

Dear eyup yilmaz,

By using prefixes (if you can add a prefix for a device), you can at least test the devices and distinguish their output in your code. Then your can remove the prefixes.

As for access to device data. Whether it is possible or not, it depends on the device capabilities. Please refer to the device specification.

Best regards,
Vladimir Gurov

1C Company support team
 
#6
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 6, 2018
Company: Bodega LLC

Well system must work according to device, i mean that system must sel ect input datas according to device, for example i don't want to give permission to enter data fr om keyboard on textbox. with prefix it is going to work, but i cannot put any prefix on device. I can add prefix to devices on another electronic card which is going to work ethernet port....

Actually i just need an event which will active with external events. I have seen external event procedure, i try to find understandable examples,but all of them in Russian language. Even that i translate to english with 1C configuration syntax language. But i couldn't be successful. Well is there any simple example to start to understand what it is?

Thank you very much for your kindly helps!!! I m very thankful that i m not alone... :)

 
#7
People who like this:0Yes/0No
Interested
Rating: 16
Joined: Dec 4, 2017
Company:

Dear eyup yilmaz,

First of all you should ensure that in your managed form's properties you have the event handler specified for the event called "ExternalEvent".

Best regards,
Vladimir Gurov

1C Company support team
 
#8
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 6, 2018
Company: Bodega LLC

Here i have send "dt" file, I couldn't work it :(

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.