|
1. Derive a Socket class from CSocket.
2. Override the OnAccept function. On Accepting the connection, call the any other function or handle it inside that function. normally we do this outside the class.
other connections will wait in the queue and will notify u again after accpetpting the first connection.
-Sarath
|
|
|
|
|
so u mean..CAsyncSocket wont work here??coz dats wat i hav used!
|
|
|
|
|
how do i make a class as singleton class.
|
|
|
|
|
class CSingleton
{
public:
static CSingleton* GetInstance();
private:
void CSingleton();
CSingleton ~CSingleton();
static CSingleton* m_pInstance;
};
In the cpp file:
CSingleton* CSingleton::m_pInstance = NULL;
.....
CSingleton* CSingleton::GetInstance()
{
if (!m_pInstance)
m_pInstance = new CSingleton;
return m_pInstance;
}
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
A simpler way:
--------------
// Console.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
class Single
{
public:
static Single& GetInstance()
{
static Single s;
return s;
}
void Method() const
{
cout << "Method called : this = 0x" << hex << this << endl;
}
private:
Single()
{
cout << "Instance created!" << endl;
};
};
int main(int argc, char* argv[])
{
Single::GetInstance().Method();
Single::GetInstance().Method();
Single::GetInstance().Method();
return 0;
}
--------------
This technique leverages the langauges rules: A static member is created the first time it's encountered. This way we don't need the "new" or the "if" or to remember to "delete" it.
Steve
|
|
|
|
|
Yes, that another way of doing it. Both techniques have their pro and cons. I remember having read an article that was discussing several singleton implementations but I don't remember the link.
Yours is great when it has to be used 'alone' because as you said you don't have to worry about releasing the instance.
But in some cases, this can lead to problems: if you have a singleton that is member of another singleton, then you get into trouble because you have no control over the timings of the destruction of the instances. In such case, you need to control yourself the scope of the instances.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
Thank You very much
|
|
|
|
|
hi,
can any one help me about how to send the message on mobile i;e SMS through VC++
regards
Mubeen
|
|
|
|
|
Geez ! It's the second time in one hour that you post your message. It's a forum here, not a chat. If you didn't get any answers, maybe it's because you don't give enough information.
As far as I know, a computer cannot send SMS. So, asking how to send SMS through VC++ is nonsense. First find something that can send SMS (for, that, I have no clue) and if you are stuck about how to communicate with this device (or whathever it is), then come back asking specific questions.
It's a programming forum here, not a phone company service .
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hi,
1st thing u can send or even reecieve data through pc even through low level programmong languages i thought that u are a software developer u must know such think but any way if u dont know (Very Strange)then update ur self that pc can send or recive data through Mobile,even using VC++ .right
2nd thing i know that it is not a chat but it is really urgent thats why i m sending the messages very quickly....
|
|
|
|
|
|
If you are looking for a function like ::SendShortTextMessage(LPSTR msg) , I'm really sorry.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
LOL. That guy is crazy.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
I suggest you can post your question once and you can see answers
whitesky
|
|
|
|
|
|
|
thanx for that but is there any way to send sms through instead with smart phone coz i m making an industrial project to automating the industrial processes and in between that i have to send the current status of different processes (output of Boiler, pressure senesor) to a resource person and for thati have to use net and mobile
And all this is the part and requirment 0f industry......
|
|
|
|
|
Here is an SMS toolkit that can be downloaded.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Thanku very much thats help me alot ......take care
|
|
|
|
|
HI,
If you right click on an EXE file and select properties.
Then in properties window there is a version tab which gives the information about
Compnay
Trade Mark
Internal Name
Version
Product Name
Product Version
How can I set these version proprties of my application's / EXE file.
Thanks
Regards.
|
|
|
|
|
open resources->Version->VS_VERSION_INFO
modify it.
Knock out 't' from can't,
You can if you think you can
-- modified at 2:54 Friday 19th May, 2006
|
|
|
|
|
Where this file exists
Regards.
|
|
|
|
|
zahid_ash wrote: Where this file exists
in resource section!
"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
|
|
|
|
|
Open the resource editor and expand the node for version .
double click the VS_VERSION_INFO child and their you have the window to set up all the entries.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|