|
What is the system name? The computer name? GetComputerName()
What code are you using to get the IP address that doesn't work in C?
The IP Helper SDK has the GetAdaptersInfo() that will help you get info on all the adapters
on the system and their associated IP addresses. Note that if you are on a subnet behind a router
these are local addresses - to get your IP as seen on the internet requires something different.
|
|
|
|
|
If you want the host and Ip of your computer, try this:
static int GetHostIP(uint8 *IPAddress)
{
char HostName[128];
struct sockaddr_in SocketAddress;
struct hostent *pHost = 0;
if (gethostname(HostName, sizeof(HostName)) == SOCKET_ERROR)
{
return FCTSERVER_CANNOT_GET_HOST_NAME;
}
pHost = gethostbyname(HostName);
if(!pHost)
{
return FCTSERVER_CANNOT_GET_HOST_IP;
}
memcpy(&SocketAddress.sin_addr, pHost->h_addr_list[0], pHost->h_length);
strcpy(IPAddress, inet_ntoa(SocketAddress.sin_addr));
return FCTSERVER_OK;
}
|
|
|
|
|
Can someone point to some link or some suggestions on how would I be able to display a static control on the title bar of a dialog using MFC?
|
|
|
|
|
Displaying a static control on the title bar ?
What is the advantage ? Why don't you simply set the title of your dialog ?
I don't really understand what you are trying to do.
|
|
|
|
|
I have a few windows in my application and I want to display some information in the static box so that consistency is maintined. But I can't find any common space on the dialog where I can show this symmetrically. Can you suggest some other options.
|
|
|
|
|
You didn't really answer my question: why do you want to put a static control on the title bar of your dialog ? Why not simply set the title of your dialog ?
|
|
|
|
|
This is because the static control would be a hyperlink. I have subclass a static control to a hyperlink control. So what I need is when the user clicks on that hyperlink control he is redirected to a different web page.
|
|
|
|
|
A hyperlink control in the title bar of your dialog. This must be really ugly and it probably confuse totally the users. Why don't you put it on the dialog ?
I really don't understand what you are trying to do.
|
|
|
|
|
I saw buttons on the titlebar see them on the codeproject maybe it some helpfuls for you
|
|
|
|
|
Hi,
i want to disply a text (CString) in RichEdit control in diffrent font.
so can anybody Please tell me How to do it?
Thanks in advance
|
|
|
|
|
|
hi,
pls anybody tell me about windowless mode?what is the relationship between DirectX and windowless mode??
Thanks in advance
Siddharth
|
|
|
|
|
What do you mean 'windowless'? In directX there must be a window. I'm guessing you are talking about fullscreen mode? In which case there is still a window.
|
|
|
|
|
Hello, I am using VC++2005 with this line of code to load a bitmap which is already added as a resource file:
m_hBitmap = (HBITMAP)LoadImage(GetModuleHandle(NULL), "res/Image.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
But when I execute the compiled exe file, it throws this error "Error loading Bitmap" and I have create a "res" folder and copy "Image.bmp" into it for the executable to run properly.
Does anyone know how to integrate the folder into sigle executable file?
Thanks in advance!
Lantianman
|
|
|
|
|
Use the resource editor to add the bitmap to your EXE as a resource.
|
|
|
|
|
If bitmap is on the resoruce you can use of CBitmap::LoadBitmap
|
|
|
|
|
It works with LoadBitmap. Thank you!
|
|
|
|
|
You' welcome whats your name
|
|
|
|
|
Considering that I want to communicate between two processes on the same system, among the existing IPC mechanisms like shared memory, DDE, windows sockets, pipes, RPC etc.which is the best technique for IPC. The priority being security of data being exchanged, and the second priority being speed..
Thanks.
|
|
|
|
|
With processes on the same machine, I use shared memory since it's really simple to set up and access.
|
|
|
|
|
ok.. but is shared memory a secured way for IPC between processes or windows sockets a better way for IPC ?
Thanks
|
|
|
|
|
A shared memory section can be secured with an ACL. If at all possible, don't use a named section (which can be spied on and discovered). Use an unnamed one and communicate the name between the processes some other way. This was discussed on Raymond's blog[^] a while ago, you should be able to find it with a search.
As for sockets, I don't know off-hand since I don't do much work with sockets.
|
|
|
|
|
hi,
Can you please give me some short difference between all IPC mechanism?
Thanks & Regards
Rakesh
|
|
|
|
|
|