|
Run your application under debugger and when the it crashes again, check the call stack and see what is that you are doing to crash IE.
I guess C:\projectW23\ddeposit\clasp\wrapper\code\WFSCAN\Release\ABCScan.ocx this is the activeX that you have developed.
-Prakash
|
|
|
|
|
I am new in c++, can Anybody tell me how one can divide image into blocks.
I have yuv format image saved in byte memory. I want to divide it into 16x 16 blocks The image size is 144x176.
I want to process further each block for calculating motion estimation .
Thanks
koreno
|
|
|
|
|
Seeing as it's in a non-Windows format, I assume you have a bunch of raw pixel data. Surely, you just need to create 16x16 blocks of memory ( well, 48x16 ) and copy the data across ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a video sequence foreman.yuv.I can read frame separately, But my questions is still there , The data is in byte memory in an array, while i need a 16x16 block in raster form .
I know it is not difficult question but I could have idea how i will use loop to acquire the refereces to each block in the image .
koreno
|
|
|
|
|
What do you mean by 'in raster form' ? Do you need it to be RGB ?
I'm not sure what the overall format is here, but YUV is still a format where one triple is a pixel, right ? So, you just need to copy out the triples for the pixels you want. Which means working in blocks of 48, and then working out the number of bytes in a row in order to jump by rows.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
this should be no problem if u know it's data format.
I don't know what format u are reffering to, so lets assume the pixels are arranged in lines and are 4 bytes.
Now u can just read the blocks in a double loop:
int bx = block_x*block_width;
int by = block_y*block_height;
for(int x=0; x<16; x++) {
for(int y=0; y<16; y++) {
int pixel = data[(y+by)*img_width+(x+bx)];
}
}
HTH,
|
|
|
|
|
Hello!
I have made a tiny change to a console-application I've been using for years. I changed some variables of type 'unsigned long' into '_int64' to be able to represent larger numbers. As a result the application now halts before execution even enters the main() function. Only after I give a character input and then hits return does the program start its normal execution. This is inconvienient since the program is normally run as a child of another application.
Any ideas about how to fix this?
Thanks in advance!!!
maladuk
|
|
|
|
|
If you change those __int64 references back to unsigned long , does it start working again?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
I got another hint which I checked out first, that the error could stem from erroneous initialization in global objects. It turned out to be the case.
Thanks a lot for engaging anyway!
maladuk
|
|
|
|
|
Hi,
I was just wondering if anyone else has ever seen this problem, and might be aware of a fix for it:
I'm calling malloc in a recursive fuction I recently wrote, and it gets called a ton of times very quickly, could be 1-2k times or more per fraction of a second.
For some reason, if I have it call too many times, the program crashes. If I lower the bounds of the recursive exit slightly, then I can get it to work most of the time. Lowering the bounds further will result in the program working 100% of the time, but I don't get the results I need (it needs to be very precise).
Of course the first instinct is to assume I'm running out of memory, but no, that is not the case, I'm calling malloc on tiny tiny portions of memory and when the program crashes it's normally only using between 1700 and 3500K of RAM.
The program is actually crashing inside of malloc so there isn't much I can do about the function itself, it doesn't even get to the return.
I tried placing sleep calls into the function but this strategy didn't work, as well as causing the function call to take horrendously long amounts of time to run.
Any ideas?
Thanks!
Kelly Ryan
|
|
|
|
|
KellyR wrote: I'm calling malloc in a recursive fuction I recently wrote, and it gets called a ton of times very quickly, could be 1-2k times or more per fraction of a second.
Recursion is very stack-intensive.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Are you sure that malloc is the cause? or are you running out of stack space by making all those recursive function calls. You must remember that every time you make a recursive function call new storage space is allocated on the stack for the parameters, and all your register values are also pushed onto the stack so that they are saved for when the function returns. If you make too many recursive function calls you stack will get used up very quickly and your program will crash.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
That's probably what it is, thanks.
Kelly Ryan
|
|
|
|
|
In C/C++ when u malloc() memory you allocate heap, which is memory. Whereas your recursion calls are like the proverbial stack of plates. Each pass takes one more away until they are all gone.
You could increase the stack space in you program but that will only buy you a temporary fix. Instead you should probably revist the design of your app and decide if recursion is really needed.
Good Luck
Mike Luster
|
|
|
|
|
Hello,
I have a GUI application developed in VS.net. Depending on a users OS, they may require that certain DLL's be in the system folder(s) in order for the GUI to run.
Can someone tell me how to develop a simple installation CD, that will load the GUI exe, and then load the required DLL(s) onto the users system.
Thanks.
Jerry
|
|
|
|
|
Google for InnoSetup.
~RaGE();
|
|
|
|
|
Microsoft Visual Studio .NET 2003 -> File -> New Project -> Setup And Deployment Projects -> Setup Wizard -> ...
From here you should do everything its not difficult
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
jerry1211a wrote: Can someone tell me how to develop a simple installation CD, that will load the GUI exe, and then load the required DLL(s) onto the users system.
In Continuation with Mr. Rage,
here is the link for InnoSetup:-
http://www.jrsoftware.org/isinfo.php[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thanks for providing the link.
~RaGE();
|
|
|
|
|
|
I have the need to execute a console application from within my dialog based one, and I need to retrieve the output of the console app in a string form.
The console app doesn't require user input, it accepts an argument, then just runs and generates a string.
I would imagine I have to use ShellExecute, or CreateProcess, but am not sure how to get the output, other than simply it's return code.
Any ideas?
Thx,
Rick
|
|
|
|
|
If you could get away with an intermediate file, you could simply use the "myprg.exe >intermediate.file" syntax to catch the output of "myprog.exe" in "intermediate.file" .
I am positively sure there other and are more elegant ways, but this one is a matter of half an hours work.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Try and search Code Project (using the search functionality at the top of this page) for CWaitProcess. It seems a bit complicated at first sight, but it is exactely what you need.
~RaGE();
|
|
|
|
|
Look at the parameter list for CreateProcess(). Some of them are file handles that you can specify where you want to the output to go to i.e. create a file and then pass its HANDLE into CreateProcess()/
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
See here and here.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|