Attribute VB_Name = "IDAutomationOneCodeDLLVBA"
'*********************************************************************
'*  VBA Functions for IDAutomation Native Windows DLL 6.09
'*  Copyright, IDAutomation.com, Inc. 2006. All rights reserved.
'*
'*  Visit www.idautomation.com/fonts/tools/windows_dll/
'*  for more information about the functions in this file.
'*
'*  You may incorporate our Source Code in your application
'*  only if you own a valid license from IDAutomation.com, Inc.
'*  for the associated font and this text and the copyright notices
'*  are not removed from the source code.
'*
'*  Distributing our source code or fonts outside your
'*  organization requires a Developer License.
'*********************************************************************

Public Declare Function IDAutomation_Universal_OneCode _
      Lib "IDAutomationNativeFontEncoder.dll" _
                     (ByVal D2E As String, _
                     ByVal out As String, _
                     ByRef iSize As Long) As Long
                     
Dim ShowError As Boolean

Public Function IDAutomation_Uni_OneCode(DataToEncode As String) As String
    On Error GoTo ErrorHandler
    Dim myOut As String
    Dim iSize As Long
    Dim lRetVal As Long
    ShowError = True
    myOut = String(512, " ")
    lRetVal = IDAutomation_Universal_OneCode(DataToEncode, myOut, iSize)
    IDAutomation_Uni_OneCode = myOut
    Exit Function
ErrorHandler:
    If ShowError Then
        MsgBox "Error in Universal OneCode " + Err.Description, vbOKOnly, "Error in VBA"
    End If
    Resume Next
End Function

