Wiki Home

VFP 7 dot Netcom Error


Namespace: WIN_COM_API
I have a problem and I'm hoping someone can help.
I wrote a dll in VFP7SP1 for a client to post into his clients (vfp6) accounts system.
This was written for consumption in VB.NET and worked perfectly.
Recently the accounts system was updated to SQL server and I was asked to update the dll.
This I did by removing anything to do with USE x IN 0 etc and using a class I had developed which wraps around calls to SQL Pass Through functions.
The dll works perfectly in VFP7 and in the development environment of VB.NET.
However when I build my .NET project and run my exe I encounter an error upon closing the form as follows :

The instruction at "0x7c901010" referenced memory at "0x00000014". The memory could not be "read".
Click on OK to terminate the program.

The database is updated correctly and everything else seems to be in order.

If I comment out the line : result = poster.PostDelivery("Z", "DelHdr.csv", "DelLine.csv") below the error does not occur.


Any ideas would be gratefully recieved.

Brian,
Ireland.


The VB.NET code is as follows :

Dim poster As Object
Dim result As String

poster = Create Object("postdel2.PostDelSQL")

result = poster.PostDelivery("Z", "DelHdr.csv", "DelLine.csv")

If result = "" Then
MsgBox("Delivery docket posted (" & Trim(poster.LastDelivery) & ").", MsgBoxStyle.Information)
Else
MsgBox("Failed to post delivery docket." & vbCrLf & result, MsgBoxStyle.Critical)
End If

poster = Nothing



I've defined my class in VFP7 as follows :

DEFINE CLASS PostDelSQL AS Session OLEPUBLIC

FUNCTION Init

*** Make all required environment settings here
SET RESOURCE OFF && Best to compile into a CONFIG.FPW
SET EXCLUSIVE OFF
SET REPROCESS TO 2 SECONDS
SET CPDIALOG OFF
SET DELETED ON
SET EXACT OFF
SET SAFETY OFF
SET DATE DMY

DECLARE INTEGER Get Windows DirectoryOffsite link to http://www.news2news.com/vfp/?function=6
IN kernel32 STRING @lcBuffer, INTEGER nSize
DECLARE INTEGER Get Private Profile StringOffsite link to http://www.news2news.com/vfp/?function=196
IN Win 32 API AS ReadIni string,string,string,string,integer,string
DECLARE INTEGER Write Private Profile StringOffsite link to http://www.news2news.com/vfp/?function=201
IN Win 32 API AS WriteIni string,string,string,string

etc
etc
( Topic last updated: 2006.04.21 12:20:54 PM )