Solved

SDI App does not run on all pcs

Posted on 2009-05-15
6
201 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now