Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Issue of read file in Dll...

This topic is 5745 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have created 2 dlls : Dll_1 and Dll_2 Open a file with fopen(...) function in Dll_1 and return file stream structure pointer(FILE*) But the "unhandled exception..." happened when i try to read datas with fread(...) function in Dll_2 ,the file stream pointer is get from Dll_1,and it''s valid before fread() function when i Trace it. but if use Dll_1 in a client execute file ,nothing error getted. Does dlls read file stream data from opened in another Dll is invalid useage? need someone dll experts help me... thanks!!! & Very thanks for reading my ugly englis...

Share this post

Link to post
Share on other sites
...It''s valid before fread() function when i Trace it

The pointer points to something, yes, but what it points to means nothing in the context of the other DLL.
AFAIK you can''t transfer FILE*s out of a DLL and expect them to work. I''m not sure (untested), but Win32 style files (from CreateFile(), OpenFile(), ReadFile(), ...) might work ok.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!