| |
   
Morovia.com Home | Fonts | Components | Labeling | Library | Order | Forum
  Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Barcode ActiveX Control
 Community Forum : Barcode ActiveX Control
Subject Topic: Error control Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
alopez
Newbie
Newbie


Joined: June 16 2006
Location: Spain
Posts: 1
Posted: June 16 2006 at 9:52am | IP Logged Quote alopez

I need to control errors in a VB6 application to deliver my own errors to the user and avoid barcode activex error display and, specially, the unexpected end of my application.

It is specially important when changing symbology, as the message is changed to the symbology default message (btw, something not documented, it took me some time to realize), and I need to change it back to the original message, or, if that is not possible, display a warning message and undo the symbology change.

I couldn´t find any way to trap the error, and the VB6 sample doesn´t help.

Here is my code:

Private Sub Combo1_click()
Dim simbologiaactual As Integer
Dim mensajeactual As String

On Error GoTo errorsimbologia

simbologiaactual = MrvBarcode1.Symbology
mensajeactual = MrvBarcode1.message

Select Case Combo1.ListIndex
Case 0: MrvBarcode1.Symbology = mbxCode39
Case 1: MrvBarcode1.Symbology = mbxCode39_Full_ASCII
Case 2: MrvBarcode1.Symbology = mbxCode39_HIBC
Case 3: MrvBarcode1.Symbology = mbxCodaBar
Case 4: MrvBarcode1.Symbology = mbxCode93
Case 5: MrvBarcode1.Symbology = mbxCode128
Case 6: MrvBarcode1.Symbology = mbxUCC_EAN_128
Case 7: MrvBarcode1.Symbology = mbxInterleaved_2of5
Case 8: MrvBarcode1.Symbology = mbxUPC_A
Case 9: MrvBarcode1.Symbology = mbxUPC_E
Case 10: MrvBarcode1.Symbology = mbxEAN_13
Case 11: MrvBarcode1.Symbology = mbxEAN_8
Case 12: MrvBarcode1.Symbology = mbxBookland
Case 13: MrvBarcode1.Symbology = mbxTelepen
Case 14: MrvBarcode1.Symbology = mbxTelepenNumeric
Case 15: MrvBarcode1.Symbology = mbxPostnet
Case 16: MrvBarcode1.Symbology = mbxPlanet
Case 17: MrvBarcode1.Symbology = mbxRoyalMail
Case 18: MrvBarcode1.Symbology = mbxMSI_Plessey
Case 19: MrvBarcode1.Symbology = mbxCode25
Case 20: MrvBarcode1.Symbology = mbxCode11
Case 21: MrvBarcode1.Symbology = mbxPDF417
Case 22: MrvBarcode1.Symbology = mbxDataMatrix
Case 23: MrvBarcode1.Symbology = mbxMaxiCode
End Select

MrvBarcode1.message = lineatexto2

simbologia = MrvBarcode1.Symbology
grabarcambios = True

Exit Sub

errorsimbologia:
    MsgBox ("Tipo de código de barras incorrecto para el texto introducido")
    MrvBarcode1.Symbology = simbologiaactual
    MrvBarcode1.message = mensajeactual
    
End Sub


The "On Error GoTo errorsimbologia" instruction is not trapping the error, when the instruction "MrvBarcode1.message = lineatexto2" gets processed a run time error from the activeX control is displayed and the application has to end.

I would appreciate any help. Thanks in advance
Antonio López

PS. I checked the new DLL component, and it seems that the return execution code would allow to trap the error but I already buyed the ActiveX control severals month ago

Back to Top View alopez's Profile Search for other posts by alopez
 
glitch
Admin Group
Admin Group
Avatar

Joined: January 25 2003
Location: Canada
Posts: 280
Posted: June 16 2006 at 1:06pm | IP Logged Quote glitch

Try the code below. It worked on my machine -

Private Sub Combo_Symbology_Click()

'save the symbology

Dim barcode_format_save As SymbologyEnum

barcode_format_save = MrvBarcode1.Symbology

 

Select Case Combo_Symbology.ListIndex

Case 0: MrvBarcode1.Symbology = mbxCode39

Case 1: MrvBarcode1.Symbology = mbxCode39_Full_ASCII

Case 2: MrvBarcode1.Symbology = mbxCode39_HIBC

Case 3: MrvBarcode1.Symbology = mbxCodaBar

Case 4: MrvBarcode1.Symbology = mbxCode93

Case 5: MrvBarcode1.Symbology = mbxCode128

Case 6: MrvBarcode1.Symbology = mbxUCC_EAN_128

Case 7: MrvBarcode1.Symbology = mbxInterleaved_2of5

Case 8: MrvBarcode1.Symbology = mbxUPC_A

Case 9: MrvBarcode1.Symbology = mbxUPC_E

Case 10: MrvBarcode1.Symbology = mbxEAN_13

Case 11: MrvBarcode1.Symbology = mbxEAN_8

Case 12: MrvBarcode1.Symbology = mbxBookland

Case 13: MrvBarcode1.Symbology = mbxTelepen

Case 14: MrvBarcode1.Symbology = mbxTelepenNumeric

Case 15: MrvBarcode1.Symbology = mbxPostnet

Case 16: MrvBarcode1.Symbology = mbxPlanet

Case 17: MrvBarcode1.Symbology = mbxRoyalMail

Case 18: MrvBarcode1.Symbology = mbxMSI_Plessey

Case 19: MrvBarcode1.Symbology = mbxCode25

Case 20: MrvBarcode1.Symbology = mbxCode11

Case 21: MrvBarcode1.Symbology = mbxPDF417

Case 22: MrvBarcode1.Symbology = mbxDataMatrix

Case 23: MrvBarcode1.Symbology = mbxMaxiCode

End Select

 

'save the text

Dim strMsgSave As String

strMsgSave = Text_Message.Text

 

On Error GoTo Reset_symbology

MrvBarcode1.message = strMsgSave

Exit Sub

   

Reset_symbology:

MsgBox "Can not encode the text with selected symbology"

MrvBarcode1.Symbology = barcode_format_save

MrvBarcode1.message = strMsgSave

End Sub

Back to Top View glitch's Profile Search for other posts by glitch Visit glitch's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.3750 seconds.