--- In [email protected], "Jimmy Johnson" <boxer...@...> wrote: > > > ...and here you store something at where it is pointing, which probably > > causes the crash. > > does wglCreateContext not "initialize" it?
The assignment stores the value returned by wglCreateContext in the memory whose address is the value of the hRC variable. That is, it 'initializes' the pointed-to memory, not the value of the variable itself. Eg. the value of hRC is 1234. The assignment stores the function's return value in the memory starting at 1234, but it doesn't change the value 1234 in hRC. So if 1234 is an invalid address, which is likely in this case because it hasn't been initialized, you will probably get a crash. (An uninitialized variable does have a value of course, but you just don't know what it is, and it might vary every time you run the program.) Hope that makes sense - feel free to ask more questions.
