|
Thank you for your reply.. Sorry i'm only getting back now.. I was busy tweaking the code and the MC to see where the problem was.. turns out it was the MC.. there was problems with synchronization when talking to the PC..
Thank you all for your time to help.. I've sure have learnt some pointers from the replies..
|
|
|
|
|
I want to write a program that makes a particular exe run everyday. For this, it should add that exe to Scheduled Tasks. But how to do that programatically?
All I know is, when we add a new Scheduled Task, say MyTask, it creates a file "C:\Windows\Tasks\MyTask.job", but this file contains some binary data and can't be directly created/editad.
Any Standard Ways / Workarounds ?
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
You need to use ITaskScheduler interface.
You can easily come to know how to use it, and there are related interfaces.
|
|
|
|
|
Here's a starting point:
HRESULT hr = CoInitialize(NULL);
if (SUCCEEDED(hr))
{
ITaskScheduler *pITaskScheduler = NULL;
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, IID_ITaskScheduler, (void **) &pITaskScheduler);
if (SUCCEEDED(hr))
{
...
pITaskScheduler->Release();
}
CoUninitialize();
}
See here for more.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I don't understand why NT uses a 2-step physical memory locating method. it splits a 32-bit virtual address in 3 parts. two first parts are indexes of page-directory and page-table respectively.
why dosn't it split virtual adress in 2 parts in which the fist part only indexs page table index and the CR3 register points to the first index of page table?
please explain more and more!!
|
|
|
|
|
I have a simple server and client source code that can run. The problem is I type two same IP address in the source code of server and client, the program can connect and send. But when I test the program in two PC and type both IP address in both of the program, the program cannot work. What is the problem of it?
|
|
|
|
|
Hello,
It is said in MSDN for the SDK SelectObject fn that "An application should always replace a new object with the original, default object after it has finished drawing with the new object".
Is it neccessary for MFC CDC object also?
- NS -
|
|
|
|
|
Nishad S wrote:
Is it neccessary for MFC CDC object also?
Why Not??
"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
|
|
|
|
|
Yes!
The CDC object is just a wrapper around a DC handle and it provides minimal support for reading/writing to a DC handle, as it should.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi all,
Has any ever encountered this kind of problem when usin VC6:
On the surface of the main dialog, tthere are 129 controls (CStatic's, CEdit's, CButton's).
No other resource can be added on the dialog surface (neither by resource selecting and insertion, nor by copy-paste merthod) ?
Thanks
SkyWalker
|
|
|
|
|
the number of controls that can be added in design mode is limited to 255 due to the resource identifiers.
if you want more, you will have to add your controls dynamically/programmatically.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I can understand that, but why is it working if I manually add them in the .rc file (using Notepad for that) ?
( I did not have 255 identifiers yet )
SkyWalker
|
|
|
|
|
Mircea Puiu wrote:
using Notepad for that
why doun't you just use the resource editor ??????
check however to resource.h file to verify that the coutrols have consecutive IDs.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Because the resource editor was not working any longer for some reason.
The IDs were consecutive.
SkyWalker
|
|
|
|
|
|
|
Apparently no one else has tried that before, including the designiners of the resource editor. The limits sound like they are right (I forget what they are). I am suprised (if there is a bug) that you can add 129 controls, because the problem should have showed up at 128 controls.
NEVER MIND THAT!
It is working when you manually add them in the .rc because the RC compiler is doing what it was designed to do. The RC editor (on the other hand) is apparently introducing false limitations.
In any case that is a ridiculous number of controls.
INTP
Every thing is relative...
|
|
|
|
|
http://www.codeproject.com/useritems/WOL.asp
Hello, I just read an article and test on my machines. My two machines was connected through a giga byte LAN wire.
I realize that, if my target machine is shut down through win xp, the target machine can be WOL no problem.
However, if my target machine is shut down by pressing the on/off button, the target machine cannot be WOL
In both cases, the LAN LED still light up.
Seems weird, may I know what is the difference between turn off via on/off button and via winxp shut down? Why WOL problem occur does occur?
Thank you.
|
|
|
|
|
yccheok wrote:
http://www.codeproject.com/useritems/WOL.asp
Why don't you post your question in the Forum present at the bottom of article...
"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
|
|
|
|
|
It depends on the individual hardware, some systems may not maintain all of the standby voltages when switched off by the on/off button.
Elaine
The tigress is here
|
|
|
|
|
I have a winsocket server listening on a given port, say 2000. Is there a way how to find out what service (eg. telnet) is used by a particular client when it connects to the server? I tried getpeername() on a connected socket to get sockaddr_in structure filled and then I called getservbyport() with sin_port parameter from sockaddr_in, but with no success. I've got WSANO_DATA (Valid name, no data record of requested type) error.
I'd really appreciate any insight recommendation
Zdenek
|
|
|
|
|
Here[^] you can find a tool (and source code) which retrieves information about each connection
|
|
|
|
|
Nope. I've downloaded both the source of netstatp and TcpView utility from a recommended site. There's no information there how to find out a service the client is using. Even a TcpView only guesses the service from a well known port number.
Regards,
Zdenek
|
|
|
|
|
You cannot guess!
The only way would be to create a filter to listen to the connection and to check the service that way. But normally it is not possible!
Don't try it, just do it!
|
|
|
|
|
You're question doesn't make sense.
Both the client and service code must 'speak' the same service protocol (e.g. telnet).
Well know port numbers are associated with specific services so that it is easier to write client code (you only need the server name and can assume the expected service is listening on the appropriate port).
If you configure your service to listen to another port instead of, or as well as, the well known port number then you know that any client that connects to that port MUST speak that protocol if any meaningfull communication is to take place.
e.g.
If you have a ftp server that you set up to listen to port 2000 and have a telnet client try to connect to port 2000 nothing will happen - they speak different protocols.
In short, the server dictates the protocol the client must use.
...cmk
Save the whales - collect the whole set
|
|
|
|