I'm looking to build an OPOS Service Object (SO) virtual printer for a POS application to capture shopping receipts. If somebody could advise steps for how to create the Service Object would be greatly appreciated.
Overall, the amount of information needed to answer this is so great that it is difficult to answer shortly.
Therefore, here are mainly links to relevant information.
Please use these as a reference to learn and work.
I have a device-independent and simple introduction description on my GitHub.
kunif/OposInternals
Other than that, it's neither C# nor POSPrinter, but there is a skeleton of MSR SO by ATL of VC++ on GitHub.
RichardChambers/atl_msr_so
Here are the attributes used in relation.
ComVisibleAttribute Class
GuidAttribute Class
InterfaceTypeAttribute Class
ComRegisterFunctionAttribute Class
ComUnregisterFunctionAttribute Class
This is the table of contents of the commentary article including the mechanism behind it.
Interoperability (C# Programming Guide)
Advanced COM Interoperability
Added in response to comments:
- Device common property: OPOS_Internals.PIDX_pppp (property name in pppp)
- Device specific property: OPOSxxxxInternals.PIDXyyyy_pppp (OPOS device class name in xxxx, abbreviation for device class name in yyyy, property name in pppp)
For the VirtualPrinter and not PhysicalPrinter what functions defined in that class should be implemented as essential?
In the case of we are only handling print commands of the virtual printer.
Does this sentence which you write "save a pointer to the CO's IDispatch .... event notification" means saving "pDispatch" into this class?
- In the implementation of the OpenService method, save a pointer to the CO's IDispatch object passed as a parameter by preparing a dynamic type variable and use it for event notification.