Click here to Skip to main content
13,047,502 members (62,340 online)
Rate this:
Please Sign up or sign in to vote.
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 .
Posted 2-Oct-12 18:21pm
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.
iampradeepsharma 3-Oct-12 4:53am
sure Marius

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100