|
If you don't know how to create a modal dialog box, I think you REALLY need a good book about MFC, because this is really the basics. Take a look at the DoModal function (if I remember correctly, people have already suggested that earlier, so why didn't you do it ?)
|
|
|
|
|
You have to create a modal dialog box. See the literature for DoModal()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I suggest to read some good book for learning MFC.
For your current issue check this link Tutorial MFC Dialog Boxes[^]
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
I've problem using DDX variables for controls in a dialogbar.
In VC6 it was possible to associate a DDX variable (control type)
to a control being part of a dialog bar. In that way, I could
perform an override of some control's functionalities using
a MyClass instead of the tipical control class.
So... in VC6 there was no differences between Dialogs and DialogBars
with DDX controls.
Now I work in Visual Studio 2008. It seems that I cannot create
a DDX variable (control type) for a control being part of a dialog bar.
Is it true ?
If I force it using Attach and Detach methods, it still doesn't work
(MyClass instance doesn't receive Windows messages sent to the control).
How can I specialize the behaviuor of a control being part of a dialog
bar in Visual Studio 2008 ?
Thanks
|
|
|
|
|
Hi,
I want to take hex dump of a string and print like "00.ff.2e:3f:00:4d". Is there any api available in 'C' or 'C++' ?
Thanks,
Sakthi
Nice things do nice works
|
|
|
|
|
Well, there are keywords & functions, for instance: strlen , for , printf .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Code:
printf("%02d:%02d:%02d:%02d:%02d:%02d\n", 0x00, 0xff, 0x2e, 0x3f, 0x00, 0x4d);
printf("%02x:%02x:%02x:%02x:%02x:%02x\n", 0x00, 0xff, 0x2e, 0x3f, 0x00, 0x4d);
Output:
00:255:46:63:00:77
00:ff:2e:3f:00:4d
|
|
|
|
|
for me, why happens like this below,
ffffffde:0e:6e:28:53:3d:ffffff88:0d:ffffff87:ffffffc1:ffffffe7:
4f:ffffffe8:ffffff9d:ffffff84:ffffffe8:3d:06:ffffff81:ffffffe0:
ffffff8f:ffffff9a:77:08:75:3d:fffffff1:38:45:ffffff8f:ffffffe8:
ffffffad:03
Thanks,
Sakthi
Nice things do nice works
|
|
|
|
|
Hint: you're probably using signed data types.
Hint2: FFFFFFDE is -34 (i.e. 222 if unsigned char ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
I am working on a client server application.
I am having a challenge that i have to serve the 250 client concurrently. Each request takes 2-5 second to execute at server side.
For this what should i use 1 PIPE implementation or SOCKET with a queue? and why?
Which performance is better.
Thanks
|
|
|
|
|
i think if you have to use udp mode, socket might be better.
otherwise i am afraid pipe is better because you just open and close a connect with every client but there would be more operations for socket.
just my own opinion.
|
|
|
|
|
hi,
U can use the following arch if u think this better. go with TCP/IP.
1. create one sock which will be in listen mode.
2. once u got a connect request, create one sock and thread dynmically and bind with the requested client. this socket will serve for that client only.
this can be implemented in multithread mode where on thread always listen for client, and each thread will serve for perticular client.
-Parthi
|
|
|
|
|
I will suggest to use IO Completion Ports with sockets.
i will not advise to have 250 threads for 250 clients...
Search CP with IOCP you will get many good articles..
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
Thanks for the input,
Will it work for the different platform.
I am to create the server for WINDOWS, Linux and MAC.
Thanks
|
|
|
|
|
singh_nav wrote: I am to create the server for WINDOWS, Linux and MAC.
No..
I dont know anything that will work with all three platforms.
I don't understand why server needs to be built for different platforms.
You can have a server on one platform and you can built clients on different platforms.
Your application might have that requirement but just a opinion.
Regards,
Sandip.
|
|
|
|
|
thanks,
Actually my application is build for all these platform.
And i want to design all code into one application, that time i just need to build at different platform only to support it.
Thanks again
|
|
|
|
|
|
Hi all
How do I get my IP address by code? Whats the shortest way possible? I tried getenv but I found out not every computer has their IP add in their environment variables.
Thanks,
Jayjay
|
|
|
|
|
get host name first and then get the details. The following code might be helpful:
char host_name[128];
hostent* host;
gethostname(host_name,128);
host = gethostbyname(host_name);
printf("The local host: Address : %s\n", inet_ntoa(*(struct in_addr*)host->h_addr));
Regards
|
|
|
|
|
Hi kcynic,
the gethostname didnt fill up the host_name. Is there a requirement before using your code?
Thanks,
Jayjay
|
|
|
|
|
did you forget to call WSAStartup?
|
|
|
|
|
Hi kcynic,
It is working now however there is no h_addr just h_addr_list[0] in the struct of hostent, I still can't find the ipadd. Whats your advise on this?
Thanks,
Jayjay
|
|
|
|
|
Hmm, interesting.
With the following code compiled and linked with wsock32, I get an output of
Hostname: xpDesktop
The local host: Address : 210.84.23.xxx
Press any key to continue . . .
#include <windows.h>
#include <winsock2.h>
#include <stdio.h>
int main()
{
char host_name[128];
hostent* host;
WORD verRequested = MAKEWORD(1,1), err;
WSADATA wsaData;
err = WSAStartup(verRequested, &wsaData);
gethostname(host_name,128);
printf("Hostname: %s\n", host_name);
host = gethostbyname(host_name);
printf("The local host: Address : %s\n", inet_ntoa(*(struct in_addr*)host->h_addr));
WSACleanup();
system("pause");
}
|
|
|
|
|
in winsock2.h:
struct hostent {
char FAR * h_name; /* official name of host */
char FAR * FAR * h_aliases; /* alias list */
short h_addrtype; /* host address type */
short h_length; /* length of address */
char FAR * FAR * h_addr_list; /* list of addresses */
#define h_addr h_addr_list[0] /* address, for backward compat */
};
if you call WSAStartup first, you should get the result.
|
|
|
|
|
Actually yes i called WSAStartup first
The host name is jdeguzman however the h_addr_list[0] value is
*jdeguzman
which i dont get why it returns that instead my ip address.
Thanks,
Jayjay
|
|
|
|