1. win32lib dependancy

My .exw proggy only contains one part that uses win32lib:

----==========Set the working directory=========----
constant SetCurrentDirectory = registerw32Procedure( kernel32,
"SetCurrentDirectoryA", {C_POINTER} )
atom str str = allocate_string("\\\\fp-ho1-pr\\HO_share\\Tier 3 Database\\")
w32Proc( SetCurrentDirectory, {str} ) free( str )
----============================================----

Because of that one snippet, I have to have win32lib.ew, misc.e, machine.e, etc
etc etc... all these include files, in the folder too.
How can I redo the above without using win32lib?
I tried looking at the win32lib functions, but there's so many constants and
things I don't understand there, I wouldn't know where to begin.

David, Derek... can you write the above snippet without using win32lib calls?


Very confused.
=======================
Patrick Barnes
Information Systems Group
201 Elizabeth St, Sydney
Patrick.Barnes at tg.nsw.gov.au
Ext: 91-3583
Ph:(02) 9284-3583
Mob: 0410 751 044


***********************************************************************




***********************************************************************

new topic     » topic index » view message » categorize

2. Re: win32lib dependancy

Hey Patrick,

How about this snippet that uses no (0) include files:

global function allocate_string(sequence s)
    atom mem
    mem = machine_func(16, (length(s) + 1))
    if mem then poke(mem, s & 0) end if
    return mem
end function

atom kernel32 kernel32 = machine_func(50, "kernel32.dll")
constant SetCurrentDirectory = machine_func(51, {kernel32,
"SetCurrentDirectoryA", {#01000004}, 0} )
atom str str = allocate_string("\\\\fp-ho1-pr\\HO_share\\Tier 3 Database\\")
c_proc(SetCurrentDirectory,{str}) machine_proc(17, str )

Euman
euman at bellsouth.net

----- Original Message -----
From: <Patrick.Barnes at transgrid.com.au>
To: "EUforum" <EUforum at topica.com>
Sent: Wednesday, November 27, 2002 9:45 PM
Subject: win32lib dependancy


:
: My .exw proggy only contains one part that uses win32lib:
:
: ----==========Set the working directory=========----
: constant SetCurrentDirectory = registerw32Procedure( kernel32,
"SetCurrentDirectoryA", {C_POINTER} )
: atom str str = allocate_string("\\\\fp-ho1-pr\\HO_share\\Tier 3
Database\\")
: w32Proc( SetCurrentDirectory, {str} ) free( str )
: ----============================================----
:
: Because of that one snippet, I have to have win32lib.ew, misc.e,
machine.e, etc etc etc... all these include files, in the folder too.
: How can I redo the above without using win32lib?
: I tried looking at the win32lib functions, but there's so many constants
and things I don't understand there, I wouldn't know where to begin.
:
: David, Derek... can you write the above snippet without using win32lib
calls?
:
:
: Very confused.
: =======================
: Patrick Barnes
: Information Systems Group
: 201 Elizabeth St, Sydney
: Patrick.Barnes at tg.nsw.gov.au
: Ext: 91-3583
: Ph:(02) 9284-3583
: Mob: 0410 751 044
:
:
: ***********************************************************************
:
:
:
:
: ***********************************************************************
:
:
:
:
:

new topic     » goto parent     » topic index » view message » categorize

3. Re: win32lib dependancy

include dll.e
include machine.e
atom kernel32, SetCurrentDirectory,result
kernel32 = open_dll("kernel32.dll")
SetCurrentDirectory =
define_c_func(kernel32,"SetCurrentDirectoryA",{C_POINTER},C_INT)
atom str str = allocate_string("\\\\fp-ho1-pr\\HO_share\\Tier 3 Database\\")
result=c_func( SetCurrentDirectory, {str} ) free( str ) -- returns 0 if failure
> Very confused.
> =======================
> Patrick Barnes

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu