|
hello (it's my first time here) <(:oD)!
i've implemented a server-app installed on machine01. afterwards i've implemented a client-app and installed it on machine02. usually the server-app is running on machine01, but if the app terminates i want to start it agein from machine02.
is this possible, without having installed any additional services to manipulate with rsh, rexec, at-dos-command aso...?
i would be very greateull fpr any hints!!!
thank you,
have a nice day,
ciao,
stefan
|
|
|
|
|
stefanb wrote:
is this possible, without having installed any additional services to manipulate with rsh, rexec, at-dos-command aso...?
If you are talking about Windows 95/98/Me, then no, I do not believe it is possible. This is because of security - it would mean that *any* user could run arbitrary programs on client machines!
If you are using Win NT/2000/XP, there are some indirect ways of doing it... like starting up services, etc., if you can log in to the machine as a user with the appropriate priveledges. If you can log on as administrator, you may be able to write your own service, copy it over, and start it up. But that's pretty complicated.
You might try checking for Windows vulnerabilities - there may be some buffer overflows or something you could take advantage of.
No generalization is 100% true.
Not even this one.
|
|
|
|
|
stefanb wrote:
is this possible, without having installed any additional services
No.
Maybe you should look into a clustering (or even a simple load-balancing) solution? You could of course create something simple yourself by letting the server on machine2 ping (send "alive" packets) to the server on machine1. If the server on machine1 don't get these packets within a given time it would assume machine2 is dead and start serving the requests.
This would of course require the client application to either have a list of backup-servers to try, or initiate communications using multicast or broadcast.
|
|
|
|
|
hi,
how can i code such that all the messages recieved by a certain window is also recieved by any other window i wish.the other windows as well as the subject window are all created byhand?
also,where to put the stuff-to-be-put in OnCeate and other such functions in a hand coded control?
bye
|
|
|
|
|
What you say you want will not work, and I'm pretty sure you aren't really sure neither what you have requested nor what you want.
If you for some strange reason want to hang the app, you have to forward all Window messages to another window yourself. PostMessage and SendMessage. But, it will not work. If you're lucky you will just hang your app. If unlucky you will hit one of the bugs in the USER32 subsystem and hang the whole machine.
where to put the stuff-to-be-put in OnCeate and other such functions in a hand coded control?
OnCreate is just a handler for WM_CREATE. There are many examples of plain Win32 API programming in the SDK.
|
|
|
|
|
hi,
i am making a program ,to help my archealogist uncle in some research, to display some text in some ancient writings found in some inscriptions.i want to create new fonts for this purpose.
u c,this language has accent marks and also more importantly,the vowels and consonants unite to give a different symbol altogether-like the south east asian languages.
now how can i do that?i know Latin characters are easy to code-just use some font editor-but this type?
please help me.
|
|
|
|
|
If you just want this to be of limited scope, editing and displaying these character in your app, I think you're better off doing your own drawing and composing, and saving the data in your own specialized file format.
If you really want to create a font for this language, and generic ways to input this language using the keyboard, I think you'd have to both create a unicode font using a font editor - using only "free" unicode regions, possibly forcing you to use UCS-4/UTF-32 of which (AFAIK) Win32 has no support - and create some kind of IME (Input Method Editor).
The latter seems to me like an awful lot of work compared to do your own composing and drawing in a special app. Especially if you don't plan to release a Windows version localized to this language.
|
|
|
|
|
i have a listbox, and i added case-sensitive strings to it, like:
aA
AA
...
and when i click to AA, the selection moves to aA
i tried CListBoxCS, but as i understood the auther added only case-sensitive search to it... or maybe i dont understand something?...
please help me to solve this problem...
maybe i should use some other lists?
|
|
|
|
|
Hi all,
i want to change the Background Color of a Column.
this code gives me a Column Object of my Datagrid.
I can change the width of each coumn but how can i change the Bachground color?
CColumns cc = m_DataGrid1.GetColumns();
CColumn j0 = cc.GetItem(_variant_t( (long) 0));
thanks very much
|
|
|
|
|
You can use this datagrid:
MFC Grid control 2.23
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
I am trying got get the horizontal scroll bar to be displayed on a
list box, then the item text is wider than the list box, like the
vertical scroll bar.
Please can someone help me as I am very .
|
|
|
|
|
OK, this is a guess/from memory. A list box will be using the in-built scrollbars (which you cant get a ScrollBar* pointer to). You have to access and control them by using the CWnd scrollbar base class functions. You may also need to modify the style opf the list box to have the WS_HSCROLL style set.
Then you should be able to use the CWnd functions to control the scrollbar visibility/scroll range etc
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Create your list box with the WS_HSCROLL windows style ( Horizontal Scroll check box in the properties->Style page ) and then set the width with the SetHorizontalExtent() function. You can get the width of the text using the GetTextExtent() function.
HTH
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
Hi
I hope someone can tell me how to retrieve the exitcode of a thread the right way.
The code below shows how I retrieve the exitcode now.
But it doesn't work and i don't understand why.
DWORD exitcode = STILL_ACTIVE;
//set autodelete to false. This allows us to retrieve a handle for m_pThread.
m_pThread->m_bAutoDelete = false;
//tell the thread to end
m_pThread->PostThreadMessage(WM_STOPTHREAD, 0, 0);
//get the exitcode of the thread
do
{
bool temp = ::GetExitCodeThread(m_pThread->m_hThread, &exitcode);
Sleep(1);
}
while (exitcode == STILL_ACTIVE);
//when the thread has exited delete the CWinThread object
if (m_pThread)
{
ASSERT(m_pThread);
delete m_pThread;
}
The message handler for WM_STOPTHREAD looks like this
OnStopThread()
{
::PostQuitMessage(0);
}
|
|
|
|
|
Use WaitForSingle object instead of loop. WaitForSingleObject returns when thread is finished, or specified timeout is reached.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
could you give an example of this?
|
|
|
|
|
::WaitForSingleObject(pYourThread->m_hThread, INFINITE);
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
DWORD exitcode = STILL_ACTIVE;
//set autodelete to false. This allows us to retrieve a handle for m_pThread.
m_pThread->m_bAutoDelete = false;
//tell the thread to end
m_pThread->PostThreadMessage(WM_STOPTHREAD, 0, 0);
bool temp = ::GetExitCodeThread(m_pThread->m_hThread, &exitcode);
if ( exitcode == STILL_ACTIVE ) ::WaitForSingleObject(m_pThread->m_hThread,INFINITE);
|
|
|
|
|
Is this the right way to force a dialog to repaint it's client area?
CRect r;
GetClientRect(&r);
InvalidateRect(r);
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
Just call CWnd::Invalidate, which calls ::InvalidateRect and passes NULL as rectangle. In that case, complete client area is invalidated.
Why are you doing this to CDialog?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
|
Tomasz is right, in that calling Invalidate() will make the window eligible for repainting. But to force a repaint, you should do:
Invalidate();
UpdateWindow(); /ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks Ravi
It was basically for my demo app in my new article
By the way it repainted without the call to UpdateWindow()() on my Win XP prof
Maybe if none of the other threads or processes are busy an Invalidate() alone will do, but if the system is real busy, then we can force it by an UpdateWindow()
I am correct I hope
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
Yes, UpdateWindow() causes Windows to send a WM_PAINT message to an invalidated window, while Invalidate() cause WM_PAINT to be posted. I use UpdateWindow() to force a repaint when I can't afford to wait for the posted WM_PAINT to eventually arrive. It probably doesn't make a difference in your demo app.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi
How can i associate a file extension with my app?
i want that all double clicks will will open the files in the same instance of my app.
thanks
|
|
|
|