0

I currently have a QRadioButton on my form - in the constructor of the form

I am doing something like this

ui.radioButton->setChecked(true);

I get the following error on that statement

Access violation reading location 0xCDCDCDD1..

Any suggestions on why I am getting that ?

MistyD
  • 16,373
  • 40
  • 138
  • 240
  • It could be ANYTHING if we can't see the rest of your code. – Ben May 27 '14 at 01:30
  • That looks suspiciously close to one of the magic values Microsoft uses for uninitialized heap memory. See: [this answer](http://stackoverflow.com/a/127404/445976). Do you have an uninitialized variable? – Blastfurnace May 27 '14 at 01:35

1 Answers1

3

just as a guess, and please remember that without more information this is only a guess!

I suspect that you are using a Microsoft compiler (in debug mode); in the late 90's Microsoft had the habit of defining NULL to 0xCDCDCDD1 to help detect memory errors. If this is the case, you might not be creating the radio button. Maybe a forgotten call to 'setup ui'?

Again, this is only a guess. You really need to give us more information.

thurizas
  • 2,473
  • 1
  • 14
  • 15
  • Perfect Answer - I had my own constructor- Marked as answer after time – MistyD May 27 '14 at 01:36
  • ...Why did they use 0xCDCDCDD1? – Ben May 27 '14 at 01:38
  • 5
    `NULL` was _never_ defined as `0xCDCDCDD1`. The value `0xCDCDCDCD` is used by MS compilers in debug mode to initialize memory used by a variable. This is done to assist in you locating uninitialized variables. `0xCDCDCDD1` is actually `0xCDCDCDCD` + the _offset_ of whatever member are trying to access. If `setChecked` is not virtual this is likely a member variable in the radio button. – Captain Obvlious May 27 '14 at 01:46