had enough of C
-
Grr Ive just about had enough of Visual B*$£%y studio. Okay heres my problem ive written a program that runs buetifully in Debug and i mean buetifully not a single error when runnign it 100's of times etc. Soon as i switch to release i get it just crashing or errors popping up saying some function failed. Okay one of teh biggest ones is CryptAcquireContext() fails with invalid parameter well hwo the hell can that be when the parameter is valid in debug. All i can think of is something is screwing up the memory where this is loaded has anyone got any ideas. Peter P.S Surely if something was screwing this memory area up it would be picked up in debud as an Assert failure?
-
Grr Ive just about had enough of Visual B*$£%y studio. Okay heres my problem ive written a program that runs buetifully in Debug and i mean buetifully not a single error when runnign it 100's of times etc. Soon as i switch to release i get it just crashing or errors popping up saying some function failed. Okay one of teh biggest ones is CryptAcquireContext() fails with invalid parameter well hwo the hell can that be when the parameter is valid in debug. All i can think of is something is screwing up the memory where this is loaded has anyone got any ideas. Peter P.S Surely if something was screwing this memory area up it would be picked up in debud as an Assert failure?
Peter Liddle wrote: well hwo the hell can that be when the parameter is valid in debug. Two words: uninitialized variables Check out John Newcomer's article here at CP about debug vs. release problems. --Mike-- Buy me stuff! (Link fixed now) Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines! My really out-of-date homepage Big fan of Alyson Hannigan and Jamie Salé. Sonork - 100.10414 AcidHelm
-
Grr Ive just about had enough of Visual B*$£%y studio. Okay heres my problem ive written a program that runs buetifully in Debug and i mean buetifully not a single error when runnign it 100's of times etc. Soon as i switch to release i get it just crashing or errors popping up saying some function failed. Okay one of teh biggest ones is CryptAcquireContext() fails with invalid parameter well hwo the hell can that be when the parameter is valid in debug. All i can think of is something is screwing up the memory where this is loaded has anyone got any ideas. Peter P.S Surely if something was screwing this memory area up it would be picked up in debud as an Assert failure?
set your compiler's warning level to 4. this will catch a lot of stuff. (project / settings / C/C++ ) -c
There ain't no second chance Against the thing with the forty eyes
-
Grr Ive just about had enough of Visual B*$£%y studio. Okay heres my problem ive written a program that runs buetifully in Debug and i mean buetifully not a single error when runnign it 100's of times etc. Soon as i switch to release i get it just crashing or errors popping up saying some function failed. Okay one of teh biggest ones is CryptAcquireContext() fails with invalid parameter well hwo the hell can that be when the parameter is valid in debug. All i can think of is something is screwing up the memory where this is loaded has anyone got any ideas. Peter P.S Surely if something was screwing this memory area up it would be picked up in debud as an Assert failure?
you must also call "ZeroMemory" when passing some structs to API,if you do not call this the struct may have invalid data. Casa.Sapo.pt
-
you must also call "ZeroMemory" when passing some structs to API,if you do not call this the struct may have invalid data. Casa.Sapo.pt
Thats what i thought that it would be unintalised variables but i have checked loads of times and can't find any and no warnign about them are bought up. Maximaiano whats that about zeromemory i have zeroed all my structs when i initalise them shoudl i be zeroing them somewhere else as well? Peter
-
Thats what i thought that it would be unintalised variables but i have checked loads of times and can't find any and no warnign about them are bought up. Maximaiano whats that about zeromemory i have zeroed all my structs when i initalise them shoudl i be zeroing them somewhere else as well? Peter
look at this sample... in this sample i am changing the text of one header item (CHeaderCtrl) HDITEM hdi; ZeroMemory(&hdi, sizeof(hdi)); //if i do not call this it will crash in release (most of the times) hdi.mask = HDI_TEXT | HDI_FORMAT; hdi.fmt = HDF_STRING | HDF_CENTER; hdi.pszText = "Cool String"; m_Header.SetItem(i,&hdi); why does it crash? when we call SetItem we are passing all the items in the struct (hdi) not only the ones that we use (hdi.mask,hdi.fmt,hdi.pszText) and because the the items that we didnt use may have invalid data the control crashes the zeromemory "cleans" the struct , providing a safe way of sending a struct to a control without invalid data. Casa.Sapo.pt
-
Thats what i thought that it would be unintalised variables but i have checked loads of times and can't find any and no warnign about them are bought up. Maximaiano whats that about zeromemory i have zeroed all my structs when i initalise them shoudl i be zeroing them somewhere else as well? Peter
why is this Anonymous ????????????????????:confused: :confused: :confused: Casa.Sapo.pt
-
why is this Anonymous ????????????????????:confused: :confused: :confused: Casa.Sapo.pt