Jump to content
  • Advertisement

Archived

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

Isowave

My program has performed an illegal operation...

This topic is 6932 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 no clue what is going on, but every time I exit my program, it says "This program has performed an illegal operation and will be shutdown" What can I do about this? All my program does is load and display a bitmap...

Share this post


Link to post
Share on other sites
Advertisement
Are you using directX? I have the same problem in my directX app. I never bothered to fix it as i didn''t care about a message at the end of my program. However i think its due to not releasing the directx interfaces correctly.



ECKILLER

Share this post


Link to post
Share on other sites
Yes, it is DirectDraw... It''s just annoying to have that message there all the time. I thought it may have something to do with that, but I wasn''t sure. I can go over everything again, and see if I can spot the problem. if not, I''ll be back on here

Share this post


Link to post
Share on other sites
Run your program in Debug mode, if you''re using MSVC++ it will say something like access violation. In which case you are releasing something that you shouldn''t be. Also you could try pressing the ''Debug'' button in the Illegal Operation message box, if you have it.
If you aren''t using DirectX, or you don''t have MSVC++, then I can''t help you.


The_Minister

Share this post


Link to post
Share on other sites
The error is present because you somwhere in your program does an illegal write on unallocated memory. I suppose you are using win9x, because it doesen''t warn you until you close your program. Try win2000 or NT instead.

Share this post


Link to post
Share on other sites
What are you talking about? It stops the main OS loop and shoves an Illegal Operation in your face, preventing other applications from continuing. You then have the option to either terminate the application from memory and the OS loop, or you can view the technical details about where it happens. With MSVC++ you can see where exactly in the Assembly it occured, and if the program is yours, it will show you where in C++ it happened.
An application can not continue after it causes one of these.


The_Minister

Share this post


Link to post
Share on other sites
Yes, it is Windows 98, and I am using Visual C++ 6. It does tell me there''s been an access violation, then it gives me this long address. It even points the problem out to me in Assembly, but I don''t know Assembly yet here''s what I get from "details" in the message box:

PENTE caused an invalid page fault in
module PENTE.EXE at 0167:00403d93.
Registers:
EAX=006744e0 CS=0167 EIP=00403d93 EFLGS=00010212
EBX=00550000 SS=016f ESP=0065fc90 EBP=0065fc98
ECX=000000a0 DS=016f ESI=00674260 FS=6857
EDX=00000000 ES=016f EDI=00000000 GS=0000
Bytes at CS:EIP:
f3 a5 ff 24 95 a8 3e 40 00 8b c7 ba 03 00 00 00
Stack dump:
0065fcac 0065fcfc 0065fcfc 00401bb8 00000000 00674260 00000280 0065fda8 0065fd0c 00550000 cccccccc cccccccc cccccccc cccccccc cccccccc cccccccc

When I debug, the message says:

"Unhandled esception in pente.exe: 0xC0000005 Access Violation"

the ASM line that it points out is:

00403D93 rep movs dword ptr [edi], dword ptr [esi]

I have no clue what all this means... However, I suspect it has something to do with how I handle my bitmap.

Share this post


Link to post
Share on other sites
Can you not get it to take you to the line in the source where the error happens? That is what the debugger is for, primarily. Compile the program in debug mode, run it from within the IDE and you should be able to see the line that causes the problem, and trace the stack back through the function calls to work it out.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!