Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 11:10 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Opus version 6.0 and DLL's
PostPosted: May 14th, 2007, 2:54 am 
Offline

Joined: November 3rd, 2004, 12:58 pm
Posts: 230
Location: Australia
Hello, I am using my new Opus version 6.0 and I love it! DW has done a great number of improvements to give us a very robust and functional program and everyday I discover something new.

I have noticed that we can now play around creating DLL but this is new "uncharted territory" for me so I would like to know if anybody here can enlight me and my fellow Opus users in the following:

1-What is a DLL? I know that it is a Windows Library File with the potential to execute commands to do a lot of sort of things but is there anything else to know that may be of importance to all of us?

2-What sort of practical uses can be exploit by crating these DLL's in our daily routine of creating multimedia apps.

3-Where can we learn how to create these DLL's?


The above are probably the 3 most important questions that I can think of at the moment and obviously only people who uses these kind of files will be able to answer them so please, if you are one of those "DLL gurus", can you enlight the rest of us, simple mortals?

Thanks

German
Brisbane, Australia

_________________
German Silva
Senior Web & Multimedia Developer
E-solutions Inc
Pro version 8.10 user


Top
 Profile  
 
 Post subject:
PostPosted: May 14th, 2007, 9:08 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
Sorry for the long reply!!!


DLL is a Dynamic Linked Library. very basically, It's like a plug-in for windows which can be shared by all applications requiring it, but...for Opus, DLLs are for using, rather than for creating. You don't create a DLL from Opus.
Imagine you have written something in Opus and you need to use a calculator. You could write your own, but how nice it would be if you could simply use the one that comes as standard with windows!! Having the DLL support allows you to do this type of thing directly from Opus so your program is smaller because you dont have the code to create an internal calculator.



So a DLL is like a chunk of code which does something and there are public 'functions' available for anyone to use. Another term used is API (Application Programming Interface). The two terms are generally interchangable. An API would normally comprise many DLLs and defines the larger interface to the external function.

So the most immediatly useful way of using this capability is to use the huge number of windows libraries which are supplied with it.

that's the 'easy' bit. The difficult bit is finding the information on the DLLs and actually knowing about them. Web searching is the best way of finding that. Microsoft make all their API/DLLs public, so the information is there for the finding.




However....for me, it has an even more interesting use. Every piece of hardware which plugs into a PC will come with a DLL. The DLL acts as a software interface which allows windows to drive the hardware.

I have an interface card connected to my PC and the documentation on the DLL. The card has 20 functions..
for example the DLL has the following functions:-
1 OpenDevice(long CardAddress)
2 OutputAnalogueChannel(long Channel, long Data)
3 ReadAnalogueChannel(long Channel)

these are public functions available to me

I have a script in my Opus publication and a function called OpenDevice.....

function OpenDevice(Address)
{
MyDLL=LoadDLL(SYSTEM_WINSYS_DIR+"Interface.dll")
if(MyDLL)
{
Open=MyDLL.CallFn("OpenDevice","false","slong","ulong",Address)
}

else
{
Debug.trace("DLL not loaded")
}
}


In my opus publication I have a button with the OpenDevice function attached, so when the buttion is pressed OpenDevice(0) is called....open device zero...(zero is the card address)
When the button is pressed, my Opus function is called, which in turn calls the OpenDevice function of the interface card, sending an unsigned long number for the address....and the card is opened.

I have another button called 'Channel 1 ON'
When this is pressed it makes the call to my opus function called OutputAnalogueChannel(1,255)
here is the function.........
function OutputAnalogChannel(Channel,Data)
{
MyDLL.CallFn("OutputAnalogChannel","false","none","ulong",Channel,"ulong",Data)
}

So this calls the OutputAnalogueChannel function of the external card, sending the channel number and setting...channel one is set to 255, which is maximum output, if I wanted half output I would use (1,127). For channel 2 set to max, it would be (2,255).

The third function causes the card to return a value, I am reading the value of the analogue input channel. My Opus function is

function ReadAnalogChannel(Channel)
{ ReadAChannel=MyDLL.CallFn("ReadAnalogChannel","false","ulong","ulong",Channel)
}

When I call this, the value is read from the card and put into the 'ReadAChannel' variable in my publication.


The possibilities introduced by DLL support and endless!!!!

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: May 14th, 2007, 9:53 am 
Offline

Joined: October 25th, 2004, 3:03 pm
Posts: 540
Location: Tyalgum Creek. Australia
Opus: Opus Pro Latest version 9.02 Build 16458
OS: Won 10
System: Asus laptop Intel Core i5 8 gig ram, big monitor, reading glasses
Sandyn

You're absolutely over the moon and back about Version 6 dll support :D


Thank you for sharing your dll experiences with us!

Cheers

Graham

_________________
Too much coffee can result in frequent toilet breaks!


Top
 Profile  
 
 Post subject: Great information!
PostPosted: May 15th, 2007, 12:18 am 
Offline

Joined: November 3rd, 2004, 12:58 pm
Posts: 230
Location: Australia
Sandy, great information!
Thank you very much for sharing this with us!
If I may ask you one more question...what tool do you use to write DLL?
Thanks
German

_________________
German Silva
Senior Web & Multimedia Developer
E-solutions Inc
Pro version 8.10 user


Top
 Profile  
 
 Post subject:
PostPosted: May 15th, 2007, 9:18 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I've never had any need to create a DLL, but you can use C#, Delphi, C++, Visual Basic and other languages.

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: May 15th, 2007, 4:54 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Koala,

You can download several of these languages for free in the form of Microsoft's Visual Studio Express Editions. Can't be used for commercial use but great for practicing.

Get C# from here:
http://msdn.microsoft.com/vstudio/expre ... fault.aspx

Then follow the tutorial on creating a class (dll) from here:
http://www.c-sharpcorner.com/UploadFile ... M/dll.aspx


Mack

Edit: Having spent a few hours looking at this, it seems that the Wizards mentioned in the article have been removed from C# - but if you scroll further down, the whole code for the DLL can be copied into your project and builds correctly.

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Thanks!
PostPosted: May 16th, 2007, 7:24 am 
Offline

Joined: November 3rd, 2004, 12:58 pm
Posts: 230
Location: Australia
Mack, thank you very much! I'll visit those sites!

German

_________________
German Silva
Senior Web & Multimedia Developer
E-solutions Inc
Pro version 8.10 user


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Majestic-12 [Bot] and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group