• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Creating or opening, writing, and closing a file from a dll

Hi, i have an exe who call a dll, this dll should create a file (no problem with that)
writing data (access denied) and closing the file (no problem).

I set the file mode to read write and deny none, i try the way with a file var, or by a handle,
and i have the read/write rights on the directory (i'm administrator on this machine).

i never had this problem from an exe.

Why can't i write data to a file from a dll ?
0
Bazz_The_Cat
Asked:
Bazz_The_Cat
  • 5
  • 3
1 Solution
 
Bazz_The_CatAuthor Commented:
i could solve it with a call back function, but i want to know about writing from a dll ...
0
 
emadatCommented:
Right click on the DLL and check the security tab to see what rights are granted to whom.
0
 
Bazz_The_CatAuthor Commented:
i have all rights on exe, dll, and folder
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Bazz_The_CatAuthor Commented:
i mean full rights :-)
0
 
Bazz_The_CatAuthor Commented:
In fact, the file is writed personnal directory (my documents) even if i use setcurrentdir...
The only way who works is to give the path with the file name to assign the file.

Is it possible that setcurrentdir does'nt work ?
if i set the current dir when i load the dll, it is changed, but go to my documents when i write.
If i use setcurrentdir just before assigning the file, it does'nt work...
0
 
emadatCommented:
Can you post the code?
0
 
Bazz_The_CatAuthor Commented:
Ok, sorry, it works, but in fact, the problem is that it create the file at the right place ... i have to search a bit more to find why ... if you can help ...
I have to make a clean code here, i don't want to put all the code, i have to work on it.
0
 
emadatCommented:
You mean it creates the file at the wrong place?
If yes, then show me just the code by which you define the file name and path.
I think something wrong is there.
0
 
CleanupPingCommented:
Bazz_The_Cat:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now