save resource file run-time lazarus / 13-General ---------------------------------------------------------------------- guest · 2005-10-05 10:02 Hey all, I have document - manuscript.doc (258Kb) - that I put in lazarus resource file. I put {$I disres.lrs} in appropriate section of lazarus project But can't save this document to local disk during run-time - the file saved is  0 Kb size. Code: [Select] var myresstream:tresourcestream; myresstream:=tresourcestream.Create(0,'manuscript',pchar('DOC')); myresstream.savetofile('dapaper.doc'); The first line my lazarus resource file is: Code: [Select] LazarusResources.Add('manuscript','DOC',[ I think the handle '0' in tresourcestream.Create call is to blame, but how to fix this. In Delphi 5, the same code works when using 'hinstance' instead of '0' for resource handle. But hinstance not recognize by lazarus fedora. Please help. (I use fedora) ---------------------------------------------------------------------- Marc · 2005-10-05 14:16 I don't think this is a handle problem. I'm afraid saving a resource form the lazarus internal resources is not supported yet (i've to look into the source to confirm this) ---------------------------------------------------------------------- Anonymous · 2005-10-05 16:26 ok - will wait for feedback if possible ---------------------------------------------------------------------- Marc · 2005-10-13 22:00 OK, It took a while, sorry for the delay. This will work in the future (I hope) but it won't work now, for 2 reasons: 1) TResourceStream is part of the rtl and it has no knowledge of the internal implementation of lazarus resources (FPC didn't support resources so we made our own) 2) If you look at the implementation of TResourceStream you will see that it is an empty class. It is not implemented yet (?) (in the version of 2.0.1 i checked) ---------------------------------------------------------------------- guest · 2005-10-16 02:17 thanks for the info will wait for future version of the lazarus for full resource implementation thanks.