|
There are numerous other libraries like it, such as Dundas. I suggest trying with google.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Dear Christan Graus,
what is Dundas?
|
|
|
|
|
|
Dear toxcct, I could not see any thing related to my question
|
|
|
|
|
Apart from the fact that they have banner ads here all the time ( looking at one right now ), what is google ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
nguyenhc wrote:
I could not use this to apply to dialog controls to make them have Windows XP Look and Feel when I run my application under Windows 2000.
I think you might be talking about XP's themed look. AFAIK, this is only available under XP.
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.1.2 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
If I test a console program (client_server) and it can work. But how to use the source code into the dialog application because when I use the console source code into the dilog that I designed, it can not send the string that I want. Can tell me how to use it in the dialog application.
|
|
|
|
|
This question is impossible to answer. Any code in your console app will probably translate to a dialog app, but the key thing is to put it in the right place in an event driven system so that it's called when you want it to be. Without seeing the code, it's not possible to say more.
1983ttj wrote:
it can not send the string that I want
What does this even mean ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Below is the code at the console application to send and receive:
// Send and receive data.
int bytesSent;
int bytesRecv = SOCKET_ERROR;
char sendbuf[300] = "Door Close";
char recvbuf[300] = "";
bytesRecv = recv( m_socket, recvbuf, 300, 0 );
prinf( "String Recv: %s\n", recvbuf );
bytesSent = send( m_socket, sendbuf, lstrlen(sendbuf), 0 );
printf( "String Sent: %s\n", recvbuf );
It will send a "Door Close" to server. I copy this into the dialog that to send "Door Close" when I click on that button, But I dont' know how to chage it so that it can send.
|
|
|
|
|
Why would you have to change it ? The code has nothing to do with dialogs, or consoles. If it worked in the console app, and it's getting called in the dialog app, it should work there, too.
Does the code compile ? Are you including the right header and lib files in your project ( if not, it won't compile ) ? Have you called WSAStartup ? Here[^] is the MSDN entry on the recv function, perhaps it can give you a clue what is in your console app, but you've failed to port to the dialog app ? I'm guessing you didn't write the console app ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
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.
|
|
|
|