Hiya all, i'm new around
I've been working with c/c++ for a while and now i'm trying visual c++ and i'm having some probs with my application (some simulation of production in real-time):
1. I'm trying to refresh the value of one field while i'm running my simulation but it wont work using UpdateData(FALSE) if it is in the center of the program (in the while)... if i use it when i begin or end, it's ok but not in the middle (and i really need to see the values to know if the program is doing ok).
2. I want do a emergency stop in case i want stop the program before it ends but when i'm starting my simulation, i cant access the main window and press on the button
3.Even if i'm using #if !defined( ), #define and #endif in my headers, i cant use them with more than 1 object(1 objet includes another one that includes the header i need, and i include the header itself).
4.I an having some problems with malloc :
code:
--------------------------------------------------------------------------------
Nx1=1+(m_x1sup-m_x1inf)/m_hx1;Nx2=1+(m_x2sup-m_x2inf)/m_hx2;/*******************************cont1*********************************************/ if ((cont1=(float**)malloc(Nx1*sizeof(float*)))==NULL) { MessageBox("La memoire est insufisante pour l'allocation1."
; exit(1); } for (i=0;i<Nx1;i++) if ((cont1=(float*)malloc(Nx2*sizeof(float)))==NULL) { MessageBox("La memoire est insufisante pour l'allocation."
; exit(1); } initTab2d(&cont1[0], Nx1,Nx2);
--------------------------------------------------------------------------------
if nx1 is too big, it will stop at the second dimension somewhere BUT, if nx2 is the same size as nx1 (lets say 2000), it wont stop, and crash somewhere in the program.
I hope u can help me a little here, i have been searching for a while now =/
thx.
I've been working with c/c++ for a while and now i'm trying visual c++ and i'm having some probs with my application (some simulation of production in real-time):
1. I'm trying to refresh the value of one field while i'm running my simulation but it wont work using UpdateData(FALSE) if it is in the center of the program (in the while)... if i use it when i begin or end, it's ok but not in the middle (and i really need to see the values to know if the program is doing ok).
2. I want do a emergency stop in case i want stop the program before it ends but when i'm starting my simulation, i cant access the main window and press on the button
3.Even if i'm using #if !defined( ), #define and #endif in my headers, i cant use them with more than 1 object(1 objet includes another one that includes the header i need, and i include the header itself).
4.I an having some problems with malloc :
code:
--------------------------------------------------------------------------------
Nx1=1+(m_x1sup-m_x1inf)/m_hx1;Nx2=1+(m_x2sup-m_x2inf)/m_hx2;/*******************************cont1*********************************************/ if ((cont1=(float**)malloc(Nx1*sizeof(float*)))==NULL) { MessageBox("La memoire est insufisante pour l'allocation1."
--------------------------------------------------------------------------------
if nx1 is too big, it will stop at the second dimension somewhere BUT, if nx2 is the same size as nx1 (lets say 2000), it wont stop, and crash somewhere in the program.
I hope u can help me a little here, i have been searching for a while now =/
thx.