Solved

SDI App does not run on all pcs

Posted on 2009-05-15
6
192 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 40

Expert Comment

by:mrjoltcola
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 44
iSeries DB2 Query 2 83
if loop in java 3 114
sumHeights  challenge 17 60
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

16 Experts available now in Live!

Get 1:1 Help Now