|
Sorry, you lost me after the start-a-thread-that-waits-for-a-connection-that-connects-to-a-socket thing...
Have a look at the MSDN samples chatter/chatsrv that shows socket basics and see if that helps. You'll find it here[^]
If things doesn't light up for you, post again and describe what you are trying to do and why you think you need multiple threads.
Perhaps you should derive your socket class from CAsyncSocket instead...;)
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
an application has a property-sheet with multiple pages, each page is associated with a thread.
when a thread is running, I hope the property-page containing the thread is always active (at top of other pages), or other pages can NOT be selected as active-page.
how to do that?
includeh10
|
|
|
|
|
To keep a particular page from being activated, return zero from OnKillActive() . The default is to return non-zero thus all pages can be activated.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
|
I have no experience yet in dialog based programming and i have this problem..
I have several edit boxes in a dialog wich take numbers and I want to calculate another number based on these. I put a button and made the function but the number doesn't appear. It's like the edit boxes are still in 0. Should I call something to take the values fron the edit boxes?
thanks
|
|
|
|
|
You have to get the text from each individual edit box. I usually have a member variable and just call GetWindowText() and store it in another variable.
In order for you to make calculations on this number use the appropriate data conversion routines.
|
|
|
|
|
If you're using DDX with MFC or WTL you should call UpdateData() before using the associated variables.
"dire io è lento, dire noi è rock"
rechi+
|
|
|
|
|
There are 2 ways.
let's say you make an addition between two controls, and return the answer into a 3rd editBox.
1. if you have member variables for you controls, do this :
UpdateData(TRUE);
m_Answer = m_LeftOperand + m_RightOperand;
UpdateData(FALSE);
if you access your controls by pointers, you could use the following :
CString strAnswer = _T("");
CString strLeftOperand = _T("");
CString strRightOperand = _T("");
CEdit* peAnswer = (CEdit*)GetDlgItem(IDC_ANSWER_EDIT);
CEdit* peLeftOperand = (CEdit*)GetDlgItem(IDC_LEFT_OPERAND_EDIT);
CEdit* peRightOperand = (CEdit*)GetDlgItem(IDC_RIGHT_OPERAND_EDIT);
peLeftOperand->GetWindowText(strLeftOperand);
peRightOperand->GetWindowText(strRightOperand);
strAnswer.Format(_T("%f"), ::atof(strLeftOperand) + ::atof(strRightOperand));
peAnswer->SetWindowText(strAnswer);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks very much, that helped..
|
|
|
|
|
I had designed a dialog box which is a "Find dialog"(what we generally see when we press "ctrl+f")..
Now in my application when i enter any " name" or "value" in the 'find dialog box',the focus should shift to that particular
place(name/value)..All the "name" & "values" are stored in the 'STL list'..I have to search those values/names and find out
whether the matching was found or not for the entered name/value in the 'find dialog'..
But the program is not responding properly..when i debug,the error shown is "Object Reference not set to an instance of an
object" for the "for loop" implemented..
for(iterator = member.begin(); iterator != member.end();iterator++)
Plz Help Me..
Thanks!!
|
|
|
|
|
I assume member is your STL list. What are the contents of the loop itself?
Bob Ciora
-- modified at 7:23 Tuesday 22nd November, 2005
|
|
|
|
|
Hi Guys!
Can anybody help me to change the background Color of a controll? I want to use a static controll and change the BG to white. I want to use it in my wizards...
Atrernativly, can somebody help me with panels? I have seen them in C# but I cant seem to locate them in C++. I am using VS 6.0! I know it is a bit dated, but any help would be appreciated!
Many thanks
|
|
|
|
|
It's easy to change the background of static control.
Just handle the WM_CTLCOLOR message.
Here is a sample from MSDN
HBRUSH CYourDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{
pDC->SetTextColor(RGB(255, 0, 0));
pDC->SetBkMode(TRANSPARENT);
hbr = m_brush;
}
As far I know there is no panel in VC++ 6.0.
But what you can do is.
Create a class derived from CWnd that can act as a panel.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Willem Le Roux wrote: Can anybody help me to change the background Color of a controll? I want to use a static controll and change the BG to white.
I have a semi-related example here, towards the bottom.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
hi,
i got a really annoying problem with my build utility in visual studio 6.0! everytime i try to launch my program (which has been compiled and linked correctly) by pressing CTRL + F5 i got a message that says some of my .obj files were out of date or could not be found and so i have to rebuild them (4 files). wtf? these files already exist and don't need to be rebuild!!! my project consists of about 60 files and only these 4 files produce this stupid message. why ??? there's nothing special about them.
is this a bug in vs 6.0 or just something that could be fixed with some compiler settings ?
thanks in advance!
-- modified at 6:55 Tuesday 22nd November, 2005
|
|
|
|
|
Hello.
Have a look at the timestamps on those 4 source files. That's one common cause of the kind of problems.
|
|
|
|
|
Have you changed any of those 4 files in a while? This might be caused by those files having a bad date...a date that's in the future and causing them to always be "out of date" since they're always newer than the final executable. Maybe try opening each of them, adding and deleting a space, then saving them back to disk.
Bob Ciora
|
|
|
|
|
no idea what exactly the problem was, but it seems that these 4 files haven't been modified for a little while and according to that they couldn't be generated well. if you ask me this doesn't make munch sense, but a little shift of some characters has solved the problem.
what a crap!!
|
|
|
|
|
Try to open those files in Notepad and then save it. This will help.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hello!
I am using Visual C++6, Enterprise Edition. My problem in editing is that, when I create a project everything works fine, however, after addition of some functions etc., the Automatic Statement Completion does not work. When I do it manually (writing down the code for member variables & functions)the program compiles and runs.
It is mentioned in MSDN that when there is a code error above the cursor the option will not be available. Since there is no compilation error how come there can be a code error?
Please help me if you can!
pani
|
|
|
|
|
pani68 wrote: Please help me if you can!
Close your workspace/project-> Delete [projectname].ncw and [projectname].clw file -> restart the project again, your auto complete featue will start working again!
"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
|
|
|
|
|
Thanks!
I did not get the .ncw file. My problem was solved after deleting .clw and .ncb files.
pani
|
|
|
|
|
pani68 wrote: I did not get the .ncw file.
I Mean .ncb file there, sorry for miscommunication
"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
|
|
|
|
|
I insert a icon to a listctrl's second colomn(subitem,not header),it show left,how can i make it show middle?
|
|
|
|
|
To my knowledge, I don't think there is an easy way. What I do is add a handler for OnCustomDraw and draw it manually.
"When you know you're going to eat crow, it's best to eat it while it's still warm." - Reader's Digest
|
|
|
|