Re: [fpc-pascal] fcl-res: using resource embedded in exe

2013-05-27 Thread Marco van de Voort
In our previous episode, Reinier Olislagers said: > > > > Yes. > > > > Resource := FindResource(HInstance, 'SQLSCRIPT', RT_RCDATA); > > Thanks Paul; IIRC Linux barfed on RT_RCDATA; can't/won't test it right > now as FPC trunk is broken... uses resource; _

Re: [fpc-pascal] fcl-res: using resource embedded in exe

2013-05-27 Thread Paul Ishenin
27.05.13, 17:47, Reinier Olislagers пишет: Resource := FindResource(HInstance, 'SQLSCRIPT', RT_RCDATA); Thanks Paul; IIRC Linux barfed on RT_RCDATA; can't/won't test it right now as FPC trunk is broken... If you look at Lazarus source you may find that LCL uses similar code to load forms da

Re: [fpc-pascal] fcl-res: using resource embedded in exe

2013-05-27 Thread Reinier Olislagers
On 27-5-2013 1:04, Paul Ishenin wrote: > 25.05.13, 20:25, Reinier Olislagers пишет: > >> In the code above, I'm loading the resource from the executable. >> However, Paramstr(0) is not reliable on all platforms. >> Is there a better way of doing this? > > Yes. > > Resource := FindResource(HInsta

Re: [fpc-pascal] fcl-res: using resource embedded in exe

2013-05-26 Thread Paul Ishenin
25.05.13, 20:25, Reinier Olislagers пишет: In the code above, I'm loading the resource from the executable. However, Paramstr(0) is not reliable on all platforms. Is there a better way of doing this? Yes. Resource := FindResource(HInstance, 'SQLSCRIPT', RT_RCDATA); if Resource <> 0 then begin

Re: [fpc-pascal] fcl-res: using resource embedded in exe

2013-05-26 Thread Jonas Maebe
On 25 May 2013, at 14:25, Reinier Olislagers wrote: > In the code above, I'm loading the resource from the executable. > However, Paramstr(0) is not reliable on all platforms. It's worse: on Unix platforms, even if you know the full path it's unsafe because the binary may have been unlinked sin

[fpc-pascal] fcl-res: using resource embedded in exe

2013-05-25 Thread Reinier Olislagers
Hi list, I've noticed some code of mine using resources needed the windows unit (to get RT_RCDATA), Iand therefore wasn't cross-platform. Tried rewriting using fcl-res, which seems to work ok at least on Windows: uses ,resource //resource readers ,resreader, coffreader, winpeimagereader, el