|
My server application may freeze and stops responding. So a second application continuously monitors it after every few minutes. If second application is unable to get a response from the server application, it assumes that the server is dead and then need to take control of the port and itself start listening for a temporary period.
Is it possible that the second app start listening on a port already bind to the previous app ??? If yes, then how ??
|
|
|
|
|
Nope.
A port has to be released before you can bind to it again.
If you manage to kill the other process and then wait for the
"port shutdown timeout" (forgot what's actually called) then you
can reuse the port.
"You can stand all night at a redlight anywhere in town, hailing Marys left and right but none of them slow down. I've seen the best of men go past. I don't wanna be the last..."
|
|
|
|
|
Hi All,
I need to know a way to programmatically know how we can determine the file system on the system disk. Is there any API available which can be used to determine the file system.
Thanks and regards,
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
Call GetVolumeInformation() - one of the things it returns is the name of the file system.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Is there a better way to updating the first pane in a MFC statusbar than just calling it's SetPaneText function when you want it changed? An UI update handler somehow?
And when exactly does MFC change it to "For help, press F1" and is it possible to change that?
|
|
|
|
|
If you look in tech note 27 in the Visual C++ 6 docs, it talks about WM_SETMESSAGESTRING, which is a
MFC defined message sent to the CFrameWnd. In 99% of cases, this will be CMainFrame. The handle for
this message then tells the status bar what to display. You could simply send this message yourself.
As for your second question, CFrameWnd has a handler for the WM_MENUSELECT to get the current menu
item, and extract the text from the string table.
I hope that gave you some pointers,
Iain.
|
|
|
|
|
Hi,
When a Win2K or XP computer waits for you to press Ctrl+Alt+Del to log on, Windows displays a virtual keyboard if you press another button.
Is it possible to display this keyboard in my own app?
Best regards
/Nyrup
|
|
|
|
|
It's an "AVI" resource in msgina.dll
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi,
Thanx for your fast answer!
An AVI..... sad... I had hoped for an interface, so I could point on other keys. I guess I don't get this feature without some effort
Thanks again
/Nyrup
|
|
|
|
|
Hi all. I really need some help.
My problem is with inheritance. I have a class type that I want to use several times over for a few VERY similar structures (only 1 variable different). The class mainly contains a linked list, however I don't want to re-write many of the functions just to support the ONE different data type. I have tried doing it this way without success:
<br />
class cGeneric<br />
{<br />
public:<br />
typedef char* DataType;<br />
<br />
struct Node<br />
{<br />
DataType Id;<br />
char *pData;<br />
Node *pNext;<br />
};<br />
<br />
Node *First;<br />
public:<br />
<br />
bool AddItem(DataType Id, char *pData);<br />
<br />
...<br />
<br />
class cExtention : public cGeneric<br />
{<br />
public:<br />
typedef int DataType;<br />
<br />
struct Node<br />
{<br />
DataType Id;<br />
char *pData;<br />
Node *pNext;<br />
};<br />
<br />
Node *First;<br />
In the AddItem function, it just passes the Id (either char* or int) to another function. I know this doesn't work (it reads the information for AddItem from cGeneric since it isn't redefined in cExtention, and so therefore expects a char*) however I would like to know if there is another way to do this.
I haven't done much OOP and I find it a little difficult to swallow at times.
If anyone has ideas of how I could do this, I would greatly appreciate your feedback.
Lord Morlock
~o~
|
|
|
|
|
This is what templates were designed for.
template <typename DataType> class CGeneric
{
};
typedef CGeneric<int> CExtension; As long as AddItem() can deal with an arbitrary type, you're set.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks heaps! I knew there'd be a way... I just don't have any class oriented books for C++ atm .
One more question, I assume templates are C++, not just MS?
Thanks again.
Lord Morlock
~o~
|
|
|
|
|
Lord Morlock wrote:
One more question, I assume templates are C++, not just MS?
That's correct.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Please help me with this situation that I have. How can I detect which version of Windows is running, that is , is Windows 95, 98 ,2000, ME, XP or NT is running?
Regards
Nashdaq
|
|
|
|
|
Call GetVersionEx() , which fills in a struct with the version numbers and 9x/NT flag. MSDN has a table showing which version corresponds to 95, 98, etc.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
hi i am new to Visual C++.Net.
i am uing a Document Window and it's needed to show some information to user Such as Score.
to aim this i have to Show a Dialog Box and Show this information on it.
i don't know which kind of Dialog box is UseFul for this reason (i mean i use this Dialog box only for Monitoring the information)
i know that i have to Creat a Class for that Dialog and then Creat a Variable of it and set Var.DoModal(); but it's not work can someone help me ?
-=Ehsan-de-Burge=-
|
|
|
|
|
i haven't worked on vs.net but in vc++ vs6.0 we do it like this::
1: add a dialog to the resource.
2: using classwizard add a class to this dialog resource.
3: in initinstance() write
CDialog1 dlg;
dlg.domodal();
4: or whereever you need this code i.e. if yo want to show this dialog at click of an button add this code to the message handler of that button's click event.
that's it.
i hope you get an idea of how to proceed.
cheers..
Himanshu
|
|
|
|
|
thanks for your answer. if i use a Dialog as CDialog Base Class then i can't use this Dialog for Moitoring the information. i want to Use a Dialog for monitoring (so the Focus is always Set on the Main Window and this Dialog never Gets Focus)
may be using Dialog for this reason is wrong. what should i do ?
|
|
|
|
|
my question:
in my app,i want to print some text by a bitmap.and the text is dynamiclly changed when printing .
now i want to do so:
build a temporary bitmap, load the bitmap and text out some text to the
bitmap ,and save bitmap .then if i use ACDSEE to look at the bitmap we can find the text in the bitmap;
but how can i do ?i want to programe a general function;
bool TxtToBitmap(CString &strBmpFile,CString &strOutputText)
then after i use the function ,i want the strBmpFile can include the strOutputText
who can help me?thanks!!
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
at www.aoi.it, there is cximage (v5.50) with a DrawText method.
|
|
|
|
|
dear all,
i want my mfc dialog based application to detect system shutdown.
is there any way to do it?
thanx
|
|
|
|
|
Handle the WM_ENDSESSION message, you can examine the parameters to tell if it's a shutdown or just the user logging off.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
(hi,
I used following lines of codes::
CString strEdit;
GetWindowText(strEdit);
but it is giving an error as ATL::GetWIndowTextA() cannot convert parameter 1 from Cstring to unsigned short**. But when I type it is asking for a Cstring only.
can anyone help me out!!!!!!!Please...
Himanshu
|
|
|
|
|
The ATL function CWindow::GetWindowText() doesn't work with CString s, since CString is MFC. You need to pass a BSTR or a CComBSTR (easier to use, it handles memory management for you).
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
thanks a lot Mike. It worked.
cheers..
Himanshu
|
|
|
|