Is SetTimer deprecated? - timer

First of all I'm using the Windows Embedded Compact 2013 Framework...
MSDN says that SetTimer is deprecated but they don't suggest what to use instead. Any ideas?

You Can start a thread with some sleep inside or usw thread.timer

Related

Is it possible to use pyflink on windows?

Has anyone ever had success running using python and windows with flink?
I'm trying the following command:
.\bin\pyflink.bat examples\python\WordCount.py
and getting the following error
Starting execution of program
Usage: ./bin/pyflink<2/3>.[sh/bat] <pathToScript>[ <pathToPackage1>[ <pathToPackageX]][ - <parameter1>[ <parameterX>]]
The program didn't contain a Flink job. Perhaps you forgot to call execute() on the execution environment.
The program didn't contain a Flink job. Perhaps you forgot to call
execute() on the execution environment.
This looks like you forgot to add
env.execute(local=True)
in case you are running it locally. Without this the flink job wouldnt be able to execute. You can find more information with this simple example program
I got this information in Win10. Maybe it is not supported at present.
In the following release-1.11, PyFlink will support windows in local mode. https://issues.apache.org/jira/browse/FLINK-12717

How to use PollTimeout in NetMQ?

I can't find any documentation telling me how to use PollTimeout in NetMQ.
Can it be used to detect a send or receive timeout? In case it can, how?
You can TrySendFrame and TryReceiveFrame which accept TimeSpan as timeout.
However the stable release in nuget doesn't include them. So compile from master or use the latest pre version:
http://www.nuget.org/packages/NetMQ/3.3.0.13-alpha622

How to handle Win32 Application termination

I have an Win32 application with no window written in C.
My question is: is there any way to handle the termination of my application. Ex. closing it from the task manager or via the console.
It is unclear from the question, but if this is a console mode application then you can call SetConsoleCtrlHandler to install a callback that Windows will call just before it terminates your app. Beware that this callback runs on a separate thread and that you have to complete the callback function quickly.
If it is a native Windows program that just doesn't create a window then you really do need a window to get notifications like this. Which is not a problem, it doesn't have to be visible. Just don't call ShowWindow().
Note that atexit() as mentioned will not work, these are rude aborts you are talking about that don't let the program go through its normal shutdown sequence.
You might like to take a look at the atexit() function (http://msdn.microsoft.com/en-us/library/tze57ck3%28v=vs.100%29.aspx).
Using this function you can install handlers which are called when the program terminates.

what is the win32 alternative to the Unix daemon() subroutine?

I have to call several (> 10) .exe command line programs in the background.
Creating a Windows Services doesn't sound very appealling in this context - c'mon, that's a bit overpowered for such a simple task.
Is there anything like a daemon(3) subroutine for Windows?
You might look into using the srvany.exe service wrapper found in the Windows Server 2003 Resource Kit Tools. I have used this method quite successfully under Windows XP, but I cannot comment on how it may work for newer versions of the OS.
There seems to be plenty of information available1 on how to use this tool.
1 - Google search for srvany+howto

Programmatically using CMD in C

How can I simulate these calls inside a program?
Like say I want to find all the active connections. So I want to use netstat -a
How could I use that without having to literally having a window open?
Use CreateProcess, redirecting the output.
If the calling application is not a windows application there is no issue with a console window (because a console programming will, by default, inheirt its parent console).
If the calling application is a windows application, set the right options passed to CreateProcess to default the console window that will be created to hidden.
There is system() library function you can use - I guess Windows has it as well because it is standard C function since C89.
You will have to use the "/B" option of 'start' command.
cmd /C start "Title" /B netstat -i
I'm assuming popping console is your main problem,
and you a strategy of collecting the data.
Never use system() (not professional, crappy)
Use Win32 net apis .
See the source code of netstat.

Resources