Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / need help debugging filemapping DLL

Author
Message
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 21st May 2005 13:05 Edited at: 21st May 2005 13:07
Well i have tried everything(and accidenetally discovered how u could make internal errors wich is by having a message box come up then have an "exit;") but i can not get this code to stop crashing the app it loads it
basically this is what happens
the createfilemapping function goes thru with no problem then the mapviewoffile(or map file to memory in stringtables) and writes a value to one of the mapped memory addresses but then when it comes to cleaning up and unmapping the file it just ends no error or anything just a crash and it does not give me a chance to handle the error
but anyway here is the source to the function(btw source to dll is free and open)

btw this is C source not C++ but it should handle the same

edit:

stringtable


formerly shadows of emptiness
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st May 2005 21:31
Ah, ignore my post in your DBPro thread.

Did you check out the DBPro code that I posted there though? That shows you exactly how to do this.

Anyway:
- All of your HWND should be HANDLE. You are doing nothing with windows or gadgets in this code.
- Your code will never open an existing mapping. If CreateFileMapping fails, you need to fall back on OpenFileMapping
- You are using the wrong file I/O. You need to use the CreateFile command instead of fopen

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 22nd May 2005 00:32
hmmm ok
probably should have read this post before i posted in the other
is there any difference between hwnd and handle though
why wont it open a filemapping
ok i was hoping to avoid that but anyway(fopen is the easy way)

ok thanks for the help guess now its time to change code

formerly shadows of emptiness

Login to post a reply

Server time is: 2024-11-21 13:44:05
Your offset time is: 2024-11-21 13:44:05