Theos PowerBasic Museum 2017

Webmaster: José Roca (PBWIN 10+/PBCC 6+) (SDK Forum) => Discussion => Topic started by: Marty Francom on November 08, 2011, 03:34:55 AM

Title: Compiler problem with API Function URLDownloadToFile
Post by: Marty Francom on November 08, 2011, 03:34:55 AM
Jose'
   I am converting a very simple FF31/PB9 program that used the WinAPI and would
compile just fine using FF31/PB9/WinAPI   But when I compile using FF35/PB10/JoseAPI
I get the following compile error.  See screen print:

   Any suggestion?   I have attached the project file.

I posted both here and on FireFly Forum.  I am thinking that this may
be an API problem and you may be able to spot the problem quickly.
Anyway any help you can offer is most appreciated.
Title: Re: Compiler problem with API Function URLDownloadToFile
Post by: José Roca on November 08, 2011, 04:21:01 AM
Use


If UrlDownloadToFile(NOTHING, URLPath, LocalPath, 0, NOTHING) = 0 Then


The one in the PB include files is wrongly declared because they don't have support for low-level COM interfaces.
Title: Re: Compiler problem with API Function URLDownloadToFile
Post by: Marty Francom on November 08, 2011, 05:12:29 AM
Jose's
    Thank you for help.
That worked (of coarse) .

But where does the NOTHING variable come from?
I am guessing it must be defined in your APIs.

       
Title: Re: Compiler problem with API Function URLDownloadToFile
Post by: José Roca on November 08, 2011, 05:18:07 AM
It's not a variable, but a PB reserved word. It can be used to replace any OBJECT variable parameter.  In this case, the compiler passes a null object (or a pointer to a null object if BYREF) in place of a typical parameter.