Reading a file from DLL.



Hello everybody,

I have exe (a.exe) file that runs on COM+ environement the
executable loads a dll(b.dll) which has a reference to a
XML file which the dll uses to parse.

The problem is that I am unable to provide in a proper
location where the dll could read in the XML file. As the
exe file could be executed from any process.

Could anyone let me know a way to place the xml file from
where the dll could parse it no matter from where the exe
file is executed.

Thanks and Regards



S. Han

Is it possible for exe to pass the full path to the file to DLL?

Or perhaps the file can always stay in the same directory as the exe, and
have the DLL figure out the "working directory" of exe.



Ramesh Babu

Thanks Han.

But is it possible from the dll to know the location of the xml. I know
its possible through reflection and getting the source directory of the
dll and executing from that location. But any simpler technique where i
could get the location from the dll rather than passing it as a
parameter from the exe file.

If passing is the critieria i might have to do for all the exe file
using the dll.

Thanks in advance

*** Sent via Devdex ***
Don't just participate in USENET...get rewarded for it!

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question