christopher sagayam schrieb:
> can anyone tell me the equivalent of
> "Private Declare Function InternetGoOnline Lib "wininet.dll" Alias
> "InternetGoOnlineA" (ByVal lpszURL As String, ByVal hwndParent As Long,
> ByVal dwReserved As Long) As Long"
> in perl ?
> 
> I mean the vb code is accessing a function present in the wininet.dll I
> believe ..how to do the same using PERL...

"Declare" is the FFI statement which declares a VB function as external, 
defined dynamically.
The perl counterpart would be using one of the modules
Win32::API (also written by Aldo), FFI or C::Dynalib.

You normally don't need a FFI as in VB to declare functions. you just 
have a look into various modules if they aren't defined statically there.
E.g. Win32::GUI defines all Win32 GUI methods and callbacks.
Win32::RASE e.g. has your required function defined statically.

however to answer your question, the perl equivalent is:

# VB: "Private Declare Function InternetGoOnline Lib "wininet.dll" Alias
#     "InternetGoOnlineA" (ByVal lpszURL As String, ByVal hwndParent As Long,
#     ByVal dwReserved As Long) As Long"

use Win32::API;
$InternetGoOnline = new Win32::API("wininet", "InternetGoOnlineA", [P,N,N],
N);

# sample usage:
$url = "http://www.myserver.com\0";; # ASCIIZ string!
$result = $InternetGoOnline->Call($url,0,0);

The FFI and C::Dynalib syntax is similar. FFI is the newest, 
supports arbitrary callbacks and is generally the best, but has a GPL license
only.
C::Dynalib and Win32::API have a perl license.
-- 
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html

Reply via email to