|
It works in console but when I compile at dialog it hang there. It can connect between server and client but when come to send and receive, it hang there. I already add the lib
|
|
|
|
|
Then there is code in the console app that's not being called in the dialog app, simple as that. I'd guess at the initialisation function I pointed out in my last post.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I already do the initialisation function that you pointed in last post which is WSAStartup. For the console, it is printf but for the dialog it is not printf right?
|
|
|
|
|
Hello,
May I suggest an MFC tutorial or two? Try reading here[^] for a start. If you get stuck, google, MSDN and CodeProject are your friends.
From what I read in your posts, your main problem is that your code is not properly structured. My guess is that you put almost everything in your main . Try and put all your code in classes: CClient and CServer for example. Doing this, enables you to reuse your code in a dialog app for example.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Like the other guy said, you're obviously lost at sea. Why would printf not work in a dialog app ? What were you using instead ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi folks,
I got a problem with CFileDialog .
This is my code:
CFileDialog dlg(TRUE, 0, 0, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "Text files (.txt)|*.txt||");
if (dlg.DoModal() == IDCANCEL) return;
And this is my problem:
When I open this dialog the first time, everything works fine.
But when I open it the second time (just after I selected a file in the first run) both the CFileDialog and my dialog-based application disappear.
The error occurs right when the CFileDialog wants to show a small 'tooltip'(?) window in wich some file information is presented. The same small window is shown in the first run without any problem, but in the second run my application crashes just when the window is to be shown.
In debug mode I get the message 'Access violation in Shell32.dll'.
Any ideas what's going wrong ?
Unfortunately I got none...
Thanks
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
I don't know if 'tooltip-window' is the right name.
The window that I mean pops up, when you move your mouse pointer over a filename and wait a little moment.
It shows:
- Type
- Time of last write to file
- Size
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
Hi folks,
the code wasn't buggy. After I had restarted my system the dialog worked fine again.
Regards
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
My apologies if I put this in the wrong place, wasn't sure...
I built an install for an app using .Net, and it works ok, but for some reason, when you click on the desktop shortcut it creates, it refreshes the the desktop icons a couple times before running the actual program. Not too big a deal, but it does look a little weird to the user.
Any ideas why that may be happening, or thoughts on where I might move this?
Thanx,
Rick
|
|
|
|
|
I was told to try this to "continue" by pressing any key:
cout << "PRESS ANY KEY TO CONTINUE";
getchar();
This only works with the enter key. Any other ideas? I'm a complete newb to C++.
Thanks
|
|
|
|
|
Sorry, this is a console app.
|
|
|
|
|
Use getch().
Iman Ghasrfakhri
|
|
|
|
|
Thanks that worked! I have one more small problem. I display press any key to continue again at the end and then it should close. However, I get "Press any key to continue . . ." and have to hit enter again. Here's what I have toward the end of my program:
cout << "PRESS ANY KEY TO CONTINUE";
getch();
system("PAUSE");
return 0;
Thanks
|
|
|
|
|
Remove the system("PAUSE"), thats the batch command for "Press any key to continue . . .". The program will wait on getch until a key is pressed.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
My monitoring program needs to locate a file held by another application ,apply DuplicateHandle() on it and read certain portions of that file.
This seems like a long way to achieve a simple task - but normally - not
all monitored application would share that file as they open it.
So - I do not have any other choice but - to grab the file handle , duplicate it
and read what I need for monitoring (do I?)
The file name is known in advance (and even the process name / ID can be determined in
most cases...)
How can I carry out this task?
Thanx
Hillel.
|
|
|
|
|
Hi,
I am trying to select the full row of a listview control.What I am doing is setting the extended style to
FullRowSelect , then deselcting all rows, then selecting a certain row. My code looks something like
this:
ListView_SetExtendedListViewStyle(hWnd1,LVS_EX_FULLROWSELECT);
ListView_SetItemState(hWnd1,-1,0,LVIS_SELECTED);//deselect all
ListView_SetItemState(hWnd1,LVIS_SELECTED ,LVIS_SELECTED); //select a row
What happens is that I end up with multiple rows selected. Please help me on this problem ASAP.
Thanks in advance.
Ayon
|
|
|
|
|
I have a problem with Rational Robot.
I can not record IIOP requests.
Should I install any DLL?
Please help me.
Thanks very much.
|
|
|
|
|
How will i be able to truncate a string by 1 then append another 1 into it?
Ex:
str1 = "Happy!";
str2 = " Birthday";
str3 should be "Happy Birthday" //str1 will be cut by 1 character
I tried to forcefully terminate str1 by placing '\0' on the loc of '!' (which is str1.GetLength() - 1). '\0' must be the mistake, I don't know how to adjust the string terminator. Thanks
|
|
|
|
|
str1 = str1.Left( str1.GetLength() - 1 ); is one possibility.
Don't try it, just do it!
|
|
|
|
|
Alexander M. wrote:
str1 = str1.Left( str1.GetLength() - 1 );
it didn't work, i also tried to put /2 on GetLength but to no effect. What is the character symbol of a string terminator?
|
|
|
|
|
benjnp wrote:
str1 = "Happy!";
str2 = " Birthday";
try this
CString str1,str2,str3;
str1 = "Happy!";
str2 = " Birthday";
str1.Delete(str1.GetLength()-1,1);
str3=str1+str2;
MessageBox(str3);
"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
|
|
|
|
|
Try this:
CString str1,str2,str3;
str1 = "Happy!";
str2 = " Birthday";
str3 = str1.Left(str1.GetLength() - 1) + str2;
The code above assumes that str1 has at least one character.
-- modified at 6:21 Monday 19th September, 2005
|
|
|
|
|
How will I be able to activate the shortcut keys on the menu of a dialog-based MFC project just like on SDI/MDI?
|
|
|
|
|
whats problem? Have you tried accelerators?
|
|
|
|
|
yup, i tried using accelarators and their not working at all
|
|
|
|