forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Writing a VDS-DLL in VDS?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Wed Jan 24, 2007 12:04 pm    Post subject: Writing a VDS-DLL in VDS? Reply with quote

Hi,

Is it possible to write a VDS-DLL in VDS? Because i need to write a DLL like program that can generate events and have functions and commands to control different external equipment, but needed to have only one main program because that has to be updated frequently on different machines with different equipment and so i don't have to worry what the controls for that equipment are because they are controlled by the DLL on that machine.

Bart
Back to top
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Wed Jan 24, 2007 1:24 pm    Post subject: Reply with quote

Hi Bart,

It sounds to me like what you want is a DSU. It.s sort of like a dll, but written entirely in VDS. A search of the forums on "dsu" should find you plenty of info on making them...

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Wed Jan 24, 2007 2:14 pm    Post subject: Reply with quote

But as far as i understood is that a DSU compiled into the exe file, so i still need to compile for every different hardware setup a exe file and that is what i want to avoid.
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed Jan 24, 2007 5:20 pm    Post subject: Reply with quote

A DSU is a standalone file that you can reuse with as many executables as you want. So for instance, you might have 5 .exes running that are all calling functions from the same .dsu.
_________________
Joe Floyd
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Jan 24, 2007 7:05 pm    Post subject: Reply with quote

You might try my Gateway DLL to simulate a VDS-DLL. Create one program which does the core functions and another one which acts like the GUI and use this DLL to call events. Smile

http://www.vdsworld.com/search.php?keywords=gateway

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Thu Jan 25, 2007 8:28 am    Post subject: Reply with quote

jwfv wrote:
A DSU is a standalone file that you can reuse with as many executables as you want. So for instance, you might have 5 .exes running that are all calling functions from the same .dsu.


I tested it but the executable running without the original DSU on a computer so i assume the DSU is compiled into the EXE (correct me if i'am wrong)

@skit: I gonna look into it, thanks.
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Thu Jan 25, 2007 1:51 pm    Post subject: Reply with quote

Yes, a DSU is compiled into the EXE. It's more like a LIB or OBJ file in other languages, or a Delphi DCU.

It is not possible to create DLLs using VDS. VDS 6 will have the ability to create a number of different executable types, such as standalone runtime-free EXEs, console EXEs and NT Service EXEs, but the ability to create DLLs would have involved considerable extra work and it was deemed not worth the effort when compared to other things the time could be spent on.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Fri Jan 26, 2007 1:10 am    Post subject: Reply with quote

I think I misunderstood your original question. Yes, a dsu is included in the script at compilation time. I thought you just wanted a single place to put reusable functions, and then include that dsu in all your programs. Sorry if I confused the issue -
_________________
Joe Floyd
Back to top
View user's profile Send private message
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Fri Jan 26, 2007 2:11 pm    Post subject: Reply with quote

Skit, i tried gateway.dll but it crashes sometimes for no reason, mostly when sending a lot of data trough it in a short period of time, is this a known problem?
Back to top
View user's profile Send private message
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Fri Jan 26, 2007 2:16 pm    Post subject: Reply with quote

jwfv wrote:
I think I misunderstood your original question. Yes, a dsu is included in the script at compilation time. I thought you just wanted a single place to put reusable functions, and then include that dsu in all your programs. Sorry if I confused the issue -


No prob, i never used DSU files before so now i know how they do there job Wink
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Jan 26, 2007 8:09 pm    Post subject: Reply with quote

Bart wrote:
Skit, i tried gateway.dll but it crashes sometimes for no reason, mostly when sending a lot of data trough it in a short period of time, is this a known problem?


To be honest, I didn't really create the DLL myself Rolling Eyes I took the source code of Prakash' vdsmem DLL and changed some function names and added event support. I also don't know if it can have anything to do with VDS 5; not all DLLs which are created for previous version work without problems.

If you are sending a lot of data between the applications, another solution might be to set up an TCP/IP connection with localhost. Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Jan 30, 2007 10:18 am    Post subject: Reply with quote

Skit3000 wrote:
I also don't know if it can have anything to do with VDS 5; not all DLLs which are created for previous version work without problems.

I seem to remember there is a problem with the example Delphi code for creating a VDS extension. It passes a string result that is created on the stack. When compiled with Delphi 2 the same as the VDS runtime this didn't seem to matter but later versions of Delphi use a different memory manager. The solution is simply to ensure that the variable containing the result that you pass back is declared in the main program block not in the function itself.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Tue Jan 30, 2007 2:14 pm    Post subject: Reply with quote

Jules & Skit,
There is an update to the Delphi extension template in the Articles section here at http://www.vdsworld.com/search.php?view_mode=fileinfo&file_id=6

However I doubt that the issue is anything to do with sending parameters. Most likely it is due to the size of the shared memory mappings that are being used in the Gateway.dll... You pobably need to limit the amount of data your sending or send memory addresses using the @addr() function in VDS. This way the data is not on the stack and is in heap memory. In most cases the stack for a single function is only 4096 characters. Keep your data below that and it will probably do ok. I am only speculating here and have not seen the source code of the DLL myself but if Skit used the code from a DLL that PGWare wrote then it should be compatible with VDS 5 since I remember him stating that all his DLL's were updated to work with VDS 5.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Jan 30, 2007 3:05 pm    Post subject: Reply with quote

I wrote it before VDS 5 was released and lost the source code afterwards... Crying or Very sad
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Tue Feb 13, 2007 10:19 am    Post subject: Reply with quote

Skit3000 wrote:
If you are sending a lot of data between the applications, another solution might be to set up an TCP/IP connection with localhost. Smile


Sorry for the late response but thanks for the tip, i gonna try it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group