Bixby Sayz Posted December 4, 2011 Share Posted December 4, 2011 Trying to port one of my scripting aids over to SCAR and OSI and having a devil of a time. It would appear SCAR's implementation of TBitmap is slightly different than Simba's? The code below runs without error in Simba (using SRL of course). In SCAR it generates an access violation on line 21. NB: Yes this is a contrived example that doesn't do much of anything. program New; {$DEFINE SMART} // Comment out to disable SMART {$DEFINE RS2} {$I OSI\OSI.scar} var SmartCanvas: TBitmap; EmptyBitmap: Integer; procedure ScriptTerminate; begin FreeOSI; end; begin SetUpOSI; SmartSetDebug(True); SmartCanvas := TBitmap.Create; SmartCanvas.Canvas.Handle := SmartGetDebugDC; // Access Violation here EmptyBitmap := BitmapFromString(SmartCanvas.Width , SmartCanvas.Height, ''); SafeDrawBitmap(EmptyBitmap, SmartCanvas.Canvas, 0, 0); FreeBitmap(EmptyBitmap); end. Frustrating when things behave differently and there is precious little documentation. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 4, 2011 Share Posted December 4, 2011 Frustrating when things behave differently and there is precious little documentation. Quite possibly the most frustrating thing I've endured since simba has come around. This doesn't look too too hard though, I will try to help you out in a few hours when I get back home again.. if someone doesn't beat me to it ;-P Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 4, 2011 Author Share Posted December 4, 2011 (edited) For the mean time I run my debug tools in Simba to help me with scripts I'm writing in SCAR using OSI. It works but it just feels wrong somehow. Edit: And now out of the blue SMART has starting giving me that blasted "Applet Error" (but only with SCAR). I know when I am defeated. I am off to bed. Edited December 4, 2011 by Bixby Sayz Quote Link to comment Share on other sites More sharing options...