Re: GetDiskFreeSpaceA

new topic     » goto parent     » topic index » view thread      » older message » newer message

To further Matthews advice, try this instead....

 aGetDiskFreeSpace = registerw32Function(kernel32,
     "GetDiskFreeSpaceA",
      {C_POINTER, C_POINTER, C_POINTER, C_POINTER,
       C_POINTER},
       C_ULONG)


and then use it like this ...

   result = w32Func(aGetDiskFreeSpace, {...})

The reason for this is that "kernel32" is not created by the open_dll() but
by a win32lib function.

Also, I've been using Windows ME for almost a year now with almost no
troubles at all. I'd be interested (offline) to hear about what you think is
broken with it.

------
Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

----- Original Message -----
From: "Matthew Lewis" <matthewwalkerlewis at YAHOO.COM>
To: "EUforum" <EUforum at topica.com>
Sent: Tuesday, June 12, 2001 1:24 AM
Subject: RE: GetDiskFreeSpaceA


>
>
>
> > -----Original Message-----
> > From: Travis Beaty [mailto:travisbeaty at arn.net]
>
> > As I plug along on the installer, I've run into a bit of a
> > snag when it
> > comes to calling the API function GetDiskFreeSpace().  I have
> > linked to the function like this:
> >
> > -- start code
> > include win32lib.ew
> >
> > atom aGetDiskFreeSpace
> >
> > aGetDiskFreeSpace = define_c_func(kernel32,
> >     "GetDiskFreeSpaceA",
> >      {C_POINTER, C_POINTER, C_POINTER, C_POINTER,
> >       C_POINTER},
> >       C_ULONG)
> >
> > -- end code
> >
> > Unfortunately, aGetDiskFreeSpace is getting a value of -1, which
> > means that the poor installer is backfiring something fierce.
>
> You can't use the same values for the dll as win32lib defines with
> define_c_proc/func.  This is because win32lib doesn't actually call
> open_dll/define... until c_func/proc is called, to avoid loading things
into
> memory.  So, what you end up with is an index to the actual value which is
> stored in a sequence.
>
> You'll need to either open the dll yourself, or use the win32lib routines
> for linking/calling dll routines.
>
> Matt Lewis
>
>
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu