forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


#resource and DLL bug?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Jul 30, 2003 6:48 pm    Post subject: #resource and DLL bug? Reply with quote

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.. Smile )

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
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Jul 30, 2003 6:53 pm    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Jul 30, 2003 10:38 pm    Post subject: Reply with quote

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. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Jul 31, 2003 8:04 am    Post subject: Reply with quote

Yes, that's what I tried. Please note that I'm not the only one who can't achieve this, Prakash also tried it, with the same results... Sad
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Jul 31, 2003 9:29 am    Post subject: Reply with quote

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 Crying or Very sad
I may be wrong Rolling Eyes

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jul 31, 2003 1:13 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Jul 31, 2003 1:20 pm    Post subject: Reply with quote

I got it to work with the help of Mindpower... Smile

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
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Jul 31, 2003 3:10 pm    Post subject: Reply with quote

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 Crying or Very sad For some windows it worked, for others not at all, and for others it
returned the path to VDS.EXE Shocked

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group