Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
FHannes

Samples

Recommended Posts

I've created a repository where I'm going to dump samples for creating libraries, writing scripts, includes, ... I'm hoping it will be a valuable resource for scripters.

 

https://github.com/SCAR-Divi/Samples

 

(Note that you need at least SCAR Divi 3.33 Beta to run the library samples.)

Edited by Freddy

Share this post


Link to post
Share on other sites

Freddy, in your what version of scar do the Legacy and Main constants refer to? (What version of scar is required for those using the MAIN plugin architecture) Doesn't really matter other than adding some comments to your examples so I don't have to spend time figuring things out every time I want to look at writing a plugin for SCAR.

Share this post


Link to post
Share on other sites

The main plugin architecture was introduced in SCAR Divi 3.35 and Legacy will (should) work in all versions 3.25 and above.

Share this post


Link to post
Share on other sites

I recommend using the "legacy", because I failed many times to get the new one to work...with certain things, and even simple things sometimes....

Share this post


Link to post
Share on other sites
The main plugin architecture was introduced in SCAR Divi 3.35 and Legacy will (should) work in all versions 3.25 and above.

Thank you that was exactly what I was looking for. Plan on using the Main anyway but was curious about what the cutoff versions where. Love ya man, but your documenting skills need some work.

 

I recommend using the "legacy", because I failed many times to get the new one to work...with certain things, and even simple things sometimes....

Yeah having a devil of a time getting the new plugin system to work. Creating a new Delphi project and adding his files to it does not behave the same as modifying his sample project. There must be some hidden settings in his Project settings I haven't figured out yet. I have yet to get a from scratch dll to work properly with SCAR.

Share this post


Link to post
Share on other sites
I recommend using the "legacy", because I failed many times to get the new one to work...with certain things, and even simple things sometimes....
Have you tried the latest version of Freddy's basic_exports.dll. Compiles fine in Delphi now but still can't get it to call from SCAR. Just wondering if I'm doing something wrong.

 

Edit: Has to be something with my Delphi setup? Just tried compiling ShellUtils. Same error: SCAR not reading exported functions and thus giving a compile error. Use Freddy's pre-compiled binary and it works fine. Compiling on Win 7 x86 and running on Win 7 x64. Shouldn't make a difference since SCAR and .dll are both 32 bit???

 

Edit2: How interesting. Solved problem with ShellUtils: Someone was being a dumbass and using {L ShellUtils.dll} instead of {$L ShellUtils.dll}. But basic_exports example gives a bizarre run time error: Unable to register type: bunch of unintelligible characters. This is the sample project just downloaded the latest version a few minutes ago. Have to look closer at this...

untitled.jpg

Edited by Bixby Sayz

Share this post


Link to post
Share on other sites

Until support for legacy is dropped, forget it. Not worth

messing with, take it from some one who's messed with it to the point of no return

Share this post


Link to post
Share on other sites
Until support for legacy is dropped, forget it. Not worth

messing with, take it from some one who's messed with it to the point of no return

 

If you know what you're doing, it works just fine. As demonstrated by https://github.com/FHannes/SMART-Remote-Wrapper/

 

Have you tried the latest version of Freddy's basic_exports.dll. Compiles fine in Delphi now but still can't get it to call from SCAR. Just wondering if I'm doing something wrong.

 

Edit: Has to be something with my Delphi setup? Just tried compiling ShellUtils. Same error: SCAR not reading exported functions and thus giving a compile error. Use Freddy's pre-compiled binary and it works fine. Compiling on Win 7 x86 and running on Win 7 x64. Shouldn't make a difference since SCAR and .dll are both 32 bit???

 

Edit2: How interesting. Solved problem with ShellUtils: Someone was being a dumbass and using {L ShellUtils.dll} instead of {$L ShellUtils.dll}. But basic_exports example gives a bizarre run time error: Unable to register type: bunch of unintelligible characters. This is the sample project just downloaded the latest version a few minutes ago. Have to look closer at this...

 

Are you still having issues? That screenshot looks like you're having a unicode related problem.

 

EDIT: I took a look and there appears to be an issue with type exporting in the sample, I'll have a closer look and commit a patch.

 

EDIt2: I've committed a fix, it should work fine now. The OnGetTypeInfo function had an extra parameter where it shouldn't have for some reason.

Edited by Freddy

Share this post


Link to post
Share on other sites
EDIt2: I've committed a fix, it should work fine now. The OnGetTypeInfo function had an extra parameter where it shouldn't have for some reason.

Nice to know I'm not losing my mind (always a possibility). I'll check it out later. Off Xmas shopping with my wife today. Joy!!!!!!!!!!

Share this post


Link to post
Share on other sites
Nice to know I'm not losing my mind (always a possibility). I'll check it out later. Off Xmas shopping with my wife today. Joy!!!!!!!!!!

 

Well, I'm glad you brought the issue to my attention. If everyone would keep using the legacy system, these things would keep going unnoticed.

Share this post


Link to post
Share on other sites
Well, I'm glad you brought the issue to my attention. If everyone would keep using the legacy system, these things would keep going unnoticed.

 

O they were noticed. Way back before now.

The legacy system is great, it saves time, and has a better appearance by far.

 

Cheers for legacy, and screw windows 8. The start button was such a good thing to have :(

Share this post


Link to post
Share on other sites
Cheers for legacy, and screw windows 8. The start button was such a good thing to have :(

Lol. Now be open. Different is not necessarily bad. It just means a bit of floundering while you figure how to do things the new way.

Share this post


Link to post
Share on other sites
O they were noticed. Way back before now.

The legacy system is great, it saves time, and has a better appearance by far.

 

Cheers for legacy, and screw windows 8. The start button was such a good thing to have :(

 

Unnoticed by me if no one tells me about it...

Share this post


Link to post
Share on other sites

Works like a charm for me now. Thanks Freddy. Now I can have a go at my own .dll using the MAIN architecture.

 

On a side note, with something like this should we use the bug tracker or no?

Share this post


Link to post
Share on other sites

Okay will do. Spoke to too soon on having it working heh heh. My test script was calling the legacy version of samples. Newest build locks SCAR up solid when it load the library.

 

F**k me this is turning out to be way more difficult than it should be. I spent years designing and developing a multi-tier database app and flying around the country deploying/training/supporting it. And yet I can't get a simple dll to build and call it. Wish I could see the look on my own face right now. Feel like such an idiot trying to get this going.

Share this post


Link to post
Share on other sites
Okay will do. Spoke to too soon on having it working heh heh. My test script was calling the legacy version of samples. Newest build locks SCAR up solid when it load the library.

 

F**k me this is turning out to be way more difficult than it should be. I spent years designing and developing a multi-tier database app and flying around the country deploying/training/supporting it. And yet I can't get a simple dll to build and call it. Wish I could see the look on my own face right now. Feel like such an idiot trying to get this going.

 

I KNEW IT >:)

 

welcome to jashinville

Share this post


Link to post
Share on other sites
I KNEW IT >:)

 

welcome to jashinville

Yeah, this is not fun. Blew everything away and started over. Main version of samples works fine now (appears to), and have my own "built from scratch" .dll working and returning values but it doesn't want to do any of the callbacks to SCAR functions yet. Been too long of a day and I'm tired enough I'm just spinning my wheels. I'll have a go at it again tomorrow.

Share this post


Link to post
Share on other sites
Yeah, this is not fun. Blew everything away and started over. Main version of samples works fine now (appears to), and have my own "built from scratch" .dll working and returning values but it doesn't want to do any of the callbacks to SCAR functions yet. Been too long of a day and I'm tired enough I'm just spinning my wheels. I'll have a go at it again tomorrow.

 

I am calling WriteLn in the dll, you could look at that as an example. If you're stuck, you can always PM me your code and I can take a look at it.

Share this post


Link to post
Share on other sites
I recommend using the "legacy", because I failed many times to get the new one to work...with certain things, and even simple things sometimes....
You ever get this going?

 

Finally managed to get this working with the MAIN architecture. Rewrote Freddy's example a bit to add comments and structure it so it flows like I think (and not like Freddy thinks). Found a bug too that most likely will never surface, but I'll report it anyway.

Share this post


Link to post
Share on other sites

Legacy has always worked. And should be still working even now...just take a look at the defines in OSI.scar lols

 

o and man 1k posts :D

Share this post


Link to post
Share on other sites

Newer (MAIN) plugins aren't that bad once I added some comments to Freddy's code so I could follow along and rearranged things a bit internally. COMMENTS PEOPLE! COMMENTS!!! (I sound like a broken record)

 

I am curious why he chose to implement his function list as a constant rather than stuff it in a variable. My version does that: took me a while though to remember/figure out how to bulk load an array of records. Plus I think my install of Rad Studio XE2 was a bit wonky. Reinstalled into a clean virtual machine and seems to be working better now.

 

Oh, and grats on the 1K posts.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...