|
Looks to me like your app is trying to update the status bar line..... and you probably don't have a window created/initialized.... so... find in your code where you are trying to update the status bar text.
|
|
|
|
|
Hi!
I try to use two pc to work on a project. pc A get raw data from a card, then do some process, then pass the parsed data to pc B to render it into image.
I wanna know the fastest API to push data form pc A to pc B. I think socket will not the fastest for it is base on tcp/ip. Then will pipe in win32 the fastest one?
Any other idea?
|
|
|
|
|
Not sure which is the fastest (will there be any difference? - it's all going over the same wires ), but this article[^] and the ones it's linked to may help you decide...
(BTW - if the link doesn't work, Google for the strings "Plugs and Jacks" and Asche, that should take you there)
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Actually, TCP/IP, in my experience, is faster due to the fact that Named Pipes is an authenticated protocol.
|
|
|
|
|
Does authentication affect the communication process after the channels been established? Must admit, I've got no experience of how these different protocols compare performance-wise, I'm just intrigued...
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Hi!
I just try to add some exception procession in my console program. But it seems work in debug but not in release. I don't know what's up. In debug, it output a "catch it" and stop itself. but in release, there is a dialog popup out "Integer Divide by Zero".
int a = 0;
int b;
try
{
b = 10 / a;
printf("b = %d a = %d\n", b, a);
}
catch (...)
{
printf("catch it");
return -1;
}
return 0;
|
|
|
|
|
To catch an error you have to throw an exeption by calling throw. In debug mode certain exeptions are handled by the debuger, but that's not the case in your release version.
If an exception is not caught by any catch statement because there is no catch statement with a matching type, the special function terminate will be called.
This function is generally defined so that it terminates the current process immediately showing an "Abnormal termination" error message. Its format is:
void terminate();
int a = 0;
int b;
try
{
b = 10 / a;
if( a == 0 ) throw "Error";
printf("b = %d a = %d\n", b, a);
}
catch (...)
{
printf("catch it");
return -1;
}
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Toni78 wrote:
...because there is no catch statement with a matching type...
But there is: He has written catch(...) to catch ALL exceptions!
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
jhwurmbach wrote:
But there is: He has written catch(...) to catch ALL exceptions!
These are the definitions for try, catch, and throw:
"The code within the try block is executed normally. In case that an exception takes place, this code must use throw keyword and a parameter to throw an exception. The type of the parameter details the exception and can be of any valid type.
We can also define a catch block that captures all the exceptions independently of the type used in the call to throw. For that we have to write three points instead of the parameter type and name accepted by catch."
You have to throw an exception because you can't just simply expect the compiler to throw every kind of exception that there is out there.
Of course you can argue and say that division by zero is a standard exception and I agree with you on that, but catch(...) doesn't catch ALL the ecxeptions unless you throw some of them. Otherwise, programs would never crash.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Pal, sorry. I still not very clear about it.
Does it mean we can't catch a "divide by zero" exception at all? We have to exam every number whether it is zero before we do a divide if we want the program wont crash with a 0? Any code to solve my example?
|
|
|
|
|
novachen wrote:
Does it mean we can't catch a "divide by zero" exception at all?
I am not sure how the VC6 compiler handles this particular case so take a look at CException. If you are not using MFC then you have to write your own code.
novachen wrote:
We have to exam every number whether it is zero before we do a divide if we want the program wont crash with a 0?
If you want to handle a divide by zero exception in your own way (not the compilers way) yes you have to check for every number before you divide, and you have to throw the error.
novachen wrote:
Any code to solve my example?
You could check my first reply to your message.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
For me, it works in Debug as well as Release build.
The message is "First-chance exception in test4.exe: 0xC0000094: Integer Divide by Zero."
Did you disable exceptions in the Project settings under the 'C++ Language'-tab?
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
yes, Exception is enable in 'C++ Language' as default.
I won't like a "First-chance exception in test4.exe: 0xC0000094: Integer Divide by Zero." message. That's just i get in release version.
What i want is a console output "catch it" and end the program like the behavior in debug version.
|
|
|
|
|
VC6?
There is a bug in the optimizer with VC6 that causes simple try/catch blocks from working. What happens is that the compiler thinks there can't be an exception so it optimizes the try/catch block away.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
i have test the code under vc7,vc7.1
debug version do it well, but it seemed that release version has no exception handler code.
if use cout replace printf ,then work fine .
i dont know whether this is a compiler bug .
|
|
|
|
|
Hi all,
I have a problem with setting of print page size programatically.
I try use DEVMODE and its values PaperSize, PaperWidth and PaperLength. Right after setting I determinate size of Paper by GetDeviceCap (not sure with function name).
Modification from A4 to A3 paper size works well
but
modification from A4 to A5 paper size doesn't.
Can anybody help me with this problem?
PetrP.
|
|
|
|
|
I'm having similar problems - can't set custom paper size, printer resets to A4, but the paper size can be set to non standard in the drivers properties.
Have you found any solutions yet?
|
|
|
|
|
What is the equvalent of CStringArray in c++?I want to store some strings in a array.
Mazy
No sig. available now.
|
|
|
|
|
std::vector<std::string> .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
See you after long time Joaquin.
Thanks.
Mazy
No sig. available now.
|
|
|
|
|
anyone know it? thank you?
|
|
|
|
|
Good people,
How do I set the “Comment” attribute of a file or folder using VB script ?
For example, the following code lists “Comment” attributes for files under C:\ directory:
set shell = CreateObject("Shell.Application")
set folder = shell.namespace("C:\")
for each folderitem in folder.items
list = list & _
folder.GetDetailsOf(folderitem , 0) & ", " & _
folder.GetDetailsOf(0, 5) & ": " & _
folder.GetDetailsOf(folderitem, 5) & vbCr
next
MsgBox list
Thanks,
Serge
|
|
|
|
|
I also do not understand what does macro guard do in header
file. What do we need to include #ifndef, # define and #endif.
And why do they capitialize the COUNTER_H, is COUNTER_H the
file name? It seems to be. Why is it called macro guard?
----------------------------
// File: Counter.h
// Counter class definition
#ifndef COUNTER_H // used to avoid multiple definitions
#define COUNTER_H // not part of the class
class counter
{
public:
// Member Functions
// Constructors
private:
// Data members (attributes)
};
#endif // COUNTER_H
|
|
|
|
|
It ensures that a declaration can only be included once.
Put simply, if you didn't have it in, you could end up with two versions of the same thing linked into your code. Try it. You won't get a compiler error but you will get a linker error
|
|
|
|
|
You can have compiler errors too. like the “type redefinition” one.
|
|
|
|