iTz Chris o_O Posted March 9, 2012 Share Posted March 9, 2012 Hello, I need some help with my script.. I have this error in the script I wrote: [Runtime Error] : Exception: Out of system resources in line 257 in script C:\blabla\myscript.scar Line 257: [scar] SaveBitmap(ThisBmp, 'C:\blabla\this.bmp'); [/scar] I am using SCAR Divi 3.21 Portable because the last versions seem not to support plugins (Im using Appa) It only happens after it ran succesfully for a couple of minutes.. also saved some bitmaps succesfully. I had enough memory left so does anyone know why this happens? Help would be greatly appreciated, thanks. Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted March 9, 2012 Share Posted March 9, 2012 Hi, You use : procedure SaveBitmap(bitmap: Integer; path: AnsiString); SaveBitmap(ThisBmp, 'C:\blabla\this.bmp'); and perhaps you don't free the ThisBmp . I hope it will help you 1 Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted March 9, 2012 Author Share Posted March 9, 2012 (edited) Thanks! I totally forgot about that one Edit: I still get the error.. Edited March 9, 2012 by iTz Chris o_O Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted March 9, 2012 Share Posted March 9, 2012 Post your Script and we can take a look. Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted March 10, 2012 Author Share Posted March 10, 2012 its like this: [scar]appa_CopyContentToBitmap(ThisBmp); SaveBitmap(ThisBmp, Path + CrimeString + '.bmp'); FreeBitmap(ThisBMP);[/scar] but its not a memory leak or something, the memory scar is using does not change much. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 14, 2012 Share Posted March 14, 2012 its like this: [scar]appa_CopyContentToBitmap(ThisBmp); SaveBitmap(ThisBmp, Path + CrimeString + '.bmp'); FreeBitmap(ThisBMP);[/scar] but its not a memory leak or something, the memory scar is using does not change much. Your using the wrong copy, uses CopyClientToBitmap(BMP,XS,YS,XE,YE); Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted March 16, 2012 Author Share Posted March 16, 2012 Your using the wrong copy, uses CopyClientToBitmap(BMP,XS,YS,XE,YE); I dont think this is the problem, appa_CopyContentToBitmap(BMP); is a function from the plugin I'm using. Everything works fine but after 1 time or sometimes 2 times it gives this error.. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 16, 2012 Share Posted March 16, 2012 I dont think this is the problem, appa_CopyContentToBitmap(BMP); is a function from the plugin I'm using.Everything works fine but after 1 time or sometimes 2 times it gives this error.. Theres prob an error within the plugin, the which memory manager does the plugin use? FastShareMem, ShareMem, FastMM? I found if you dont use FastShareMem there are some issues with scar sharing data. Simple solution to you problem is the CopyClientToBitmap() its a built in function in scar so you do not need any external includes. Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 17, 2012 Share Posted March 17, 2012 Theres prob an error within the plugin, the which memory manager does the plugin use? FastShareMem, ShareMem, FastMM? I found if you dont use FastShareMem there are some issues with scar sharing data. Simple solution to you problem is the CopyClientToBitmap() its a built in function in scar so you do not need any external includes. Your advice is flawed, you don't seem to know what the plugin does... Afaik it's impossible to use CopyClientToBitmap. @OP: You're certain the client actually successfully gets copied to a bitmap a few times before failing? Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted March 19, 2012 Author Share Posted March 19, 2012 Your advice is flawed, you don't seem to know what the plugin does... Afaik it's impossible to use CopyClientToBitmap. @OP: You're certain the client actually successfully gets copied to a bitmap a few times before failing? Yes, it works 1 or 2 times and then gives this error. Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 19, 2012 Share Posted March 19, 2012 Yes, it works 1 or 2 times and then gives this error. Then I have no clue Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted March 19, 2012 Author Share Posted March 19, 2012 Then I have no clue Ok Is there a way to use plugins with the latest version of SCAR? Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 19, 2012 Share Posted March 19, 2012 Ok Is there a way to use plugins with the latest version of SCAR? ... That has never changed Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted March 23, 2012 Author Share Posted March 23, 2012 ... That has never changed I have tried to use the Appa plugin with Scar Divi 3.31 but Im not sure how to use it, I have to use something like {$I SCAR Divi/Appa.dll} I guess but that gives an error, not strange since Appa isnt an include but how do I use it then? $P or $Plugin doesnt work.. Basically my question is: How do I use a plugin? Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 23, 2012 Share Posted March 23, 2012 {$L Appa.dll}, place it in the Libraries folder in your workspace folder. Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted March 24, 2012 Author Share Posted March 24, 2012 {$L Appa.dll}, place it in the Libraries folder in your workspace folder. Im getting: (Type) Compiler Error (line) 1 (Message) Unable to register function function appa_GetElements: TAppaElementArray The plugin is made in Delphi, any idea why I get this error? Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 24, 2012 Share Posted March 24, 2012 Im getting: (Type) Compiler Error (line) 1 (Message) Unable to register function function appa_GetElements: TAppaElementArray The plugin is made in Delphi, any idea why I get this error? Can have any number of causes... Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted March 24, 2012 Author Share Posted March 24, 2012 Can have any number of causes... But is there something wrong in my settings with Scar, or is it the code inside the plugin? The plugin did work in the older version of Scar.. Quote Link to comment Share on other sites More sharing options...
FHannes Posted April 2, 2012 Share Posted April 2, 2012 I've found a bug in SCAR's plugin system, types didn't export properly, I'll have a fix ready in SCAR 3.32.02. Meanwhile you can use the 3.33 Alpha where the fix is already integrated. http://forums.scar-divi.com/showthread.php?505-Downloading-SCAR-Divi-Prerelease Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted April 3, 2012 Author Share Posted April 3, 2012 I've found a bug in SCAR's plugin system, types didn't export properly, I'll have a fix ready in SCAR 3.32.02. Meanwhile you can use the 3.33 Alpha where the fix is already integrated.http://forums.scar-divi.com/showthread.php?505-Downloading-SCAR-Divi-Prerelease Thanks Quote Link to comment Share on other sites More sharing options...
FHannes Posted April 4, 2012 Share Posted April 4, 2012 As I feared appa also uses SCAR's function export feature, which was seriously reduced in the latest 3ish versions. However, the new library system in 3.33 once again exports all functions, which will also restore the ability to use appa_CopyContentToBitmap. Do note that your code wouldn't have worked even if appa_CopyContentToBitmap worked. You need to first create a bitmap before you send it into appa_CopyContentToBitmap. Something like: [scar] P := appa_GetSize; ThisBmp := BitmapFromString(P.X, P.Y, ''); appa_CopyContentToBitmap(ThisBmp); SaveBitmap(ThisBmp, 'z:\test.bmp'); FreeBitmap(ThisBMP);[/scar] The new library system will be included in the first beta build of SCAR Divi 3.33, which I'm going to upload now. Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted April 4, 2012 Author Share Posted April 4, 2012 (edited) As I feared appa also uses SCAR's function export feature, which was seriously reduced in the latest 3ish versions. However, the new library system in 3.33 once again exports all functions, which will also restore the ability to use appa_CopyContentToBitmap. Do note that your code wouldn't have worked even if appa_CopyContentToBitmap worked. You need to first create a bitmap before you send it into appa_CopyContentToBitmap. Something like: [scar] P := appa_GetSize; ThisBmp := BitmapFromString(P.X, P.Y, ''); appa_CopyContentToBitmap(ThisBmp); SaveBitmap(ThisBmp, 'z:\test.bmp'); FreeBitmap(ThisBMP);[/scar] The new library system will be included in the first beta build of SCAR Divi 3.33, which I'm going to upload now. Thank you so much! I had a problem with it yesterday, appa_CopyContentToBitmap(ThisBmp) gave an error, but you've solved it even before I could ask it Edit: When im using this code: [scar] s := appa_GetForms; for i := 0 to High(s) do begin writeln(s.name); writeln(s.action); writeln(s.method); for a := 0 to High(s.Elements) do begin writeln('element= ' + inttostr(a)); writeln(s.Elements[a].outerHTML); writeln(s.Elements[a].ID); writeln(s.Elements[a].ClassName); writeln(s.Elements[a].Tag); writeln(s.Elements[a].Name); writeln(s.Elements[a].Value) //outerHTML, ID, ClassName, Tag, Name, Value end; end; [/scar] Instead of the values it should give, it prints for the value, name, tag, classname and outerHTML things like: '??????>??' The ID gives nothing, but that didnt give anything on the older version of Scar either, the value, name, tag and other things did work in the older version.. And I am still getting: "Runtime Error: Access violation at address 00000000. Read of address 00000000" at line 84: "appa_CopyContentToBitmap(Target);" Lines 72-86: [scar] procedure appa_UpdateBitmap; var p: TPoint; begin if (not appa_Showing) then Exit; p := appa_GetSize; try FreeBitmap(Target); except end; Target := BitmapFromString(p.x, p.y, ''); //TargetSize := p; SetTargetBitmap(temp); appa_CopyContentToBitmap(Target); SetTargetBitmap(Target); end; [/scar] The Appa_GetForms problem isnt a big deal, I can make a script without it but my major problem is appa_CopyContentToBitmap(Target), I will try it with V3.33 when you are done but Im not sure if its going to be fixed with it. Edited April 4, 2012 by iTz Chris o_O Quote Link to comment Share on other sites More sharing options...
FHannes Posted April 4, 2012 Share Posted April 4, 2012 As I said, appa_CopyContentToBitmap will NOT work with 3.32 or 3.33 Alpha, download the latest Beta build for 3.33 from the pre-release repository. On a side-note: [scar]try FreeBitmap(Target); except end;[/scar] That's a horrible construct... Use: [scar]if BitmapAssigned(Target) then FreeBitmap(Target);[/scar] Quote Link to comment Share on other sites More sharing options...
iTz Chris o_O Posted April 5, 2012 Author Share Posted April 5, 2012 (edited) Ok, thanks For some reason I read that part a little different some days ago It is working now <3 Edited April 5, 2012 by iTz Chris o_O Quote Link to comment Share on other sites More sharing options...