The problem was different. I did not realized that accelerators are used in different way than I need. I think they are used only for menu. But there is simpler way to do what i need and it is to use...
Type: Posts; User: barracuda
The problem was different. I did not realized that accelerators are used in different way than I need. I think they are used only for menu. But there is simpler way to do what i need and it is to use...
In MSDN I have found:
"Processing WM_COMMAND Messages
When an accelerator is used, the window specified in the TranslateAccelerator function receives a WM_COMMAND or WM_SYSCOMMAND message....
My mistake, the code is 1004 invalid flags
I need to find different way how to register keys coz I have Windows XP, and this function is supported from Vista.
I try to register keys (ctrl+click and ctrl+numpad number)
void RegisterKeys(HWND window)
{
int i; bool res;
res = RegisterHotKey(window,1, MOD_CONTROL | MOD_NOREPEAT, VK_LBUTTON );
...
Ok, I have to rename the ssquares to squares hoping that this time it will be displayed without errors. You were right and so no the referenced objects are correct values:
int...
Also when I am trying to access subsquares later:
int computeCoords(WRAPPER_t * w){
int SN = w->task.temp.square_no;
int SSN = w->task.temp.sub_square_no; // needed here?
int CSN...
It's not clear to me why. How could your refer something what does not exist?
w->task.temp.blocksInfo[0]
Or the first element is created always? So the size of the array is alqays equal to...
I have one more problem with pointer during allocation process.
In the code uses wrapper object with a task object inside and with temp object inside of it.
WRAPPER_t * w;
typedef enum {
...
OK, so this should be correct:
char * zoom = &(w->task.temp.blocksInfo[w->task.temp.square_no].z);
*zoom = (char) atoi(*s);
Typecast to fit integer to char. The allowed values are smaller then...
Ok, now it's clear. So CODE::BLOCKS IDE interprets the zoom as array. I see now. Thanks
You didn't check the image which shows the code and what i see in watch panel while debuging.
You didn't check what type is zoom.
I did some change to the code as I tried to correct the...
language: C
*s = "3 ..."
expected zoom == 3
result is 13. Why?
image:
http://oi58.tinypic.com/j8ljfa.jpg
The abort_parseTaskFile is not finished. There I will need to release the memory allocated inside. I'll do it when the parsing and final computations will be done.
depthInStringExt already contains...
I reallized what I did. So originally the function abort_parseTaskFile worked for both variables for buffer and for s. And then I started to create new function changeSubSquareType. In the begin I...
I just cannot understand why it worked before as char * and now not. If I change it to char ** so it will not work to abort_parseTaskFile(w,buffer,-1); . I will think about it tomorrow morning. Thanks
However I use the function for ...
void parseTaskFile(WRAPPER_t * w, char*filename){
char * buffer ...
abort_parseTaskFile(w,buffer,-1);
...
int maxDepth = depthInStringExt(w, buffer,...
I wouldnt send here all code it's very long... Just shorten version:
int changeSubSquareType(WRAPPER_t * w, char **s, int lineDepth){
sprintf(w->pErrorMessage,"m cannot be used for...
I cannot recall what changes I did to the program yesterday night but the program worked before. The backup program contains the same declaration of abort_parseTaskFile... So this must be correct. As...
In the first case, there is a note:
expected 'char *' but argument is of type 'char **'
I have simple function to abort program:
void abort_parseTaskFile(WRAPPER_t * w, char * buffer, int err)
{
printf("Problem in task file:\n");
printf(w->pErrorMessage);
...
Thanks. U R right and I corrected the problem.
I have this error:
warning: passing argument 2 of 'sprintf' makes pointer from integer without a cast
I cannot find why there is the integer. I can see only const char * in both functions....
Would it be a help if I replace the command:
blockDepthParser(w, &s, goOn);
with this?
printf("hi"); // line 170
There is problem with debugger. I have a code in a loop. There is if .. else .. branch. The are two breakpoints set. One is in the if block and one is in the else block.
In the else block there...
Oh, I see, the code which was replaced by filter:
Paste ofCode
It is not vulgar word what was replaced. Sub - Square Number - "Shortcut" is S-S-No