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

Posted on 2003-03-26
Medium Priority
Last Modified: 2010-05-18
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 ?
Question by:Bazz_The_Cat
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3

Author Comment

ID: 8211656
i could solve it with a call back function, but i want to know about writing from a dll ...

Expert Comment

ID: 8211698
Right click on the DLL and check the security tab to see what rights are granted to whom.

Author Comment

ID: 8211832
i have all rights on exe, dll, and folder
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 8211840
i mean full rights :-)

Author Comment

ID: 8212514
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...

Expert Comment

ID: 8212661
Can you post the code?

Author Comment

ID: 8223444
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.

Accepted Solution

emadat earned 100 total points
ID: 8224938
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.

Expert Comment

ID: 9316591
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 
Post your closing recommendations!  No comment means you don't care.

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question