VpeOpenDocFile

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

VpeOpenDocFile

Postby wkthomas » Sat Feb 17, 2024 9:54 pm

I am a licensed owned of VPE and I am getting a NULL returned when a one particular user attempts to create a VPE file using the VPEOpenDoc. I am having a very difficult time to determine why the user is having this problem since I cannot duplicate the problem, it is sporatic and they are the only user getting the problem. Thus, the problem is most likely something to do with their user setting or computer settings on their Windows computer.

Based on what i have found on the forum, the VPEOpenDoc would return an error if the file name cannot be created.

Thus, I have verified that the:

(1) The file does not contain invalid characters ( C:\Users\xkl34926\AppData\Local\Temp\Positive Pay ASCII File.VPE)

(2) The user has rights to the directory.

(3) The file does not exist and if so file is not read-only.

(4) Since this is happening sporadically, this is not a problem with the permissions in the folder since the files is being saved in their temporary user directory (Set Temp= C:\Users\xkl34926\AppData\Local\Temp)

I have the following questions.

(1) Can the user's printer be the cause of the problem (Brother MFC-9130CW)?

(2) Since I am not getting a return value when I open the document, this means that I cannot use getlastError since that function return hDoc. Are there any way that I find out what error I am getting. (or would the error just be VERR_FILE_CREATE (and therefore would not be helpful)

(3) Since I have not be able to duplicate the problem, I have not been able to determine if it using VPEOpenDoc instead of VPEOpenDoc would create any differences.

(4) Do you have any suggestions on what could be creating the problem.

Thank you for your assistance.
wkthomas
 
Posts: 4
Joined: Wed Sep 23, 2015 12:15 am

Re: VpeOpenDocFile

Postby IDEAL Software Support » Mon Feb 19, 2024 9:03 am

I assume you are using VpeOpenDocFile() and not VpeOpenDoc().

VpeOpenDocFile() returns NULL, when the operating system fails to open an existing - or creating a new - file. I assume you try to create a new file.

Possible reasons are:
- No permissions
- Malformed path / file name
- Disk full
- Too many open files (rather unlikely)
- Hardware failure
- Anti-Virus software is blocking the call

(1) Can the user's printer be the cause of the problem (Brother MFC-9130CW)?


No.

(2) Since I am not getting a return value when I open the document, this means that I cannot use getlastError since that function return hDoc. Are there any way that I find out what error I am getting. (or would the error just be VERR_FILE_CREATE (and therefore would not be helpful)


It would just set VERR_FILE_CREATE.

(3) Since I have not be able to duplicate the problem, I have not been able to determine if it using VPEOpenDoc instead of VPEOpenDoc would create any differences.


I don't understand the question.

(4) Do you have any suggestions on what could be creating the problem.


Please see above for possible reasons.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: VpeOpenDocFile

Postby wkthomas » Fri Feb 23, 2024 1:52 am

I should have said the below

Could using VPEOpenDoc instead of VPEOpenDocFile resolve the problem. In other words, could the creating of the swap file be what is causing the problem?
wkthomas
 
Posts: 4
Joined: Wed Sep 23, 2015 12:15 am

Re: VpeOpenDocFile

Postby IDEAL Software Support » Fri Feb 23, 2024 2:09 pm

Could using VPEOpenDoc instead of VPEOpenDocFile resolve the problem. In other words, could the creating of the swap file be what is causing the problem?


Yes. If the file can not be created for the reasons I listed above, it is possible that using VpeOpenDoc() solves the problem. VpeOpenDoc() can also fail, when low on resources (RAM, Windows handles).
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 49 guests