Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,

Currently i am working OPOS device application.Here i have to create a single application that will install the necessary driver and add device information in the registry .I wanted to know how to register device in the registry under given directory.
Suppose i want to register MSR(magnetic Script Reader) to registry with following specification.

[HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail\ServiceOPOS\MSR\MSR210D]
@="OPOS.MSR.213USO.1"
"Description"="Uniform MSR213U OPOS Service Object. (213OPS)"
"MSRKeyboardHookFlag"=dword:00000001
"MSRType"="ISO 1/2/3 + JIS"
"Service"="MSR213USO.dll"
"Version"="1.12.1"
"WaitTime"=dword:00000064

[HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail\ServiceOPOS\MSR\MSR213U]
@="OPOS.MSR.213USO.1"
"WaitTime"=dword:00000064
"Description"="Uniform MSR213U OPOS Service Object. (213OPS)"
"Service"="MSR213USO.dll"
"Version"="1.12.1"
"MSRType"="ISO 1/2/3 + JIS"
"MSRKeyboardHookFlag"=dword:00000001

How will i do it ,Please help me.


Thanks in advance.
Posted

Please do not change the configuration settings for OPOS Linedisplay.
Use the following code in your usercontrol where you have hosted your opos control and check that your device is running or not.

C#
<pre>
 ret =  OPOSLineDisplay.Open("FTLDSO");
 ret =  OPOSLineDisplay.ClaimDevice(100);
    OPOSLineDisplay.DeviceEnabled = true;
        OPOSLineDisplay.CharacterSet = 3;
        OPOSLineDisplay.ClearText();
        OPOSLineDisplay.DisplayTextAt(0, 0, &quot;Line Display Test&quot;, 0);
    OPOSLineDisplay.DisplayTextAt(1, 0, &quot;Line Display Working&quot;, 0);
    OPOSLineDisplay.ReleaseDevice();
        OPOSLineDisplay.Close();

Do let me know if you find any error and please mark it as answer if it is valid answer to your requirements.
 
Share this answer
 
For 32 bit application Copy OPOSMSR.ocx to
> C:\Windows\System32
> Run the following in cmd
->regsvr32 /s c:\windows\System32\OPOSMSR.ocx
-------------------------------------------------------------------------------
For 64 bit application Copy OPOSMSR.ocx to
> C:\Windows\SysWOW64
> Run the following in cmd
->regsvr32 /s c:\windows\SysWOW64\OPOSMSR.ocx

Once this is done
Add a new user control in your windows application. Go to designer page and open Toolbox window.
In the toolbox window -> right click and Select 'Choose Items' -> Select Com Components tab and find OPOS MSR control registered.Select it and click on OK.
Put this OPOS MSR control on your User control. Your control is hosted and you can use it.
To explore all the methods in this components, go to code behind, Navigate to 'InitializeComponent' method. At the last line you will find instance of your hosted control. Go to Defination 'AxOPOSMSR' you will find all methods.

-----------------------------------------------------------------------------
To find the name your OPOSMSR control you can navigate regedit.exe from run command and
Local_Machine ->Software -> OLE For Retail you may find your MSR control.
 
Share this answer
 
Comments
pranav8265 24-Jun-15 1:37am    
Thanks its really helpful.i was able to register the device, now how to read from the registry and fetch the device configurations to modify it.For example I want to change the com port number of the line display from com6 to com3

[HKEY_LOCAL_MACHINE\SOFTWARE\OLEForRetail\ServiceOPOS\LineDisplay\FTLDSO]
"StopBit"="1"
"COMPORT"="COM6"
"Parity"="NONE"
"DataLength"="8"
"Baud"="9600"
@="OPOS.FTLDSO"

How it can be done using c# programming?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900