|
-
Dec 22nd, 2006, 08:49 AM
#1
Thread Starter
New Member
Subscript Out Of Range
I receive a Subscript Out Of Range error when calling a 3rd party COM module. I recieve the error on the highlighted line below.
Option Explicit
Dim FiscalEpson As EpsonFiscal
Dim result As Long
Private Sub Command1_Click()
Dim result As Long
Dim result2 As Variant
Dim port As Long
Dim file As String
Dim file2 As String
Dim FiscalEpson As EpsonFiscal
file = "c:\fiscal.txt"
file2 = ""
port = 1
Set FiscalEpson = New EpsonFiscal
result = FiscalEpson.OpenFiscalPort(port)
result = FiscalEpson.PrintData(file, file2)
result = FiscalEpson.PrintNonFiscalData(file)
result2 = FiscalEpson.GetVersion()
Set FiscalEpson = Nothing
End Sub
I use the same module in Visual C++ without any errors.
Here is a snippet from the .tlh file that was generated from my C++ compile:
struct __declspec(uuid("0a540171-7ece-403e-a354-7effd812a4eb"))
_EpsonFiscal : IDispatch
{
//
// Wrapper methods for error-handling
//
long OpenFiscalPort (
long portNumber );
long PrintData (
_bstr_t fileToPrint,
_bstr_t fileCMRToPrint );
long ResumePrinting ( );
long GetLastError (
BSTR * bufferOut );
long PrintNonFiscalData (
_bstr_t fileToPrint );
_bstr_t GetVersion ( );
//
// Raw methods provided by interface
//
When calling the PrintNonFiscalData function I don't receive any errors.
Any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|