dlls and cfile
Im trying to setup a dll that reads data. Im writing test dlls to test the concept but im having a bit of trouble accessing the file from the dll; I pass a CFile pointer from serialization into int dll. Reading from it fails; something like access denied. Any suggustions?
[272 byte] By [
llvllatrix] at [2007-11-18 17:32:13]

# 1 Re: dlls and cfile
I pass a CFile pointer from serialization into int dll
Your doing what? That would be your problem. How your handling your CFile Pointer and variable. You can pass memory into a dll. you can even pass a pointer to memory into a dll. But I don't know why you would want to pass a memory pointer to an open file as a way of sharing data. Do you have one guy reading and one guy writting at the same time? How exactly does your algorithm work?
Back in the old days of windows 3.1 there was a fake way to do interprocess communications. You could have two programs link to a dll and then literally talk through it. Dll's back then ran in their own space and not the space of the exe. This was a great advantage if you needed a quick hack, but as you could imagine it caused more problems than it helped. Anyway Microsoft now has Dll's running in the memory space of the calling applications so memory isn't shared like that. You're not trying to do something like that are you?
JMS at 2007-11-11 1:26:57 >

# 3 Re: dlls and cfile
Is your DLL an MFC extension DLL?
Can you do the reading correctly if it is done in the same exe that the archive object is in? I know, it would be work to write a program that does what you need to do in the DLL, but it might save work since you could determine if a problem is caused by or relate to the DLL.
# 4 Re: dlls and cfile
This is driving me nuts...cant find any documentation on why a CFile would give a message box saying:
Access to C:]WINDOWS\Desktop\chupathingy.stf was denied.
# 5 Re: dlls and cfile
Is your DLL an MFC extension DLL?
Nope...just a regular win32 dll.
Can you do the reading correctly if it is done in the same exe that the archive object is in?
Yep; tested the program and it read from the file...just doesnt read when i send the file object to the dll.
# 6 Re: dlls and cfile
Originally posted by llvllatrix
This is driving me nuts...cant find any documentation on why a CFile would give a message box saying:
Access to C:]WINDOWS\Desktop\chupathingy.stf was denied. I am not sure whether a DLL that is not a MFC extension DLL can share MFC objects with another (exe or DLL) module but I assume it won't work. However read MFC TN011: Using MFC as Part of a DLL; it should tell you what you can do and how to do things.