I have an application that is supposed to download a file from the internet.
Here is the problem:
My application shows the connection dialog if the device is not connected to
the internet. If it is already connected it simply downloads the file and
everything else works fine, and if I let my application connect the device
it downloads, but if I click on the cancel button on the connection dialog
in my application, I can't seem to connect anymore.
The first thing I do is to see if the Net library is available through my
iniNetLib():
void initNetLib()
{
Err err;
err = SysLibFind("Net.lib",&netLibRef);
if(err == errNone){
haveNetLib = true;
return;
}
err = SysLibLoad(sysFileTLibrary,netCreator,&netLibRef);
if(err != errNone){
haveNetLib = false;
} else{
haveNetLib = true;
}
}
haveNetLib and netLibRef are two global variables in my application.
When I click the download button in my application, I start a function
called download() and in there I have:
if(haveNetLib){
openNetLibErr = NetLibOpen(netLibRef,&err);
}
In the end of the download() function I close NetLib using:
NetLibClose(netLibRef,true);
Now ... this works unless I click the cancel button on the connection dialog
that pops up. Anyone have any tips? :) I am new to palm programming so I
might do things completely wrong, but I have tried to follow the guidelines
from Palm OS Companion 2 about Network Communication.
Thanks
--
Christer Edvartsen
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/