Solved

SDI App does not run on all pcs

Posted on 2009-05-15
6
225 Views
Last Modified: 2013-11-20
I have an app that runs fine on my development pc but does not run on target pc. Both are XP-SP2. The program was built using VC++ 2008. I linked as static without CRL or ATL. The gui portion works on both pcs, but on the target pc it will not send UDP packets over sockets. Any ideas of what to look at? I am not even sure what code to provide since no errors are being reported. I can provide some if when we narrow down the possibilities..
0
Comment
Question by:tholt1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24400685
Describe where the 2 PCs are relative to each other and describe where they are trying to send data to. Are you sending to addresses by hostname or by IP address.

Without more info it is hard to say whether this may be firewall related, DNS related, or what.

Have you any debugging / error checking to verify the winsock calls are succeeding?

0
 

Author Comment

by:tholt1
ID: 24401217
The PCS are on a private lan, no firewall, sending by ip-address. The problem I have is that my target machine will not have visual studio loaded onto it. A different program that uses the UDP protocol does work on both machines. Since the GUI is working fine (CFormView and CDialog derived classes), it does not seem to be MFR/CLR/ATL related. Since I linked MFC statically and excluded CLR and ATL, it does not seem like I should need any type of runtime environment. Do I? As far as the winsock calls go, they work on my "development" pc.
0
 

Author Comment

by:tholt1
ID: 24401492
I got it working, although I obviously need a better understanding of how socket creation works. I realized on the PC that worked, I had put some bogus entries into the "hosts" system file. I used the method gethostbyaddr to translate a ascii string ip-address to a convert to hostent. Is there a method that does not require me to modify the "hosts" system file? Any ideas?
// szTempSrvName = "99.7.7.99" and is null termed
 
      addr = inet_addr((const char*)szTempSrvName);
      hp = gethostbyaddr((char*)&addr,4,AF_INET);

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24404157
Yes, don't use hostnames, just use IP addresses and there will be no requirement for accessing the hosts file.
The gethostbyaddr() does a reverse lookup. You don't need it for socket communications. Is there a reason you need reverse name lookup?

0
 

Author Comment

by:tholt1
ID: 24472859
Sorry for the delay, I was out of office last week. I do not need (nor want) to use hosts file. I was just following example in help. Is there an example that shows how to populate the sockaddr_in struct that does not use gethostbyaddr()?
0
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 250 total points
ID: 24473851
Well, you don't need the "hp" (hostent) variable to do socket communication. All you need is the "addr" structure. Try commenting the 2nd line of code out, in your sample above. Since I cannot see the rest of your code, I cannot say more.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question