|
Search for information on Windows Sockets. You should be able to find examples.
With sockets, on the server side try:
listen(socket, MAX_CONNECTIONS), after the call to bind().
Set MAX_CONNECTIONS with a define statement to some large value. I hope this helps you out.
Jerry
|
|
|
|
|
I must be missing something somewhere, but it isn't obvious to me with such an ambiguous error msg...
I've tried every connutation of line 79 "(WindowOne ->Create(NULL,NULL,WS_CHILD,);", but none seem to help, unless I actually comment it out.
Is there another section of code where I should go to make edit corrections?
I've tried deleting the offending line and recompiling before retyping it back in to no avail.
Any help/advice is greatly appreciated!
The offending code...........
void CSplashScreen::OnGo()
{
// TODO: Add your control notification handler code here
CWnd *WindowOne = new CWnd;
WindowOne ->Create(NULL,NULL,WS_CHILD,);//line 79
WindowOne ->ShowWindow(SW_SHOW);
}
Thomas
|
|
|
|
|
Try this
CWnd* pWnd = new CStatic;
pWnd->CreateEx
(WS_EX_CLIENTEDGE, // Make a client edge label.
_T("STATIC"),
"Dialog",
WS_CHILD |WS_TABSTOP | WS_VISIBLE |WS_CAPTION,
5, 5, 300, 300,
m_hWnd,
(HMENU)1234);
m0n0
|
|
|
|
|
Thanks very much! This works, and I'm sure I will be ale to put it to good use. A question regarding the use of CStatic...
I want to be able to access the window produced as if it were a List box. The item choosen from this list box will be applied to a second window which will bring up the properties of the item chosen from the first window.
Can I do this with the CStatic window just created?
Thanks in advance,
Thomas
|
|
|
|
|
i think u r missing a few parameters, just try this one;
void CSplashScreen::OnGo()
{
// TODO: Add your control notification handler code here
Rect rect(100,100,200,200);
CWnd *WindowOne = new CWnd;
WindowOne ->Create(NULL,"Window One",WS_CHILD,rect,NULL,NULL,NULL);//line 79
WindowOne ->ShowWindow(SW_SHOW);
}
You missed out the rectangle, and other few parameters, just try this one out.
Cheers
Nadir Maroof
|
|
|
|
|
Sorry i missed a thing, it is;
CRect instead of only Rect in the declaration, now ur code should look like this;
void CSplashScreen::OnGo()
{
// TODO: Add your control notification handler code here
CRect rect(100,100,200,200);
CWnd *WindowOne = new CWnd;
WindowOne ->Create(NULL,"Window One",WS_CHILD,rect,NULL,NULL,NULL);
WindowOne ->ShowWindow(SW_SHOW);
}
Hope this helps,
Cheers
Nadir Maroof
|
|
|
|
|
|
the MSDN tells us :
int CString::Delete( int nIndex, int nCount = 1 )
throw (CMemoryException );
...
Remarks
If nCount is longer than the string, the remainder of the string will be removed.
i thought the following line of code would work :
m_strDateDay.Delete(2, INT_MAX); but i'm afraid, it doesn't !!!
instead of this, it gives me an "Unhandled Exception in Prog.exe".
when i debug, i see that memcpy() is making the error within CString::Delete().
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
m_strDateDay.Delete(2, INT_MAX);
What does m_strDateDay.Delete(2, INT_MAX - 1) yield?
If that does not work, how about:
m_strDateDay = m_strDateDay.Left(2);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
actually, i've already tried with INT_MAX - 1 , and also with m_strDateDay.GetLength() (which i was certain at the moment that it was no longer than 5 chars).
i currently use CString.Left() , but i wanted to know if anybody had already encountered that problem, or could find a reason to that behavior...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
So these two statements do not work for you:
m_strDateDay = "12345";
m_strDateDay.Delete(2, INT_MAX - 1);
m_strDateDay.Delete(2, m_strDateDay.GetLength()); Is that correct?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
It's a bug. It has nothing to do with INT_MAX.
Actually, the exception is thrown if nCount is greater than the (number of remaining characters after nIndex) + 2.
SkyWalker
|
|
|
|
|
so what...?
should I mail Mr MSDN to tell him that its doc is not accorded with the libraries ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Are we all doing all the things perfectly? I guess not.
SkyWalker
|
|
|
|
|
but that's a document used by hundreds of thousands of people...
it needs a particuliar care ! don't you think so ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Cherie Carter-Scott used to say:
"Il n'y a pas d'erreurs, juste des lecons. Grandir implique un processus d'experience par essais et erreurs. Les experiences negatives font autant partie du processus d'apprentissage que les experiences positives."
SkyWalker
|
|
|
|
|
|
This issue has been fixed. I worked with David Lowndes to get word to the MS folks.
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=f649d7de-cfd9-4c50-b278-17dcf2678920
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
thank you very much...
well, the problem wasn't coming from me so !
now, i have to acquire MS Visual Studio 2005 beta to get it work
thank you again for tracing this bug to me.
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi Guys/Gals
I need a basic program in vc++ for serial communication where a message is sent from 1 pc to other thru the rs232 cable.Please help me as soon as possible.
|
|
|
|
|
How can i gray out a text in C++ .Net2003? The text is HTREEITEM text.
Thank you.
|
|
|
|
|
|
I have written class inherited from CString for doing arithmetic operations with huge numbers,but it takes too long to convert a decimal number to binary using standard algorithm(dividing on 2,...).
situation is like this:
i want to convert (for example)
CString g = "134.......45645675"; to Binary
//CString binary;
//binary=SOMEFUNCTION(g); binary = "10000100...10011"
can you give me any link where i can find information about converting from decimal to binary using shift left and shift right operaations,or give me any tipps,i think using these operations will make conversion faster.
Thanks in advance
m0n0
|
|
|
|
|
Giorgi Moniava wrote:
can you give me any link where i can find information about converting from decimal to binary
I found this in my toolbox. It's old so adjust as necessary:
void DWORD_To_BinaryString( DWORD value,char string[] )
{
for (int bit = 0; bit < 32; bit++)
{
DWORD mask = 0x80000000 >> bit;
if ((value & mask) == mask)
string[bit] = '1';
else
string[bit] = '0';
}
string[32] = '\0';
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|