View previous topic :: View next topic |
Author |
Message |
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Wed Jul 30, 2003 6:48 pm Post subject: #resource and DLL bug? |
|
|
When I try to compile a non-VDS DLL with my project, I can't save it to a file. This is the code I'm using (try it with a DLL of your choose.. )
Code: | #resource add,binary,dllname.dll
binfile saveres,binary,dllname.dll,path(%0)\mydll.dll |
Any ideas? _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Wed Jul 30, 2003 6:53 pm Post subject: |
|
|
Even if U successfully compile what is the use ? I think it will be in raw format like.(I know i used technically wrong words)
I dont think it will be extracted properly and you will have load the dll manually yourself - I think - extremely difficult in VDS i guess. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 30, 2003 10:38 pm Post subject: |
|
|
You can compile it into the executable and then extract it for use upon runtime.
I think that's what Skit is trying to do. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Jul 31, 2003 9:29 am Post subject: |
|
|
I dont think this can be easily possible(not at all straight forward) as the script runs in the context of the runtime dll and not the exe.
Ask an API eg LoadImage/icon etc to fetch a bmp/icon from the resource they fail (second hand info though) - i think they start looking into the dll
I may be wrong _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jul 31, 2003 1:13 pm Post subject: |
|
|
When I tried this, it gave me the following error when I ran the compiled
executable:
Error 37 at line 2: Too many system timers
I used this code:
Code: | option errortrap,error
#resource add,binary,testdll.dll
binfile saveres,binary,testdll.dll,path(%0)\mydll.dll
info Done.
exit
:error
warn error @error(e) at line @error(n)
exit |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Jul 31, 2003 1:20 pm Post subject: |
|
|
I got it to work with the help of Mindpower...
Code: | #resource add,binary,mydll.dll,2000
loadlib kernel32.dll
%f = @fill(256,@chr(32))
%r = @lib(kernel32,GetModuleFileNameA,INT:,NIL:,@addr("%F"),256)
if @unequal(@name(%f),vds)
binfile saveres,binary,2000,@path(%0)mydll.dll
end
freelib kernel32.dll |
All the API calls look for the program which is executed, and if it isn't the VDS IDE, the binfile command can do his job.
Btw. I've moved this post to Visual DialogScript 5 Source Code, because it isn't really a bug, but just a bit confusing. With the code above you can bypass the problem. _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Jul 31, 2003 3:10 pm Post subject: |
|
|
I struggled with an almost identical API call to get a module filename. Only through USER32.DLL.
I don't have the code here, but something like this:
Code: |
loadlib USER32
%F = @fill(128,)
%H = @strdel(@winexists(#Progman),1,1)
%C = @lib(USER32,GetWindowModuleFileName,INT:,INT:%H,@addr("%F"),128)
info Handle: %H@cr()Chars returned: %C@CR()Module filename: %F
freelib USER32
|
Proved to be quite unreliable, though For some windows it worked, for others not at all, and for others it
returned the path to VDS.EXE
Couldn't figure out why..
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
|