help me in an urlmon workaround

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

help me in an urlmon workaround

Cyber Core
Hi guys,

After some googling I noticed mingw don't support netlib (urlmon is a part of it). I tried to do hooks, share the win SDK dir but that just lead to countless of errors and I only need 1 function at the moment so I thought exporting the api call would be a good idea. This simple code works fine with MSVC:

#include <windows.h>

typedef HRESULT( __stdcall *UDTF )( LPUNKNOWN, LPCTSTR, LPCTSTR, DWORD, LPBINDSTATUSCALLBACK );
UDTF xURLDownloadToFile;

void main()
{
     HMODULE hUrlmon = LoadLibrary("urlmon.dll");   
        xURLDownloadToFile = (UDTF)GetProcAddress( hUrlmon, "URLDownloadToFileA");
        xURLDownloadToFile( 0, "http://192.168.1.1/pack0.pak", "C:\\pack.pak", 0, 0 );
    FreeLibrary( hUrlmon );

}

With mingw I get this error:

error: expected declaration specifiers or '...' before 'LPBINDSTATUSCALLBACK'

Regards,
Jax


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) HTML/MIME encoded mail
3) Improper quoting
4) Improper trimming
Reply | Threaded
Open this post in threaded view
|

Re: help me in an urlmon workaround

Earnie Boyd

Quoting Cyber Core <[hidden email]>:

> Hi guys,
>
> After some googling I noticed mingw don't support netlib (urlmon is a part
> of it). I tried to do hooks, share the win SDK dir but that just lead to
> countless of errors and I only need 1 function at the moment so I thought
> exporting the api call would be a good idea. This simple code works fine
> with MSVC:
>
> #include <windows.h>
>
> typedef HRESULT( __stdcall *UDTF )( LPUNKNOWN, LPCTSTR, LPCTSTR, DWORD,
> LPBINDSTATUSCALLBACK );
> UDTF xURLDownloadToFile;
>
> void main()
> {
>     HMODULE hUrlmon = LoadLibrary("urlmon.dll");
>        xURLDownloadToFile = (UDTF)GetProcAddress( hUrlmon,
> "URLDownloadToFileA");
>        xURLDownloadToFile( 0, "http://192.168.1.1/pack0.pak",
> "C:\\pack.pak", 0, 0 );
>    FreeLibrary( hUrlmon );
>
> }
>
> With mingw I get this error:
>
> error: expected declaration specifiers or '...' before
> 'LPBINDSTATUSCALLBACK'
>

File a report, see http://www.mingw.org/Reporting_Bugs for how.  We do
not have this API defined that I can find.

Earnie

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) HTML/MIME encoded mail
3) Improper quoting
4) Improper trimming