r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[SDK]

amacleod
3-Mar-2009
[1316x2]
Back to DLL Problem...
** Access Error: Cannot open sqlite3.dll as library
** Near: *lib: load/library switch/default fourth system/version


Do I need to write the DLL to disk to use it? Or can it run from 
inside encap
The way images are used..
Oldes
3-Mar-2009
[1318]
I think you must save it.
amacleod
3-Mar-2009
[1319x2]
Having the same problem with scripts...mysql-protocol.r

** Access Error: Cannot open /C/Documents and Settings/Alan/Desktop/mysql-protocol.r
** Near: do %mysql-protocol.r
db_IP: mysql://Alan:[Stynki4-:-onfire-:-selfip-:-com]:3306/onfire
do
Its included....#INCLUDE %mysql-protocol.r
Oldes
3-Mar-2009
[1321x2]
so the 'do call is somewhere else.
if you #INCLUDE %mysql-protocol.r than it does not mean that you 
can: do %mysql-protocol.r in your script.
amacleod
3-Mar-2009
[1323]
That's my problem...
Oldes
3-Mar-2009
[1324]
why?
amacleod
3-Mar-2009
[1325x3]
I was 'doing'  the file later in hte script
I need to use a variable
But that means changing a lot of code
Oldes
3-Mar-2009
[1328x2]
which varialble?
you can include the script as a block and do the block if needed
amacleod
3-Mar-2009
[1330x2]
sql_protocol: do #INCLUDE %mysql-protocol.r
Right?
Oldes
3-Mar-2009
[1332x2]
no
sql_protocol: #include-block %mysql-protocol.r
...
do sql_protocol
amacleod
3-Mar-2009
[1334]
ok
Oldes
3-Mar-2009
[1335]
or something like that.. I do not encap
amacleod
3-Mar-2009
[1336]
Will that work for the dll?
Oldes
3-Mar-2009
[1337x2]
so #include-block is not in default prebol.. so use #include-string 
instead
no.. I don't think it will work for dll. But I'm not sure. For the 
dll you should use #include-binary and write it on disk first
amacleod
3-Mar-2009
[1339]
I was hoping to have a version run from a cd-r...makes it hard if 
I have to write to disk..even then how would sqlitew.r find it....
Oldes
3-Mar-2009
[1340x2]
or provide the dlls like other apps do.. using installer:)
if it would be possible to use dlls directlz from memory, the installer 
would not be needed in most cases:)
amacleod
3-Mar-2009
[1342x2]
I like the no-install option
How -direct from memory?
Oldes
3-Mar-2009
[1344]
from encaped app.
amacleod
3-Mar-2009
[1345]
THat's what i"m trying to do but it keeps looking for the dll on 
disk
Oldes
3-Mar-2009
[1346x3]
if you include something, zou have it in memory when you start your 
app. So make sure to clean it after boot.
Yes.. that's what I say.. it must be on disk.
so you have 2 ways.. provide the dll with the app. or include it.. 
write it on disk on boot, remove it from memory and load it from 
disk
amacleod
3-Mar-2009
[1349x2]
I assume If I'm running off CD I would need to change code in %sqlite.r 
to be able to find the dll where ever I chose to write it...
I do not know if I'm doing this wrong but it seems to me that I should 
be able to use a data file without saving it to disk first...something 
I can do with XPackerX...
But I do not seem able to get it to work..
Oldes
3-Mar-2009
[1351x2]
Of course you can use data file without need to save it. I think, 
you just cannot load library from the memory.
Do you know this: http://www.rebol.com/docs/prebol.html
amacleod
3-Mar-2009
[1353x2]
I have not used it as I thoiught it was now part of encap
oh, the docs...yes I've read through it..
Oldes
3-Mar-2009
[1355x3]
You simply cannot load library from memory. See:
>> x: read/binary %CORE_RL_wand_.dll
== #{
4D5A90000300000004000000FFFF0000B8000000000000004000000000000000
000000000000000000000000000000000000000000000000000000001801...
>> load/library x
** Script Error: Expected one of: file! - not: binary!
** Near: load/library x
All you have to do is:
>> write/binary %my.dll x
>> load/library %my.dll
>>
the preprocessor does the same, just instead of:
x: read/binary %CORE_RL_wand_.dll
you do:
x: #include-binary %CORE_RL_wand_.dll
Gregg
4-Mar-2009
[1358]
It's possible to load DLLs from memory IIRC, but it's deep voodoo, 
and I don't know if it will work from REBOL. If you're comfortable 
writing your DLL prologs in ASM, it's probably something you can 
do. :-)
amacleod
4-Mar-2009
[1359x3]
Oldes, thanks for your help.

I still can not CONNECT to a db encapped. I've been writing that 
out too...
Just realized that encapping the db's with the exe is not a good 
idea as the memory used is equal or close to the size of the exe 
and these db's will be quite large....

I keep thinking in terms of XPackerX where it unpacks first and runs 
the main file adn accesess the data as if its on disk (which it is) 
and does not  load it into memory...
Got an idea for one file distribution...

Encap the main app and use XpackerX to create package for distro....
Solves my main issues with encap
Oldes
4-Mar-2009
[1362x4]
I still don't know, why you cannot write the data from the encaped 
exe on the disk, remove them from memory (set the variable to none) 
and use them.. it's exactly what your xpackerx probably does.
If you don't have encap,  the xpackerx can be good as you can just 
inlude the rebol.exe and script(s) you want to run.
But with the xpacker you don't protect the code as with encap. Encap 
is using encryption. the packer just decompress the files to temp 
dir and runs a command. So while the program is runing, you can see 
the files.
And if you are trying to connect to a db which is not in a file, 
but in a memory.. of course it will not work.. same as with the dll, 
you need a file! as an input. Also what's the point to have the sqlite 
db running from memory instead of file.