HTTP.dll: NullReferenceException

neuroTux

New Member
Licensed User
Hello,

I am newbie in programming basic4ppc and I wrote a small program:

Sub Globals
'Declare the global variables here.
GoogleWeather = "http://www.google.com/ig/api?weather=+69124&hl=fr"
End Sub

Sub App_Start
Form1.Show
TextBox1.Text = DownloadXmlFile
End Sub

Sub DownloadXmlFile
ErrorLabel (errHTTP)
Reponse.New1
Demande.New1(GoogleWeather)
Reponse.Value = Demande.GetResponse
String = Reponse.GetString
Reponse.Close
Return String
errHTTP:
Reponse.Close
Msgbox(Demande.ResponseCode & ": " & Demande.ErrorMessage)
End Sub

This program works very well on my PC but as soon as I compile it for device and as soon as I execute it on my PPC, I have the message:
" An error occured on sub _main_downloadxmlfile. NullReferenceException. Continue? " Which displays on the screen.
I admit that I do not understand because there is that a single library " HTTP.dll ".
If somebody has an idea.
Thank you.
 
Last edited:

neuroTux

New Member
Licensed User
Thank you for your answer.

In fact the listing of the post 1 is not the right. The line corresponding to ' Reponse.New1 ' was 'Reponse.New2 (28591) ', code for ISO-8859-1.
This code is not recognized by my PPC.
I have exchange the code by 1252 which corresponds to Latin ANSI 1-Western European.

Now, the program runs very well.

@+
 

sitajony

Active Member
Licensed User
Thank you for your answer.

In fact the listing of the post 1 is not the right. The line corresponding to ' Reponse.New1 ' was 'Reponse.New2 (28591) ', code for ISO-8859-1.
This code is not recognized by my PPC.
I have exchange the code by 1252 which corresponds to Latin ANSI 1-Western European.

Now, the program runs very well.

@+
So it return an error when you run it on your device? I believe that it was on Basic4PPC...

Note: @+=CYA :)
 
Top