What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » InternetOpenUrlW - what am I doing wrong?

InternetOpenUrlW - what am I doing wrong?
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
O.P. InternetOpenUrlW - what am I doing wrong?
code:
var INTERNET_FLAG_RELOAD = 2147483648;
var INTERNET_OPEN_TYPE_DIRECT = 1;
var INTERNET_OPEN_TYPE_PROXY = 3;

var Version = 1;

function OnEvent_Initialize(MessengerStart){
    CheckUpdate('http://mattyg.ca/test/', 'AutoUpdateTest');
}

function CheckUpdate(sUrl, sFile){
    var hOpen = Interop.Allocate(4);
    var hFile = Interop.Allocate(4);
    var sBuffer = Interop.Allocate(2*(1000)+2);
    var lBuffer = Interop.Allocate(4);
    lBuffer.WriteDWORD(0, 1000);
    var lRet;
   
    hOpen.WriteDWORD(0, Interop.Call('wininet', 'InternetOpenW', 'ScreenshotSender4Updater', INTERNET_OPEN_TYPE_DIRECT, '', '', 0));
    hFile.WriteDWORD(0, Interop.Call('wininet', 'InternetOpenUrlW', hOpen.ReadDWORD(0), sUrl+sFile+'.version', '', 0, INTERNET_FLAG_RELOAD, 0));
    Interop.Call('wininet', 'InternetReadFile', hFile.ReadDWORD(0), sBuffer.DataPtr, lBuffer.ReadDWORD(0), lRet);
   
    Interop.Call('wininet', 'InternetCloseHandle', hFile.ReadDWORD(0));
    Interop.Call('wininet', 'InternetCloseHandle', hOpen.ReadDWORD(0));
   
    Debug.Trace(sBuffer.ReadString(0));
}

Ya so what am I doing wrong? I tried passing lBuffer as a normal var (didn't work), tried passing 1000 didn't work. sBuffer.ReadString(0) is null so I am not sure what is wrong.
07-01-2006 03:07 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
InternetOpenUrlW - what am I doing wrong? - by matty on 07-01-2006 at 03:07 AM
RE: InternetOpenUrlW - what am I doing wrong? - by ShawnZ on 07-01-2006 at 05:29 AM
RE: InternetOpenUrlW - what am I doing wrong? - by matty on 07-01-2006 at 05:31 AM
RE: InternetOpenUrlW - what am I doing wrong? - by Eljay on 07-01-2006 at 07:27 AM
RE: InternetOpenUrlW - what am I doing wrong? - by matty on 07-01-2006 at 01:41 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On