I am a newbie here. I just want to know few things those are really hard to track down. I am trying to debug a existing F/W code mostly written in c or c++. This IDE and compiler is from a particular DSP/MCU company. This code is a complex one and F/W and S/W mixed together. Some codes are not even understandable because I have very limited knowledge in syntax, pointer datatype and flags etc. Manuals and examples can give some ideas.
Now lets talk a specific problem, .c file includes some header dependencies like those are customized, made for particular reason.
Mentioned register file is customized. I am not going to describe in detail. Before I post a portion of code I should explain a little. In this PI control we are trying to play with register values which may bring the channel voltage that relates with current in terms of different conditional case. Here we go,
Register[CURENT_LIMIT_STATUS] = CURRENT_LIMIT_STATUS_NULL;//need to know what is the current limit status in loadif(bSysRun)// This register tells to RUN the system
Voltage_ch1 -= Current_T_ch1 * Register[LINE_DROP_SCALE]; // multiplied by a scale vaule
Voltage_ch1 = Voltage_ch1 < 0 ? 0 : Voltage_ch1;// less then 0, means no loadif(Register[USE_LOADSHARE] != 0)
Voltage_ch1 -= Register[LOADSHARE_DIFF_CURRENT] * Register[LOAD_SHARE_SCALE_V];//330 no register multiplied by load share scale
Current_BP -= Register[LOADSHARE_DIFF_CURRENT] * Register[LOAD_SHARE_SCALE_B];// BAT positive end current with same load share currentif(Register[RUN_MODE] == MODE_SOLAR)
Voltage_ch2 += Register[LOADSHARE_DIFF_CURRENT] * Register[LOAD_SHARE_SCALE_B];//
What I did not understand as follows,
1. Subtract AND assignment operator, what -= means ?
2. what += means ?
3. What does !=0 means in if structure ?
4. What double equals == means ?
Now let me expain my scenrio I am running a client server TCPI /IP program the server is a z/os mainframe and the client is a MFC C\C++ windows based program which displays data from the mainframe
I can have up to 4 modeless dialog boxes which display data in a rich edit their pointers live are my derived CWinApp
I did all the front end work created the accelarator in my resource file had it as selection in my menu "MENUITEM" and put the appropriate message map and message handler in derived CDialog CProgDebug
I then inserted the following code into my derived CWinAppp CDBGRApp
After I created the CProgDebug with it rich edit the window didnt seem to take any input mouse or keyboard
Nish in his code didnt specify that after doing TranslateAccelrator and would have to do TranslateMessage and DispatchMessage from the msg structure as I assume that is being taken care of somewhere down the line by the frameWork
The function returns nonzero when it successfully translates the accelerator, which is when you should not pass the message through to the default handler. Your code is bypassing the default handler entirely when your h_accel and debug variables are set (without checking if the message was a translated keycode).
thank you so much for your patience me However the way mine is set is INCORRECT as I dont have an IF testing for the validity of the TranlateAccelarator and that is why my keyboard gets locked becasue I havr return TRUE for all
I'm looking for a way to catch exceptions due to software or hardware errors and prevent my solution from breaking brutally, but I can't find anything complete.
I have read the two main ways of handling exceptions, C ++ and SEH, but it seems to me that both do not include all cases that can happen.
Can anyone help me ?
Greg Utas, thanks for article: i read it as soon as possible.
DevParty: ok, all cases is too much, but most of the cases?
I've tried both ways (exception C++ and SEH), but, for example, they catch division by zero, but not a string copy error.
Last Visit: 31-Dec-99 18:00 Last Update: 20-Sep-21 13:12