Click here to Skip to main content
15,940,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all ,
I have some code which does some conversion on an image , for it it uses LockBits and does some processing and then calls unlockbits , the problem while the code does perform good on Win Xp but sometimes on Windows 7 the code throws memory access violation occurs exception...
Can you ppl come up with some sort of suggestion what could possibly be wrong on win 7 .
Mohibur Rashid 3-Oct-12 0:55am    
Perhaps debugging on Windows 7 environment. It is possible that some function is not working as it was suppose to work.
iampradeepsharma 3-Oct-12 1:00am    
Marius Bancila 3-Oct-12 2:47am    
First, you should figure which function throws that exception.
iampradeepsharma 3-Oct-12 2:56am    
LockBits() , this function throws the exception .
Marius Bancila 3-Oct-12 3:05am    
There can be different causes for this. Impossible to say anything without seen your code. Take a look at a search results for "LockBits memory access violation", you'll see others had problems. Take a look at the suggestions and double check your code.

1 solution

The problem can be completely at a different (and sometimes unrelated) chunk of code in your program. E.g. you have a buffer overrun somewhere in the program that sometimes corrupts the memory reserved for unlockbits
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900