|
It could be a number of reasons. One of the most usual is that you forgot to insert safeguards against multiple inclusion:
#ifndef CPRINTER_H
#define CPRINTER_H
#endif
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello,
I am learning socket programming in windows right now, however, I have some problems with the second parameter when I using this function: listen(socket, int). I don't understand what the second parameter for and how to use it. Thanks for someone to help!
Nachi
|
|
|
|
|
MSDN :
int listen (
SOCKET s,
int backlog
);
backlog
[in] The maximum length of the queue of pending connections. If this value is SOMAXCONN, then the underlying service provider responsible for socket s will set the backlog to a maximum "reasonable" value. There is no standard provision to find out the actual backlog value.
So its the number of pending connection on the server side, cos a listening socket is on server side!
its up to u to know how manny u need in the queue waiting to be served by the server!
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I am sorry, what do you mean pending connection? Would you mind to give me an example, let say Iset the blacklog to 3, what will happen? Thanks!
Nachi
|
|
|
|
|
Pending means waiting inthe queue on server side,
let say Iset the blacklog to 3, what will happen?
A maximum of 3 will stay in the queue untill they are served!
U can accept a conection with the accept function
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks for the explaination!
But what about the case "SOMAXCONN"?
Thanks!
Nachi
|
|
|
|
|
|
I have an Edit control for hex input, and I'd like draw it with spaces between every two characters (the user doesn't actually type any spaces):
43 4F 44 45 50 52 4F 4A ... etc
I'd rather not use SetWindowText to shove the spaces directly into the text, since I'd have to have special handling for editing, cutting, pasting, undo, validate and all.
Is it possible to do the formatting at display time instead? I looked through the MFC source and I didn't see any CEdit draw methods that I could override.
|
|
|
|
|
Look in the CEdit section here, there are several masked edit classes if memory serves.
|
|
|
|
|
The masked edit classes keep the literals within the data, and so they have to have special processing for all edit and cursor functions. I could adapt one of these useful classes to insert that space every two characters, but it seems like overkill.
I'd like to keep the text data the way the user enters it, and mess only with how it would get displayed. My idea is to grab the draw method for CEdit and override it with a function that formats a copy of the text right there, and displays it. I like minimal added logic.
Problem is, I don't have any idea where the CEdit control is drawing itself. I looked in the MFC sources and I can't find anything like CEdit::OnPaint(). Can anyone offer any clues on this?
|
|
|
|
|
Mabe you can handle EN_UPDATE and reset the text in the control to have every third letter a blank?
|
|
|
|
|
That's an idea I can try. Not as clean as I hoped, but if it does the job, I'll use it.
|
|
|
|
|
Hello fellas
Which GDI+ class lets you open a bmp file and draw it on your CView derived class? And will it take care of painting or do we have to keep re-rendering it in the OnDraw?
Regards,
Nish
p.s. I went through the GDI/GDI+ sections on CP. Haven't been able to find what I wanted
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
|
|
Ha! Straight from MSDN:
Image image(L"Grapes.jpg");
graphics.DrawImage(&image, 60, 10);
Go and do likewise...
|
|
|
|
|
|
Ok, more browsing through MSDN - try skipping the whole "new" thing, & using Bitmap::FromFile() to produce the Bitmap* .
|
|
|
|
|
|
Nishant S wrote:
I'd still have to delete it obviously
I suppose... If you really *want* to. But memory leaks help keep your computer healthy by ensuring the swap file gets plenty of exercise, right?
|
|
|
|
|
Shog9 wrote:
But memory leaks help keep your computer healthy by ensuring the swap file gets plenty of exercise, right?
Yeah, but I have VS.NET which takes care of leaking more than enough memory to keep the swap file in good health
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
I want to call a SQL Server stored procedure from my VC++ app that uses ADO (non-MFC). But the stored procedure takes an output parameter. How can i call this procedure and how do i retrieve the value of Output parameter when function returns ???
|
|
|
|
|
I want to have info all about Rich Text format, its headers and how pictures are represented using RTF. If there is any such article here then let me know please.
|
|
|
|
|