Hello,
I am getting subjected error while running FILEOPEN for ReadWrite.
Before this fucntion the same file was opened with Read access and then closed immediately, but still i am getting subjected error.
MAIN()
FileOpen(iImageFileNbr, strImageFile, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)
FileClose(iImageFileNbr)
'Below is the DLL function calling from main application.
Public Sub Append_Start(ByRef lStatus As Integer, ByRef strMsgText As String, ByRef intSorterId As Short)
'***********************************************************************
'Purpose:
'Inputs: None
'
'Outputs: Status
'************************************************************************
On Error GoTo AppendStartErr
'Open TXT file
giFileNumber = FreeFile
FileOpen(giFileNumber, gSorterObject(intSorterId).strPathName & "\" & gSorterObject(intSorterId).strDBName & ".NDP", OpenMode.Random, , OpenShare.Shared, cDatalen)
'Open FIM/RIM files
giFIMFileNbr = FreeFile
'ERROR IN BELOW LINE****************
FileOpen(giFIMFileNbr, gSorterObject(intSorterId).strPathName & "\" & gSorterObject(intSorterId).strDBName & ".FIM", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Shared)
I am not sure why still i am getting this error eventhough the file got closed before reopen it again.
Is there any option to UNLOCK or RELEASE the file access from all other existing holders (processes) to open it again.
Waiting for your suggestions to fix this issue.
Thanks in advance.