skymax406
Messages postés215Date d'inscriptionsamedi 19 juillet 2008StatutMembreDernière intervention22 avril 2015
-
12 déc. 2013 à 10:19
Bonjour,
Alors voila je voudrais coder une imprimante à ticket epson qui utilise la librairie OPOS.
A savoir que le c++ j'ai des notions du BTS mais moi je suis développeur WEB donc c'est plutot flou :D
Donc en fouillant dans OPOS j'ai pu trouver un logiciel (avec les sources) qui dialogue avec l'imprimante. ( Logiciel de démo plus qu'autre chose mais largement suffisant )
Donc mon but est de recréer un logiciel pour l'instant basique quand je clique sur un bouton il me connecte à l'imprimante et me dit si ça a réussis ou pas, rien de bien compliqué ( à priori )
Mon probléme est que je n'arrive pas a extraire le bout de code qu'il me faut j'ai jamais les bonnes dépendances.
SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here BOOL bError = FALSE; long lRetryCount = 0; long pData; long pData2; CString cString; BSTR pString;
while( 1 ) { //Open the device //Use a Logical Device Name which has been set on the SetupPOS. m_Ptr1.Open("TM-H6000IIP"); //Check whether the device is succeed to open, or not if( m_Ptr1.GetResultCode() != OPOS_SUCCESS ) { MessageBox("This device has not been registered, or cannot use."); bError = TRUE; break; }
//Get the exclusive control right for the opened device. //Then the device is disable from other application. //(Notice:When using an old CO, use the Claim.) m_Ptr1.ClaimDevice( 1000 ); if( m_Ptr1.GetResultCode() != OPOS_SUCCESS ) { MessageBox("Fails to get the exclusive right for the device."); bError = TRUE; break; }
//Enable the device. //Je vous épargne la suite du code :D }
Moi ce qui m'interesse pour l'instant c'est ça :
//Open the device //Use a Logical Device Name which has been set on the SetupPOS. m_Ptr1.Open("TM-H6000IIP"); //Check whether the device is succeed to open, or not if( m_Ptr1.GetResultCode() != OPOS_SUCCESS ) { MessageBox("This device has not been registered, or cannot use."); bError = TRUE; break; }
//Get the exclusive control right for the opened device. //Then the device is disable from other application. //(Notice:When using an old CO, use the Claim.) m_Ptr1.ClaimDevice( 1000 ); if( m_Ptr1.GetResultCode() != OPOS_SUCCESS ) { MessageBox("Fails to get the exclusive right for the device."); bError = TRUE; break; }