Barcode Fonts, Components, ActiveX and .NET Windows Forms Controls, Java Servlets, 
DLLs and Barcode Scanners., Inc., Computers Hardware, Software & Services, Tampa, FL View your cart in the IDAutomation Store    

Object Ref not set to Instance of an Object

The "Object Reference not set to an Instance of an Object" error may appear when using VB 6, Visual Studio .NET, VB .NET or C# .NET.


General causes of this error include undeclared or improperly declared controls and variables, therefore, ensure that all variables and controls used in code are properly declared.

This error may also occur in IDAutomation 2D Font and Encoder products if the string parameters in the FontEncode subroutine are not initialized to a string that contains data. For example, setting the DataToEncode string parameter to an empty text box may cause the error because the DataToEncode property cannot be empty.

A workaround is to enable a check to test for the text box being empty and set the DataToEncode string appropriately. For example:
Dim DataToEncode as String
Dim EncodedText as String
EncodedText = ""
If TextToEncode.Text = "" Then
        DataToEncode = ""
        DataToEncode = TextToEncode.Text
End If
QRFontEncoder.FontEncode DataToEncode, 0, 0, 0, 0, EncodedText

Related Documents:
 ©Copyright 2018, All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us

Training Videos on YouTube  Join us on Google Plus  Join us on LinkedIn  Follow us on Twitter  Like us on Facebook
Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses.