Link to home
Start Free TrialLog in
Avatar of Bazz_The_Cat
Bazz_The_Cat

asked on

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 ?
Avatar of Bazz_The_Cat
Bazz_The_Cat

ASKER

i could solve it with a call back function, but i want to know about writing from a dll ...
Right click on the DLL and check the security tab to see what rights are granted to whom.
i have all rights on exe, dll, and folder
i mean full rights :-)
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...
Can you post the code?
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.
ASKER CERTIFIED SOLUTION
Avatar of emadat
emadat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.