Jump to content
shadowrecon

Librarys...

Recommended Posts

can some one give me hand in getting in the right direction on Compiling/Setting them up. I just want basic syntax on use id really like to understand them better to i could use them because from what i understand there are alot faster. Any articles/forum post with ANY information would be greatly appreciated.

 

Knowledge I know:

* .dll stands for Dynamic Link lib.

* Can use .dll from other langs.

 

Knowledge id like to know:

* What program to use to make the .dll file

* What are limitations

* Is it actually faster?

 

---------- Post added at 08:35 AM ---------- Previous post was at 05:30 AM ----------

 

So i found a program to compile my lib to .dll files but scar doesn't recognize the lib.

heres the lib: (Before compile of-course)

[scar]

library Maindll;

 

procedure MyDllProcedure;

begin

Writeln('Hello');

end;

 

exports MyDllProcedure;

 

begin

end.

[/scar]

 

heres how im calling it: (The .dll is in the same folder as this file)

[scar]

program Test;

{$L maindll.dll}

 

begin

MyDllProcedure;

end.

[/scar]

 

what am i doing wrong?

 

---------- Post added at 10:47 AM ---------- Previous post was at 08:35 AM ----------

 

well i finally figured out why that wasnt working =p Found this nice little thread http://rs-hacking.com/archive/index.php/thread-110.html

Edited by shadowrecon
Link to comment
Share on other sites

You can use this as an example: http://svn.scar-divi.com/scar_shellutils/

Do note that this library has to be compiled with Delphi 2009 or newer.

 

Why can the shell ulti only be compiled in delphi 2009 or newer?

 

So if im understanding this correctly, the units are temporary, you just add them to the uses in the main file. then once compiled the only file you need is the .dll.

 

Also, can i just include the unit "SCARFunctions;" file as a unit and use then functions from it? or do i need to make my own setup for which functions i want to use?

Edited by shadowrecon
Link to comment
Share on other sites

You can only compile this with 2009 and newer because older versions don't have unicode integration, this was coded specifically with that in mind. The upcoming plugin architecture will allow you to use any version though.

 

Once compiled all you need is the dll, yes.

 

Yes and no, the functions were removed in 3.31, you can only use WriteLn atm as the export method was no longer compatible with the new engine system, support will be readded with the new architecture though.

 

The ETA for the new plugin architecture is SCAR 3.33.

Link to comment
Share on other sites

You can only compile this with 2009 and newer because older versions don't have unicode integration, this was coded specifically with that in mind. The upcoming plugin architecture will allow you to use any version though.

 

Once compiled all you need is the dll, yes.

 

Yes and no, the functions were removed in 3.31, you can only use WriteLn atm as the export method was no longer compatible with the new engine system, support will be readded with the new architecture though.

 

The ETA for the new plugin architecture is SCAR 3.33.

Thanks Freedy nice neat little explanation, there are a lot of possibility's with lib but deff going to take some getting use to. =/

 

One more question is/are plugins faster at floating point calculations and such?? and is this due to them already being in machine lang? (or what ever they are compiled in)

Link to comment
Share on other sites

You can only compile this with 2009 and newer because older versions don't have unicode integration, this was coded specifically with that in mind. The upcoming plugin architecture will allow you to use any version though.

 

Can't you just cast to PWideChar? :P

Link to comment
Share on other sites

Libraries are faster at everything since SCAR's current script engine is slow as f*ck :P SCAR 4's engine will provide "near native performance", as it compiles scripts into native machine code as well.
lol. Yeah, floating point calculations take a lot of CPU / time to complete.( well not alot but ms add up over time =p) anyways thanks for the answer. Now i just need to learn how to make my own libs correctly. =)
Link to comment
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...