|
You aren't actually pinging the computer from outside the LAN.
You're pinging the public IP address which is the address of the gateway/modem/router.
From there, there's no way an incoming packet can be routed to a specific computer unless
the modem/router is configured to forward packets bound for a specific port to a specific
computer on the LAN.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Your answer does not seem correct... I say that because of the number of "live chat" session that happen when seeking help. For example, Sprint.com, Dell.com, etc. These are not modifying the modem/router.
So it begs the question, how are these programs do it?
I read the NAT article, very good, but I'm still un-certain what to do.
|
|
|
|
|
It's possible I'm not correct, but with the info so far it's the most likely problem.
I'm not familiar with your exact gateway connection - the modem/router/etc that separates
your internal network (with local addresses like 192.168.1.100 for example) from the internet,
where the public IP address is visible from, but there has to be some kind of translation.
If the device only allows one computer connection, then it may just pass all communication directly
to the computer. There could be firewall protection in the device to prevent this.
If multiple computers can be connected to the device, then there HAS to be NAT going on there.
Member 260880 wrote: For example, Sprint.com, Dell.com, etc. These are not modifying the modem/router.
As far as live chat sessions - all the major players have their own servers. Most home routers/modems/gateways
allow outgoing connections by default, so a server outside your network is as easy to connect to as
any HTTP server on the web. For example, Microsoft Live Messenger uses "relay servers" - servers
that allow the two endpoints to connect to them, and they just pass data through. The key is, the endpoints
only need to establish an outbound connection - no inbound connections are necessary to the NAT-protected
computers.
I do live multimedia communication for a living - this is a major issue. I use relay servers as well for clients that
absolutely can't (or won't) allow incoming connections into their LAN.
Mark
*edit* I took a look at HughesNet and their advertised modems - the modems provide NAT, routing, and firewall features - all of which can prevent or allow incoming connections. I'm pretty sure a quick configuration change there will get you connecting
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for the info and patience - I'll contact Hughes Net and see how/if I can configure my modem.
|
|
|
|
|
Here's what Hughes.net is saying...
Tim, as I understand you want to remotely access a computer. I would like to inform you that as far, as ports are concerned HughesNet does not block any ports. Tim, I am sorry but we do not have information about the Remote Access where you can remotely access the computer at Business end from HughesNet system. However if you want to remotely access the HughesNet system from the Business end then you would require a static IP. While checking the records I found that you do not have a Static IP. A static IP address allows you to gain access to your computer from the internet. To get the Static IP I would suggest you to contact Billing Department. I am sorry to inform you but HughesNet does not provide technical assistance with Remote Access.
I'm at a lost. As mentioned previously, Sprint/Dell and others allow "chat" with no problems. Maybe the problem is with using CSocket where as Sprint/Dell is using the browser and they use something else? I'm lost...
Thanks..
|
|
|
|
|
For the "others" that allow chat, remember, they're doing that differently - through their servers.
However, you want to run a server behind your modem/router - that requires incoming connections,
which need to get to the computer listening for them.
I googled "HughesNet port forwarding" last night and most hits stated that a static IP was needed.
I'm not sure why, except for the fact that dynamic IP can change making hard for remote nodes to connect,
but it should still work the same if the other end knows what IP you have at the moment.
Regardless, there were a lot of hits saying the static IP was required.
As far as configuring the hardware - that "should" be trivial. Generally there's an HTTP interface to do the
configuration, but I couldn't find any specifics on the HughesNet modems. Google will help there for sure though.
I went through this when I first started communication programming - I'm a programmer, not an IT guy, dammit!
You'll know your network really well when you get it working
Good luck - you can do it!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
This may help explain it a bit...
Network Address Translation[^]
I'm not trying to blow it off with a wiki link but I have to run for a bit and didn't
want to leave you hanging
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Member 260880 wrote: I can "ping" the server computer no problem...
Can you ping both the IP address and the host name?
Can you map a drive letter from one to the other?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes I can ping the "external IP" address with no problem. By external IP I'm referring to the IP used from outside our local network.
Not sure how to even try mapping a drive to a remote computer that does not show up in Windows Explorer.
I'm lost...
|
|
|
|
|
Member 260880 wrote: Yes I can ping the "external IP" address with no problem.
But can you ping the host name? If not, then you have a DNS issue where the host name is not being translated to its IP address.
Member 260880 wrote: Not sure how to even try mapping a drive to a remote computer that does not show up in Windows Explorer.
Click Map Network Drive from the Tools menu. In the Folder combobox, type the name of your remote machine using the \\server\share format. If this works, then the problem is likely with your code. If this does not work, then it's doubtful your code can overcome it. I'm not familiar with your situation so this is just a guess on my part.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm trying to get the selected item from a CListCtrl. I intercept the NM_CLICK messge and try the following:
<br />
NMITEMACTIVATE* pNMItem = (NMITEMACTIVATE*)pNMHDR;<br />
<br />
int nItem = pItem->iItem;<br />
int nSubItem = pItem->iSubItem;<br />
<br />
I get the subitem no problem but the iItem is always -1. I'm sure it's pretty simple but I can't figure out what I'm missing. Any suggestions?
Thanks,
Paul
|
|
|
|
|
Paul -
Try using the GetFirstSelectedItemPosition method for CListCtrl.
This returns a POSITION which is used in the next call to GetNextSelectedItem (that will return and item number).
Then use the item number in the call to GetItem (you need to send in a pointer to an LVITEM structure).
Here's some sample code...
Hope this helps,
Tim
CListCtrl myList;
POSITION pos = mylist.GetFirstSelectedItemPosition();
while (NULL != pos)
{
int nItem = mylist.GetNextSelectedItem(pos);
LVITEM lvItem;
ZeroMemory ( &lvItem, sizeof(LVITEM) );
lvItem.mask = LVIF_IMAGE | LVIF_TEXT; //gets the information you are interest in
lvItem.iItem = nItem;
if (TRUE == mylist.GetItem(&lvItem))
{
<do something="" with="" item="" info="">
break; //if you want to stop
}
}
|
|
|
|
|
Maybe this will help a bit...from the docs:
"The iItem member of lpnmitem is only valid if the icon or first-column label has been clicked.
To determine which item is selected when a click takes place elsewhere in a row, send an
LVM_SUBITEMHITTEST message."
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi All,
I get a hang when trying to expand the 'str_vec' variable
(code follows) in the Variables window. It however has no
such trouble when trying to expand the 'int_vec' variable
in the window.
Note that I set breakpoints at the 'display_message()'
and at the while(1) statements and get the same
effect.
Help appreciated.
mr954
#### SYSTEM
MS Win2000, SP3
MS Dev Studio 97
VC++ 5.0
##### OUTPUT
max of 1 3 5 4 2 is -1
max of 1_1 3_3 5_5 4_4 2_2 is TBD
#### CODE
int main()
{
int int_ret = -1;
string str_ret = "TBD";
const int arr_len = 5;
int int_arr[arr_len] = {1,3,5,4,2};
const char* str_arr[arr_len] = {"1_1","3_3","5_5","4_4","2_2"};
vector<int> int_vec(arr_len);
vector<string> str_vec(arr_len);
for (int ix = 0; ix < arr_len; ix++ )
{
int_vec[ix] = int_arr[ix];
str_vec[ix] = str_arr[ix];
}
display_message( int_vec, int_ret );
display_message( str_vec, str_ret );
while(1);
return 0;
}
modified on Tuesday, February 12, 2008 7:54 PM
|
|
|
|
|
Can you reformat your post to include all the text in angle brackets <>?
What version of Visual Studio?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I tried it with VS6 and it seemed to work fine.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
VC6 had vectors?
Are you going to the summit?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Are you going to the summit?
Negative. Too cost prohibitive.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Works just fine on Visual Studio 6 for me.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi there,
I have an error with this line when initializing a dialog,
this->SetWindowText ("Hi there") ;
The compiler says:
error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char [9]' to 'LPCTSTR'
I guess I have something missing but I don't know what.
|
|
|
|
|
You are probably building a unicode application - that is the default in VS2005. Try:
this->SetWindowText(L"Hi there");
Judy
|
|
|
|
|
Looks like you're doing a Unicode build, so the SetWindowText method is
expecting a const wchar_t * but you're passing a const char *.
// better:
SetWindowText (L"Hi there") ;
// best (will work for both unicode and non unicode builds):
SetWindowText (_T("Hi there")) ;
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Try this:
this->SetWindowText (_T("Hi there"));
|
|
|
|
|
piul wrote: this->SetWindowText ("Hi there") ;
use this->SetWindowText (_T("Hi there")) ;
|
|
|
|
|
I am really surprised nobody mentioned:
SetWindowText (L"Hi there");
or
SetWindowText (_T("Hi there"));
|
|
|
|