|
install PsService[^] on the calling machine, then use it like this :
psservice \\192.168.0.15 -u the_user -p the_pwd start the_service
|
|
|
|
|
toxcct wrote: psservice \\192.168.0.15 -u the_user -p the_pwd start the_service
How would the data pass back to the calling machine (PC-B)?
|
|
|
|
|
which data ?
have you tested it ?
here, we use it in all our servers architecture, so, it works well !
if you want more detail about it, maybe you should have a look at the API used by its author :
How it Works
PsService uses the Service Control Manager APIs that are documented in the Platform SDK.
|
|
|
|
|
When my MFC application is run, it invokes a dialog. Though I have removed the OK and the cancel button from the dialog my dialog can be dismissed by pressing the esc key. is there a way to prevent the default behaviour of the escape key to be overwritten.
Also i like to dismiss the dialog by posting a message after some time. how to I post a destroy message to the dialog.
|
|
|
|
|
Hmm, have forgotten how to do they escape key bit, there's a function in one of the MFC classes your Dialog is deriving from that turns Esc into a WM_CLOSE, you need to override that or prevent it being called, a PreTranslateMessage override might be able to do it.
When it comes to closing the Dialog your best bet is probably to use a timer, MFCs timers are fine and when it goes off use PostMessage to have the dialog send itself a WM_CLOSE. Don't use SendMessage or things may go horribly wrong when you return to run code in a deleted dialog.
If the dialog closing is conditional then set your timer to a short period, like a 10/th of a second and check the condition. If it's not met just set the timer again.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
tom groezer wrote: When my MFC application is run, it invokes a dialog. Though I have removed the OK and the cancel button from the dialog my dialog can be dismissed by pressing the esc key
Override PreTranslateMessage , for instance
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if ( pMsg->message == WM_KEYDOWN )
{
if (pMsg->wParam == VK_ESCAPE)
{
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
BTW probably you'll have also to handle RETURN key.
tom groezer wrote: Also i like to dismiss the dialog by posting a message after some time. how to I post a destroy message to the dialog.
What about a TIMER ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
In this context how do I destroy the window.
|
|
|
|
|
nothing forbids you to overload the WM_CLOSE event or to create your own button which will call EndDialog(IDC_CANCEL) for instance...
|
|
|
|
|
Is there any way to find current MMC's version on a system, Does there any "registry key" or win32 API exists to find that?
Thanks,
Mushq
|
|
|
|
|
|
Why cant we have a Virtual Constructor ?
Anandi VC
|
|
|
|
|
Think what you can/are going to do with that.
|
|
|
|
|
Well ... What do you think you can do with a virtual constructor?
|
|
|
|
|
this question has been asked tons of times.
look in the FAQ please !
|
|
|
|
|
Anandi.VC wrote: Why cant we have a Virtual Constructor ?
What would you expect this constructor to do?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hi,
I have created a com dll for context menu and want to add icon. So could you please tell me how "DefaultIcon" can help me?
I have used SetMenuItemBitmap(), but could not succeed.
|
|
|
|
|
I deveplop an application under Windows XP pro editon,
It can't run under Window XP home edition, I copied the dependency dlls with the exe.
why?
|
|
|
|
|
Is this Win XP problem or the vcredist need to be installed in the WinXP HE.
I personally don't prefer the messy way of copying dependency dlls. Try install the appropriate VC redistribute package of your development VS Version.
|
|
|
|
|
|
In which version of VC you developed?
web search: Vc redistribute <your vc version>
|
|
|
|
|
|
followait wrote: Any doc?
Thanks.
Hope this helps: Download VCRedist[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
followait wrote: It can't run under Window XP home edition
do you have any error message my any chance ?
|
|
|
|
|
Hello friend,
I am using VC6.0 IDE.
I have created MyDll.dll and write one exported function as below.
#ifdef TNS_EXPORTS
#define MyDll_API __declspec(dllexport)
#else
#define MyDll_API __declspec(dllimport)
#endif
...DllMain()....
extern "C" MyDll_API int CALLBACK DLLPRoc(char *pMsg,int nVal)
{
MessageBox(NULL,"DLLPRoc","MyDll_API",MB_OK);
return 1;
}
Inside Main.cpp
typedef int (CALLBACK *MYPROC)(char *pMsg,int nVal);
int Proc(char *pMsg,int nVal)
{
ret
}
int main(int argc, char* argv[])
{
HINSTANCE hIns=LoadLibrary("..MyDll\\Release\\MyDll.dll");
if(hIns==NULL)
return 0;
MYPROC pProc=(MYPROC)GetProcAddress(hIns,"DLLPRoc");
pProc=&Proc;
}
My problem is Proc doesn't receive acknowlegement.
I want the Proc will continuosly run as a callback procedure and receive the messages inside DLLProc in MyDLL.
Please give me suggestion and if po
ssible give some sample application
abhi
|
|
|
|