Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm building an GUI application.
When there is an issue and something happens, I can log the issue and present it to the user. If the error is FATAL, then the app quits and doesn't show anything. If it is ERROR, then I just present the issue to the user.
My question is in some code like this:
char* data = static_cast<char*>(malloc(size));
if (!data)
{
// What to put for errorlevel?
log(ERRORLEVEL, "failed malloc");
}
, which is a failed malloc, should it be FATAL or ERROR?
I had to put a 0 in the title because stackoverflow wouldn't let me have "Error" in the title.
Like this person said, if your app is known to use lots of memory and failed allocation is recoverable, then carry on.
Else if your app doesn't allocate many large buffers, than I would crash the app.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Just as you see in the title? I have been confused about that for a long while.
In many windowing systems, a console window is opened up when your program starts executing. When your program stops executing the window disappears. This regardless to any output sent to the console.
If your program is quick, the console will "flash" by.
If you want your console window to stay for a while, you will need to pause execution. My idiom is:
std::cout << "\nPaused. Press Enter to continue.\n";
std::cin.ignore(10000, '\n');
I don't use system("Pause") because not all operating systems have a Pause command.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Trying to add an Event handler to a scheduled task in ColdFusion11.
I'm supposed to write a component that implements CFIDE.scheduler.ITaskEventHandler and "Specify a dot-delimited CFC path under webroot, for example a.b.server (without the CFC extension)"
I tried to put my component under
ColdFusion11/cfusion/wwwroot
ColdFusion11/cfusion/wwwroot/CFIDE
ColdFusion11/cfusion/wwwroot/CFIDE/scheduler
the Apache webroot
some virtual host webroot
I tried to add some dot notation (?) like CFIDE.scheduler.myEventHandler...
I don't understand if there is some more configuration at server level to understand.
I don't see any error in logs, the scheduler editor just refuse to save an EventHandler he cannot find, with the error
An error occured scheduling the task.
Invalid eventhandler.
Error: Eventhandler myEventHandler could not be found
Any help appreciated
The correct way seems to put the component in ColdFusion11/cfusion/wwwroot/myEventHandler.cfc, set the path as myEventHandler and implement in the component "CFIDE.scheduler.ITaskEventHandler"
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am looking for a way to monitor and alert when a webjob fails. Is there any tools(Apart from cloudmonix and Newrelic) that can support this?
If you're using the WebJobs SDK, you might take a look at the new ErrorTrigger binding that was recently added (details here). It allows you to define a job function that will automatically be triggered when errors reach a certain threshold. Here's an example function that will be called whenever 10 errors occur within a 30 minute sliding window (throttled at a maximum of 1 notification per hour):
public static void ErrorMonitor(
[ErrorTrigger("0:30:00", 10, Throttle = "1:00:00")] TraceFilter filter,
TextWriter log)
{
// Access error details and send an email/SMS, etc.
// log last 5 detailed errors to the Dashboard
log.WriteLine(filter.GetDetailedMessage(5));
}
See the Error Monitoring wiki page for more information.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Here is my code:
#include<iostream>
#include <windows.h>
using namespace std;
int main(){
ShellExecute(0, 0, L"www.ldjgsdoij.com", 0, 0 , SW_SHOW );
int i;cin>>i;
return 0;
}
How to open this web www.ldjgsdoij.com after 15 minutes even if the client
has runned exe file and closed it?
you can use C++11 Chrono functions for time.
see also Stackoverflow answer How to create timer events using C++ 11?
I think the best way it to use Schedule Tasks in Windows or Cron in Linux
For open URLs see the following answer on open browser window
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
The title of the question explains pretty much the whole question. I've been programming a console application for about a week now and I want to migrate over to a GUI. Sounds simple, but I'm running into some errors. I would add them here, but it seems pretty obvious that there are some preparations I need to make to move over to GUI that I haven't made yet.
So, where do I start?
Thanks,
-P
EDIT:
LIBCMT.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain#16
That's all I've got so far, but by the looks of it it may be a big problem to tackle.
And if I didn't make it clear, my objective is to change from the console subsystem to the windows subsystem.
Looks like WinMain is set as the entry point of your application (as a Windows subsystem app), where you probably have a main() function somewhere from your console application. Set the entry point to main() or implement WinMain to resolve the linker issue.