J
James Radke
Hello,
I have a C++ DLL that is supplied by an ERP vendor (MAX Software), that provides API's to be used to update their BTRIEVE database from an external application.
I have the C++ DLL working fine from a VB.NET windows application. However, when I cut and paste the same code into a WEBFORM application, the entire application freezes when I try to reference my first function from the DLL; and I don't get any error generated which is telling me what the problem is.
The code for my class has been included below. The lines in RED show the function that is causing the application to freeze, as well as the place in the ADD method from where it is being called.
Can anyone help me out and tell me why this web application is freezing? What security will I need on the BTRIEVE data directory to allow the web application to access it?
Thanks!
Jim
================================ class object ============================================================================
Imports System.Data
Imports System.Data.Odbc
Imports System.Data.SqlClient
Imports System.Math
Imports System.Runtime.InteropServices
Imports System.Text
Public Class SalesOrderMasterClass
' Max startup and shutdown functions
Declare Function InitMAXOrder Lib "MAXORDR2.DLL" (ByRef DataPath As StringBuilder, ByRef MAXPath As StringBuilder) As Int32
Declare Function ShutdownMAXOrder Lib "MAXORDR2.DLL" (ByVal ObjectHandle As Integer) As Short
' Sales Order Functions
Declare Function AddSalesOrder Lib "MAXORDR2.DLL" (ByVal OH As Integer, ByRef Soemst As SOEMstItem) As Short
Public Function Add(ByVal ADDR1 As String, ByVal ADDR2 As String, ByVal City As String, ByVal Contact As String, ByVal Country As String, ByVal CUSTID As String, ByVal CustomerName As String, ByVal CUSTPO As String, ByVal FOB As String, ByVal GLXREF As String, ByVal OrderDate As Date, ByVal OrderedBy As String, ByVal PHONE As String, ByVal REP1 As String, ByVal SHPCDE As String, ByVal SHPVIA As String, ByVal State As String, ByVal SType As String, ByVal TAXCD1 As String, ByVal TAXCD2 As String, ByVal TAXCD3 As String, ByVal Terms As String, ByVal ZIPCD As String) As String
'Intialize MAX Update Order & Transaction DLLs
Dim datapath As New StringBuilder("")
Dim apppath As New StringBuilder("")
Dim OH_Order32 As Integer = InitMAXOrder(datapath, apppath)
... a bunch of code goes here that was removed for space in this message....
' Shutdown max
Dim iRet As Integer
iRet = ShutdownMAXOrder(OH_Order32)
' Return the sales order number
Return RetOrder
End Function
End Class
I have a C++ DLL that is supplied by an ERP vendor (MAX Software), that provides API's to be used to update their BTRIEVE database from an external application.
I have the C++ DLL working fine from a VB.NET windows application. However, when I cut and paste the same code into a WEBFORM application, the entire application freezes when I try to reference my first function from the DLL; and I don't get any error generated which is telling me what the problem is.
The code for my class has been included below. The lines in RED show the function that is causing the application to freeze, as well as the place in the ADD method from where it is being called.
Can anyone help me out and tell me why this web application is freezing? What security will I need on the BTRIEVE data directory to allow the web application to access it?
Thanks!
Jim
================================ class object ============================================================================
Imports System.Data
Imports System.Data.Odbc
Imports System.Data.SqlClient
Imports System.Math
Imports System.Runtime.InteropServices
Imports System.Text
Public Class SalesOrderMasterClass
' Max startup and shutdown functions
Declare Function InitMAXOrder Lib "MAXORDR2.DLL" (ByRef DataPath As StringBuilder, ByRef MAXPath As StringBuilder) As Int32
Declare Function ShutdownMAXOrder Lib "MAXORDR2.DLL" (ByVal ObjectHandle As Integer) As Short
' Sales Order Functions
Declare Function AddSalesOrder Lib "MAXORDR2.DLL" (ByVal OH As Integer, ByRef Soemst As SOEMstItem) As Short
Public Function Add(ByVal ADDR1 As String, ByVal ADDR2 As String, ByVal City As String, ByVal Contact As String, ByVal Country As String, ByVal CUSTID As String, ByVal CustomerName As String, ByVal CUSTPO As String, ByVal FOB As String, ByVal GLXREF As String, ByVal OrderDate As Date, ByVal OrderedBy As String, ByVal PHONE As String, ByVal REP1 As String, ByVal SHPCDE As String, ByVal SHPVIA As String, ByVal State As String, ByVal SType As String, ByVal TAXCD1 As String, ByVal TAXCD2 As String, ByVal TAXCD3 As String, ByVal Terms As String, ByVal ZIPCD As String) As String
'Intialize MAX Update Order & Transaction DLLs
Dim datapath As New StringBuilder("")
Dim apppath As New StringBuilder("")
Dim OH_Order32 As Integer = InitMAXOrder(datapath, apppath)
... a bunch of code goes here that was removed for space in this message....
' Shutdown max
Dim iRet As Integer
iRet = ShutdownMAXOrder(OH_Order32)
' Return the sales order number
Return RetOrder
End Function
End Class