Hi all,
I have compiled a C application (japach: http://www.jikos.cz/jikos/japach/) under cygwin on Windows NT. It
works fine on all versions of win32. When I ran it on Windows x64, it
hangs on the following line:
strncpy(buffer2 , client.host_nam e, MAXLINE - strlen(buffer2) );
The problem is client.host_nam e, which is a string. This line is
reached after a few nested calls to different functions. In main,
where client.host_nam e is set, I could output it just fine. When it
gets to this function, it just hangs there.
Shouldn't this work on Windows x64? Winx64 has WOW that allows 32-bit
applications to be run. Is there something I'm not aware of?
Thanks.
Patrick
Nov 10 '06
11 1653
P wrote:
>As a general rule, it is a bad idea to keep a pointer to a string which is not guaranteed to be unchanged if that is what one needs. Rather it is better to copy the string into something one owns. <OT>Both gethostbyadd r and inet_ntoa return a pointer to static storage that can be overwritten. Good idea is to use safer versions of these functions or to copy the result.</OT>
What are the safer versions of gethostbyaddr and inet_ntoa?
The <OT></OTtags above meant that the advice is off topic and you
should ask for further information else where. If this is the first time
you have come across this you can be forgiven. However, please ask about
those functions and alternative on a group where they are topical,
comp.unix.progr ammer springs to mind as one possibility, but make sure
you check their archives and FAQ to find out if the question has already
been asked and answered and, indeed, if it is topical there.
--
Flash Gordon
In article <dm************ @news.flash-gordon.me.uk>,
Flash Gordon <sp**@flash-gordon.me.ukwro te:
>P jokingly wrote:
....
>What are the safer versions of gethostbyaddr and inet_ntoa?
The <OT></OTtags above meant that the advice is off topic and you should ask for further information else where. If this is the first time you have come across this you can be forgiven.
I think you need to have your sarcasm detector recalibrated. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Programatix |
last post by:
Hi,
I'm working on a project which includes WebServices and Windows Form
application.
The Windows Form application will call the WebServices to retrieve data from
database. The data will be returned as DataSet.
Now, here's the problem. On .NET Framework 1.1, if any rows in the dataset
returned contain errors (marked by calling the SetColumnError() method or
|
by: Marino |
last post by:
Hi all,
I have a Windows 2003 server, which is also a terminal server for
application, with sql 2000 installed. My company has developed an
application that uses SQL 2000 as its database. The application is a
client/server one. In each client computer there's a link to the
application on the server. There is no problem with Windows 98,
Windows 2000 pro, Windows xp pro clients, but the windows 95 ones
cannot log in to the database. The...
|
by: Rajat Tandon |
last post by:
Hello there,
I am relatively new to the newsgroups and C#. I have never been disappointed
with the groups and always got the prompt replies to my queries.This is yet
another strange issue, I am facing. Please please help me to solve this as
soon as possible.
So here we go ...
I am not able to take the screen shot of the windows form based "Smart
|
by: pnp |
last post by:
Hi all,
I have developed an app in C# and I have used some of the Infragistics
components in it. The problem is that while one is playing with the
windows within the mdi container exceptions occur that are not being
handled by any Exception handler. I have also placed one after the
application run method so if any exception occurs this "sink" will catch
it. But instead an error occurs from an unhandled exception and the
application...
|
by: AussieRules |
last post by:
Hi,
I want to use the user color scheme to set the color of my forms.
I now I have to use the. System.Drawing.SystemColors, but which color is the
color of a form background as used in other applications.
In the end all I want to do is
form1.backcolor = system.whatever.color
| |
by: Bruin |
last post by:
Hi All,
I'm having a problem with MDI child forms when the
reference to the MDI Parent is set in a Control library.
(Sorry for
the long post)
I have an control library assembly which holds all of my
base classes including my base MDI Container form and my
base MDI child form
the mdi container has a singleton which returns an
|
by: Sin Jeong-hun |
last post by:
I created a windows form application. It has a Threading.Timer and when
the timer ticks it does some work and show a popup window.
The problem is that while this program is running if the user tries to
shutdown Windows, my application doesn't quit and neither does
Windows. Of course, if the user first click of my application and
then tries to shutdown, there is no problem.
To solve this problem, I overrode WndProc of the main form,...
|
by: Vibhesh |
last post by:
I am facing problem with TimeSpan structure when DirectX is used.
Following is the sample code that causes the problem:
***************************************************************************************************************
{
...........................
PrintTimeSpanProblem();
device = new Device(0, DeviceType.Hardware, this,
CreateFlags.SoftwareVertexProcessing, presentParams);
PrintTimeSpanProblem();
|
by: Gerrit |
last post by:
Hi,
I try to learn programming in c# with databinding controls. Now I have a
problem with a ComboBox with the advanced properties for databinding, I
want to set the DataSourceUpdateMode to OnPropertyChanged, but then the
combobox does not display the right displaymember.
Below is my sample code (it is working, when you paste it in a new
windowsapplication, in a form and delete some generated code, but it is not
a useful program but...
|
by: Scott Gravenhorst |
last post by:
Windows XP SP3
My application is set to open a SaveFile dialog when an exit is
requested. When I click the app's close button, the save dialog
opens, but when I click to change the folder, the exception occurs
pointing to FileSaveDialog1.ShowDialog(). The exception also
indicates some problem with system.drawing.dll.
The exception text is:
"Attempted to read or write protected memory. This is often an
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |