Open/Read/Write using CFile in a COM Object.

I have a COM Object that uses a CFile object to open a text file, read it, and write to it.  In my development environment it works great.  However, the released version of the COM Object will not create or edit the TXT file on the client's PC.  I've also tried deploying the Debug version of the COM Object just to ensure that would have no impact on the problem, which it didn't.  I can't post MessageBoxes due to the nature of the COM Object and so I can't see what code is returned via CFileException.  I'm thinking it's a rights issue.  I'm hoping that I won't have to setup a full debug environment on the client PC just to determine what's up with this issue.  The target PC is running Windows Server 2003 but I have also seen the same problem on a Win XP Pro PC.  I can post source code if need be but, since it is working great locally, I don't think the source code is the issue.  Is there something I should do on the target PC to allow my application to perform file I/O?  Any ideas are appreciated.
Who is Participating?
AlexFMConnect With a Mentor Commented:
Handle all CFile exceptions properly and write information about them to log file. You can also use OutputDebugString function to report exceptions and see them using DbgView program from Generally, your program is not OK if it doesn't work and you don't know why. It must report by some way error information.
Try to run COM object client under Administrator account, possibly there is a problem with directory permissions.
XolutionzAuthor Commented:
I've thought about asking the client to login as Administrator and try it again, which would verify whether it's a permissions problem or not.  I'll also investigate the other debugging tool that you've described.  Thanks for the advice.
XolutionzAuthor Commented:
Sorry -- I forgot to update this thread.  I figured out the problem.  I had to right-click on the specific directory and grant full permissions to Everyone.  That fixed it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.