|
Here's the answer... FINALLY!!!
http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/wininet/tutorials/options.asp
And now it all works! Thx to all who have helped out!
/Tommy
|
|
|
|
|
I would like to initialize my static const variables as part of the declaration in the header (I am using VS7) - this seems to work fine for ints, but not for LPCTSTRs. For example:
class CFoo
{
static const int m_nStatic = 1; // This works
static const LPCTSTR m_pszStatic = _T("Hello, world!"); // This fails
static const char* m_pszStatic2 = "Test"; // This fails
};
In the above sample, I get the following errors when attempting to initialise the strings:
error C2864: 'm_psz...' : only const static integral data members can be initialized inside a class or struct
Obviously I can initialize the static strings outside of the class, i.e.:
LPCTSTR::CFoo m_pszStatic = _T("Hello, world!");
But I have always found this method cumbersome. I am a big fan of Scott Meyers Effective C++ book(s) and he cites example code that will initialise strings in the class declaration so could this be an MS compiler-ism? Perhaps there is a pragma?
Phew, for a minute there I lost myself.
|
|
|
|
|
Robert Edward Caldecott wrote:
could this be an MS compiler-ism?
Don't think so. Here's what Holy Book of C++ Standard says in 9.2, paragraph 4:
"A member-declarator can contain a constant-initializer only if it declares a static member (9.4) of integral or enumeration type"
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
OK. I have found I can initialize strings in the header and use the new MS __declspec(selectany) attribute to avoid errors if the header is included elsewhere in the project:
class CFoo<br />
{<br />
static LPCTSTR s_psz;<br />
...<br />
};<br />
<br />
__declspec(selectany) LPCTSTR CFoo::s_psz = _T("Yeeha");
This will have to do.
Faith. Believing in something you *know* isn't true.
|
|
|
|
|
I have developed a chat application and now I want to integrate voice chat in my application...but I have no idea how to start...can anybody help me in doing this?
Thanks in advance
Deepesh
|
|
|
|
|
Example : http://www.codeproject.com/internet/voicechat.asp
Donno if its good enough but u can try it.
U can achieve the same with directX
|
|
|
|
|
I have already gone through that code but I am still not able to understand the concept that how to implement it.
Anyway thanks for the reply..if you have some idea then plz tell me.
Deepesh
|
|
|
|
|
http://www.codeproject.com/internet/voicechat.asp[^] Might help you out
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
Do you know what Socket Notification Sink is ?
Sometimes, when my applications crashes, the message box that shows the fatal error has Socket Notification Sink as the title. When I run Spy++ and look at windows, under my app process is
Socket Notification Sink member....???
Thanks.
Celebrate Mr. Cesilko!
|
|
|
|
|
I've started a workspace without winsock support, but now, few weeks later, I want to add it.
Is it still possible, and how do I do it?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Project -> Add to project -> Components and Controls
and you'll find Windows sockets under C++ components. This is the easiest way in your case.
|
|
|
|
|
tnx
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Hi,
when is the last reliable possibility to send data to another application at the end of the program ? Destructor of FrameWnd, or destructor of CWinApp ??
Thanks
Celebrate Mr. Cesilko!
|
|
|
|
|
CYourApp d'tor will be called after frame window is destroyed, because application object is global and frame window is created dynamically.
Of course, when application destructor is invoked you don't have any documents/views/frames.
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Going through some files from another programmer, I found that he always put a using namespace std; in his public headers. Trying to limit the scope of the using I tried to move the using clause inside the class declaration
class C
{
using namespace std;
}; but it results in a compilation error on VC6.0 sp5. But it shouldn't!? Anyone have an idea here?
(I finally qualified every single item from the std namspace.)
|
|
|
|
|
Niklas Lindquist wrote:
But it shouldn't!?
Why?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I suppose, since you may limit the scope of using to within any other scope, like functions, other namespaces, limited scopes with a { and a corresponding }, it should be possible to us it within a class declaration. That was at least what I thought. Why may I use it within, what seems to be any other scope, but not within a class or struct declaration?
|
|
|
|
|
Niklas Lindquist wrote:
Why may I use it within, what seems to be any other scope, but not within a class or struct declaration?
Well, you can't use it because C++ Standard forbids it explicitly:
"A using-directive shall not appear in class scope, but may appear in
namespace scope or block scope." (C++ Standard, 7.3.4).
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Thank you. I feel better now
Do you have any idea why it is has been forbidden? I can't see any clear reason. Does it introduce any problems, and if so what?
|
|
|
|
|
Niklas Lindquist wrote:
Do you have any idea why it is has been forbidden?
I was able to find some discussions on that using Google newsgroup search, but none had satisfactory answers. If you accidentally meet Bjarne in the pub, ask him and let us all know
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Will do!
Thanks for the help.
|
|
|
|
|
Hi All,
I'm working on an application that would get system information for each machine on a network and report it back to the central database.
I was looking for a function to get the CPU Speed (MHz), however couldn't find one.
Are there any functions that would return the CPU speed? (Using Win API to do this.)
Thanks.
Regards,
Venet.
Donec eris felix, multos numerabis amicos.
|
|
|
|
|
Have a look at this[^] Venet. Might help
Actually.. This one might be better http://www.codeproject.com/system/sysinfo.asp[^]
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
Thanks Brian,
Looks good.
P.S. I hope you got my e-mail yesterday on snet? MY ^D is assigned to SoftICE!!!
Regards,
Venet.
Donec eris felix, multos numerabis amicos.
|
|
|
|
|
Venet wrote:
MY ^D is assigned to SoftICE!!!
What ya using SoftICE for???? I presume it's TSSG's copy?
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|