 |
|
 |
thanks a lot! really helpful!
|
|
|
|
 |
|
 |
hi... does anyone have an idea haw i could use this to change my default sound device for instance...
i would like to be able to do it on runtime... just as if i went into control panel and actually used the gui to do this...
btw i'm working on win7 dont know if it makes any difference
|
|
|
|
 |
|
 |
Hi,
I'm trying to use OPOS Controls (Line Display) in mfc application.
This ocx control inherits from CWnd class. And that is the problem!!!
When I create control by ::CoCreateInstance and Create functions, I must call function with parameter (HWND to parent window), otherwise I have assertion message in DEBUG mode.
When main window inherit from CDialog everything is OK.
But, I'm using CFrameWnd, and this class sends messages to own children.
I have an assertion message in DEBUG mode.
So I trying to resolve this problem by creating in my main window, dummy window based on CDialog.
I use this dummy window only as a parent window for OPOS control.
And it works, but not on every computers.
I don't know why?
Maybe it depends on installed Framework version or OPOS version ?
Maybe I should call some other methods ?
This is a part of my code:
long T2X20OPOSDisplay::open()
{
m_pDummyWnd = new CDialog;
if (m_pDummyWnd == NULL)
return uxFAIL(1);
m_pDummyWnd->Create(IDD_OPOSDUMMY);
if (hRes == 0)
return uxFAIL(1);
hRes = ::CoCreateInstance(CLSID_LINE_DISPLAY,
NULL,
CLSCTX_ALL,
IID_LINE_DISPLAY,
(void**)&m_pLineDisplay
);
if (hRes != uxSUCCESS)
return uxFAIL(1);
hRes = m_pLineDisplay->Create(NULL,
WS_DISABLED,
CRect(0,0,0,0),
(CWnd *)m_pDummyWnd,
1234
);
if (hRes == 0)
return uxFAIL(1);
hRes = m_pLineDisplay->Open(deviceName());
if (hRes != uxSUCCESS)
return uxFAIL(1);
hRes = pLineDisplay->ClaimDevice(3000);
if (hRes == uxSUCCESS)
return uxFAIL(1);
pLineDisplay->SetDeviceEnabled(TRUE);
hRes = pLineDisplay->GetResultCode();
if (hRes == uxSUCCESS)
return uxFAIL(1);
pLineDisplay->SetCharacterSet(852);
hRes = pLineDisplay->GetResultCode();
if (hRes == uxSUCCESS)
return uxFAIL(1);
return uxSUCCESS;
}
Thanks for help.
Best regards,
Robert
|
|
|
|
 |
|
 |
Hi!
robercik713 wrote: I'm trying to use OPOS Controls (Line Display) in mfc application.
This ocx control inherits from CWnd class. And that is the problem!!!
When I create control by ::CoCreateInstance and Create functions, I must call function with parameter (HWND to parent window), otherwise I have assertion message in DEBUG mode.
When main window inherit from CDialog everything is OK.
But, I'm using CFrameWnd, and this class sends messages to own children.
I have an assertion message in DEBUG mode.
So I trying to resolve this problem by creating in my main window, dummy window based on CDialog.
I use this dummy window only as a parent window for OPOS control.
And it works, but not on every computers.
I don't know why?
Maybe it depends on installed Framework version or OPOS version ?
Maybe I should call some other methods ?
In my opinion no need to use dialogs and windows at all.
For example, C++ Builder:
ITDigiSM *pDigi=NULL;
CoInitialize(NULL);
HRESULT res=::CoCreateInstance(
CLSID_TDigiSM, NULL, CLSCTX_INPROC_SERVER, IID_ITDigiSM, (void**)&pDigi );
Now interface pointer (pDigi) is ready to use...
Visual Basic .NET (CreateObject via ProgId):
Public FiscalPrinter As Object
Dim ResultCode As Integer
FiscalPrinter = CreateObject("OPOS.FiscalPrinter")
ResultCode = FiscalPrinter.Open("FiscPrinter")
TextBox1.Text = FiscalPrinter.ResultCode
If FiscalPrinter.ResultCode = 114 Then TextBox2.Text = FiscalPrinter.ResultCodeExtended Else TextBox2.Text = ""
TextBox3.Text = FiscalPrinter.ErrorString
TextBox4.Text = FiscalPrinter.ControlObjectVersion
TextBox5.Text = FiscalPrinter.ServiceObjectVersion
TextBox6.Text = FiscalPrinter.DeviceDescription
....
FiscalPrinter.Claim(20)
FiscalPrinter.DeviceEnabled = True
deRes = FiscalPrinter.DeviceEnabled
TextBox1.Text = FiscalPrinter.ResultCode
If FiscalPrinter.ResultCode = 114 Then TextBox2.Text = FiscalPrinter.ResultCodeExtended Else TextBox2.Text = ""
TextBox3.Text = FiscalPrinter.ErrorString
|
|
|
|
 |
|
 |
Hi Vladimir,
I read that you developed a OPOS driver for for Ukrainian fiscal printers. I trying to develop a OPOS driver for Brasilian Fiscal Printers.
I think the fiscal commands shoud be realy differents, but I think your structure could be used.
I do not have much experience whith OPOS. Do you think that your code can help me to do that.
If it do, you be interesting in selling your code?
Thanks,
Fabio
|
|
|
|
 |
|
 |
Hi Fabio,
Fabio Campos wrote: I read that you developed a OPOS driver for for Ukrainian fiscal printers.
Yes, it's true.
Fabio Campos wrote: I trying to develop a OPOS driver for Brasilian Fiscal Printers.
I think the fiscal commands shoud be realy differents, but I think your structure could be used.
I do not have much experience whith OPOS. Do you think that your code can help me to do that.
If it do, you be interesting in selling your code?
I can't show my code. I can't sell it.
I am really author some OPOS service objects for ukrainian Fiscal printers.
But in compliance with Ukrainian Laws these objects belong the company where I work.
Only idea to write some article here in codeproject about this matter, structure of OPOS objects, some samples etc.
But I am not sure that can do it quickly enough but I'll try.
|
|
|
|
 |
|
 |
Hi Vladimir,
How can I get the port number of a modem, which is pluged in to an USB port?
Lets say, If I have 2 modem I need an information like;
COM2 -> Modem ABCDEF 2
COM6 -> Modem XYZ v2.0
How can I get which modem is associated to which port?
Thanks,
Serkan
|
|
|
|
 |
|
 |
Hi,
first of all, I am a newbie in OPOS.
I am trying to write Service Object for a TFT display, so that it has a window simulating 2x20 Line Display.
The window is actually a windows app, that receives the messages that SO sends to it through a socket. SO naturally gets its messages from app through CO.
We have to use OPOS , so for example POS for .NET is not applicable.
Now for the question:
When trying to use the SO through the MonroeCS CO control
(OPOSLineDisplay.ocx, version OposCCOs-1_11_001),
Open gives code 104 (=OPOS_E_NOSERVICE), and
get_OpenResult() gives code 305 (=OPOS_OR_BADIF).
What these return codes really means ?
In Control Programmer's Guide
(OLE for Retail POS, Release 1.6)
this is said about the aforementioned return codes (in page 18, item 5):
CLIP -->
... (This ensures that the Service Object supports at least the
minimum methods of a valid Service Object for the device class, before
calling any of its methods.)
CLIP <--
What am I doing wrong, why I cannot reach the Service Object through CO?
|
|
|
|
 |
|
 |
hi
many thanks for your nice articles...
is it a way to disabling the device only while windows (OS) is runing ?
so that, after restarting the computer, naturally device is restored to enable.
(changes do not save in registry)
is it possible do you think ?!
thanks.
H.R
|
|
|
|
 |
|
 |
Hi Vladimir,
I visit most of on-line discuss and search for a people who are experience in deal with standard OPOS SO, and you are the only available qualified OPOS engineer so far I find. So, could you provide me some SO sample code that can simulate the communication between printers and APs. That will help me to understand the architecture of a service object working.
Thanks a lot, wish you have a nice day.
Wallence Hsu
Software Engineer
|
|
|
|
 |
|
 |
Ukrainian OPOS SO driver it's a little other thing than "commonly known" OPOS SO driver. We have a lot restrictions and we have even special Fiscal Low so my sample can help you if you will do OPOS for Ukraine. But I can give URL where you find a lot info about OPOS. Give me know if you need in it.
Best regards!
With best wishes.
Vladimir aka Macavity.
|
|
|
|
 |
|
 |
Thanks for your reply.
May I have any sample code or resource from you?
By the way, I think I already have most of reference from WWW, but unfortunately, that is not enough for me to understand the whole OPOS architecture on programming.
If you have any suggestion, or sample code (That will be better), please just provide me, Thanks in advance.
|
|
|
|
 |
|
|
 |
|
 |
I would like to have a sample code for the service object for a signature capture device. I would also want to know the working of the OPOS driver.
|
|
|
|
 |
|
 |
I found your class very useful but i wonder how can we get more details about the devices, for example, it can show the list of USB printers but how do you determine the port number it is plugged on??
thanks.
|
|
|
|
 |
|
 |
Hi.
I think you need to call DeviceCapabilities, GetDeviceCaps and another Win32 API function, you also can use WMI for it.
Best Regards.
|
|
|
|
 |
|
 |
How would you go about disabling hardware and re-enabling it?
You'll have to excuse the bluntness of this question but my research has only got me as far as cfgmgr32.dll
Thanks
|
|
|
|
 |
|
 |
Very helpful articals on Enumeration and Device Managment.
Thanks.
Dizzzzy
|
|
|
|
 |
|
 |
Hi,
I am new to this Message Board and also new to write the Service Object,
Where i am working in POS Application development using POS for .NET. I need to develop the Service Objects for the devices. Please can any one help me how to write the Service Object using POS for .NET. If you are not worked using POS for .NET so please provide the code in other language also.
I will apriciate providing code for Service Object.
Thanks in Advance.
K.Srinivas
Software Developer
|
|
|
|
 |
|
 |
May be you need to read UnifiedPOS standard first off all.
|
|
|
|
 |
|
 |
Thanks for reply.
already i read the UnifiedPOS standards.
and also i gone through the Microsoft provided code for Service Object but not much covered in that.
Please can you provide the code how to write the Service Objects so that it may very useful to me.
K.Srinivas
|
|
|
|
 |
|
 |
Sorry but I never created Service Objects for MS .NET, only for
OPOS.
Vladimir.
|
|
|
|
 |
|
 |
Thank you for reply,
No problem.
Please provide the code in OPOS,so that i can understand the architecture how to write the Service Object.
Regards & Thanks,
K.Srinivas.
|
|
|
|
 |
|
 |
Hello,
I now try to develop a driver to watch packet that walk through the network interface. But i need some suggestion of :
1. Reference to create a windows driver.
2. I want to know how to make my driver work in kernel mode.
3. I want to know how to make my driver recognize by windows and start when windows start.
Thats all for now, sorry to much question. Now i start develop a firewall that work on kernel mode and use driver file.
Thanks.
Newbie in windows firewall and system architecture.
|
|
|
|
 |
|
 |
Hi friend.
Sorry, I never developed Windows drivers.
But I saw a lot articles about it in codeproject.
Put string "Driver" in Search box of codeproject main page and
you find these articles.
Best Regards.
Vladimir.
|
|
|
|
 |