|
Aryan S wrote: I am actually new in this field...
There are a lot of tutorials on the web, it would be much more efficient to read some of them before going any further developing code with tools that you don't how to use.
Check this[^] for instance.
|
|
|
|
|
I have a few controls like button , list box and combo box on my dialog in a dialog based application. I use tab key to change focus on controls hence the OnkIllFocus for the controls is executed as i tab . But When i close the dialog OnkIllFocus for the last control having the focus is not executed.I want to know the reason why this happens .
I expect the current control having focus shud lose Focus on closing Dialog hence OnkIllFocus for that control shud be called.If i am wrong plz correct me.
|
|
|
|
|
Shaileshhex wrote: I want to know the reason why this happens .
Maybe because the WM_KILLFOCUS message is not generated at that point. Use Spy++ to verify.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello, everybody. There is a such problem: it is impossible to process the 2-dimens. array, no problems arise when i allocate memory using malloc, but next lines of code brings computer to stop:
for(row=0; row<=2303; row++){
for(col=0; col<=3071; col++)
Arr[row][col]=....;
}
mmm..How solve this?
|
|
|
|
|
Rustik wrote: but next lines of code brings computer to stop
What do you mean ? Your computer really stops ? Or your program just crashes ?
How is your array declared ? Are you sure you don't go outside the bounds of your array ? Remeber that C arrays are 0 indexed.
|
|
|
|
|
Declaration: int ArrayName[rowSize][colSize]={{0},{0}};
...excuse me for my bad english, i mean program crashes.
|
|
|
|
|
Your program possibly crashes because your array size exceeds the stack one. Try to use the heap, instead.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
it's not clear. Plz explain.
|
|
|
|
|
the size of your array (assuming its elements are int ) is 2304 * 3072 * sizeof(int)= 2304 * 3072 * 4 = 28311552 bytes , while the default stack size for an application is (according to MSDN [^]) 1 Megabyte , i.e. 1048576 bytes .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Unfair damn voting[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Balanced.
BTW did you remenber to feed your troll this morning?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for the vote as usual. There's a troll (only one) and I keep forgetting to feed it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Is it all?..i mean is there a place in the code, where you have declared :"Now we use heap" ...thanks anyway. I'll try it in my coding and give answer about result.
|
|
|
|
|
Well a C/C++ developer should be able to use both the stack and the heap. I.e. good tutorial needed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You were given a good hint, insteads of complaining... why don't you try to search a bit what that clues mean and then re ask if you don't understand it?
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Please post more code. A similar loop execute in less than a second on my system.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
u'r lucky , Please post your code.
|
|
|
|
|
Rustik wrote: u'r lucky
Sure.
Rustik wrote: Please post your code.
Here you are.
int * Arr[2304];
int row;
int col;
for(row=0; row<=2303; row++)
Arr[row] = (int*) malloc(3072 * sizeof(int));
for(row=0; row<=2303; row++){
for(col=0; col<=3071; col++)
Arr[row][col]=row*4096+col;
}
for(row=0; row<=2303; row++)
free (Arr[row]);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Monday, June 23, 2008 8:58 AM
|
|
|
|
|
Is it all?..i mean is there a place in the code, where you have declared :"Now we use heap" ...thanks anyway. I'll try it in my coding and give answer about result.
|
|
|
|
|
Fixed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It works...may be u'r Deitel&Deitel's brother . U did me real help, thanks a lot.
|
|
|
|
|
Rustik wrote: It works...may be u'r Deitel&Deitel's brother
I did'nt know about, looks amusing.
Rustik wrote: U did me real help, thanks a lot.
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Listen, may i ask u another one question: is it possible to work with gif, jpeg, bmp - files(i think now u understand why i ask about 2-dimns. array), using C-language, is there libraries which allows this or only Visual C++ can solve image processing?
|
|
|
|
|
Well you may do raw image processing but dealing with different formats maybe difficult. There are a lot of libraries that can simplify the task, for instance, ATL/MFC 's CImage class [^] or GDI+ 's Image one [^], [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Raw image? U mean raw-data format? In my case it is not best choice. Thanks for the links.
|
|
|
|