|
I'm looking for a solution to start an EXE-file, which exist on other network-PC.
I've tried to work with the "_spawnv( nOption, prog, args )" function, this works ok when the EXE-file is on the same PC, but doesn't work when the EXE-File exist on other PC.
If anyone has a solution or a suugestion, I would be glad for a short response!
Thanks a lot
Ralph
|
|
|
|
|
You could try using DCOM or RPC
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
|
The only build-in way to run an exe on another NT/2k/XP machine is to register it as NT service (CreateService()) and then call StartService() to run it.
However, your exe should be graceful to SCM and behave like a service, else StartService() would return an error and the event log get's clutterd with error messages. However, that's not really much work to do.
Next point to consider is who should be able to run the thing. Services have an DACL which controls who is allowed to start and stop them. You can find a tool to change a service DACL (it's called "scacl.exe" and part of my LS-Tools freeware collection) on my homepage.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
I'm working on view that should display some graphic charts.
I've derived my view from CScrollView.
Is it possible to change size of horizontal scroll bar of view: i want insert some buttons in bottom-right corner of view.
thanks in advance.
nobody is perfect
|
|
|
|
|
To do this you will have to replacethe standard scrollbars used by the scrollview, Add 2 CScrollBar controls to your inherited view, create them and override the GetScrollBarCtrl() virtual base class function, and return the correct pointer for SB_HORZ and SB_VERT.
I think that is the first step in doing what you want!
Roger Allen
Sonork 100.10016
He dodges, he weaves, and he never gets enough sleep. He is kind to small animals. - Chris maunder.
You can tell from his picture he doesn't sleep, and what kind of things does he weave?
|
|
|
|
|
I have a COM smart ptr (IMessagePtr) and I would like to keep a vector of them. Is it advisable to make a vector<IMessagePtr>?
I am a bit weary of STL with smart pointers. Does anyone know of any issues with the above vector?
Jeremy.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
If i'm not wrong you need to use the ATL Class CAdapt to return the adress of the ptr itself and not of the smartptr like this:
vector<CAdapt<IMessagePtr>> x;
Cheers,
Joao Vaz
A Programming Language is a tool that has profound influence on our thinking habits -The late giant Edsger Dijkstra 1930 - 2002
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary. -
|
|
|
|
|
If MS overrode the & operator, then yes, you have to use CAdapt.
Tim Smith
"Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
Hoare - 1980 ACM Turing Award Lecture
|
|
|
|
|
Tim Smith wrote:
overrode the & operator, then yes, you have to use CAdapt.
Yeap, I did checked this after your reply at
ATL archives[^]
Cheers,
Joao Vaz
A Programming Language is a tool that has profound influence on our thinking habits -The late giant Edsger Dijkstra 1930 - 2002
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary. -
|
|
|
|
|
ATL archives[^]
Cheers,
Joao Vaz
A Programming Language is a tool that has profound influence on our thinking habits -The late giant Edsger Dijkstra 1930 - 2002
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary. -
|
|
|
|
|
Retrieve prompt message in a file from command MsDos
Hi,
I create a batch file , execute the batch file with shellexecute and I would like to retrieve the prompt message to a file for checking the status of the processing.
Best Regards
youssef
|
|
|
|
|
Try ShellExecute(NULL, "open", "bat_file.bat", ">out_file", NULL, SW_HIDE);
rechi
|
|
|
|
|
Hello
I want to save information on my application using MFC and not SDK functions like WritePrivateProfileString()
Any help?
Thank you
|
|
|
|
|
See CWinApp::WriteProfile[Int|String|Binary]. These methods write to .ini files and registry, depending on call to CWinApp::SetRegistryKey.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Hi,
Can any one tell me if/how to shutdown windows from VC. I want it as I often leave my PC running gathering results, but I would like the PC to powerdown once it has finished getting the results.
Cheers,
Nick;P
|
|
|
|
|
Checkout the PSK for the System Shutdown Functions. ExitWindowsEx() or InitiateSystemShutdownEx() should do the job.
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
Use ExitWindowsEx (its in the Platform SDK). However if you are running NT/2000/XP you must use AdjustTokenPriveges first to enable the the SE_SHUTDOWN_NAME privilege. You also need to make darn sure that you have saved any data before initiating the shutdown because once the process starts you may not get the chance!
JohnJ
Life is hard and then you die!
http://www.rainbow-innov.co.uk[^]
|
|
|
|
|
To powerdown the PC you need to call ExitWindowsEx(). (The more fance InitiateSystemShutdown(Ex) API is not able to powerdown a machine )
You need to enable the SE_SHUTDOWN_NAME privilege first using AdjustTokenPrivileges().
However, if you are not that much interested in the details, but just want to put it to work, take a look at the down.exe command line tool from my LS-Tools freeware collection (Link below). You can just spawn it as external program and it also allows you to suspend or hibernate the machine and much more things.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
OS: US Win2K, locale: US, VC++ 6.0
I have been developing an internation app (5 langs) and cannot use UNICODE strings, only ANSI. At runtime user changes the app language:
- creation of the font with the Russian_charset
- assigning the font to controls
- redrawing the dialog
Standard Windows controls (button, radio, checkbox, static) display BAD characters. It seems controls are using default US charset and not russian charset.
I have OWNER-DRAW controls in dialog and these controls display Russian text CORRECTLY.
When I draw ( pDC->DrawText(.....) ) some russian text using font with russian charset it display the text OK.
Here's an example of my code:
///////////////////////////////////////////////////////////////
// constructor of dialog
fnt = new CFont(); // dynamically creating font
LOGFONT lf;
....
lf.lfCharSet = RUSSIAN_CHARSET;
....
fnt->CreateFontIndirect( &lf );
/////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// OnInitDialog
....
GetDlgItem(IDC_RADIO1)->SetFont( fnt );
....
GetDlgItem(IDC_RADIO1)->SetWindowText( str );
/////////////////////////////////////////////////////////////////
Has somebody any idea how to solve my problem????
Thanks in advance
Miro
|
|
|
|
|
How should MSVC++ 6.0 project executable be compiled to enable WindowsXP ClearType antialiasing in its controls?
Cryst
|
|
|
|
|
I forget the criteria for ClearType rendering, but if you use a good large TrueType font in all your controls AND the system is configured to use ClearType by default, then it should work i'd think. Or, you could probably force it by using the CLEARTYPE_QUALITY quality flag when creating the font.
---
Shog9
If I could sleep forever, I could forget about everything...
|
|
|
|
|
After I added the IProvideClassInfo interface to my objects. It can run now. However, for the script below, it runs correctly.
-------------------------------------
dim cnt
set cnt = Application.Documents
-------------------------------------
However, for the code below, it raised runtime error:
Object required: 'Application.Documents.Count'
-------------------------------------
dim cnt
set cnt = Application.Documents.Count
-------------------------------------
In Documents, I've already implemented a property Count for the enumeration.
STDMETHOD(get_Count)(LONG* pVal);
Anything wrong ?
|
|
|
|
|
dim myobj,cnt
set myobj = CreateObject("Application.Documents")
cnt = myobj.Count
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Hello,
I have various child control windows in my CDialogBar derived class and would like to make intializations to them after the DialogBar windows have been created. What message should I use? WM_INITDIALOG is not available to CDialogBar.
Thanks!
JennyP
|
|
|
|