The problem here is that you are passing "0" for the last parameter to
NetLibGetHostByName. This parameter should be a pointer to an Err variable.
Poser is crashing because it is trying to use "0" as a pointer and subsequently
tries to access NULL.
On a real device, you're actually causing the error code to be written to memory
location zero.
-- Keith Rollin
-- Palm OS Emulator engineer
"David Vediner" <[EMAIL PROTECTED]> on 12/19/2000 06:08:39 PM
Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent by: "David Vediner" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
cc: (Keith Rollin/US/PALM)
Subject: Emulator crash
Hello,
I have an application which opens the net library, opens and connects a
tcp stream based socket, and reads and writes several pop3 commands from
and to that socket. All the code runs and works fine on my actual
device (Palm IIIxe with Minstrel III modem). However, the same code
crashes the emulator (v3.0a8 with a 3.5 rom). Particularly, after
commenting out code sequentially, this line (the first actual network
transaction) crashes the emulator with this windows message:
The instruction at "0x00414610" referenced memory at "0x00000000". The
memory could not be "written".
Here is the part of my program which crashes the emulator
(NetLibGetHostByName is the first network transaction I make after
opening the network library):
extern int ConnectToServer( char* hostname, UInt port, UInt
AppNetRefnum, Int32 AppNetTimeout )
{
// initialize the local vars
NetHostInfoBufType AppHostInfo;
// lookup the host info based on 'hostname'
NetLibGetHostByName( AppNetRefnum, hostname, &AppHostInfo,
AppNetTimeout, 0 );
return 1;
}
Of course, usually there's more to the function, but with everything but
this commented out, it crashes on the host lookup line. I've chosen not
to use the berkeley sockets API (and am therefore passing everything I
need between functions) because I think I'm going to be using some of
this in response to a procedural alarm at a future time. I'm pretty new
to palm programming (about a month and a half), so I'm sure it's
something I'm doing because I can get a whole host of other network
applications to run just fine in the emulator with netlib calls
redirected to host tcp/ip.
Thanks!
David Vediner
[EMAIL PROTECTED]
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/