www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - status of shared-libs on Windows?

reply Graham Fawcett <fawcett uwindsor.ca> writes:
Hi folks,

I've only used D on Linux so far, so I'm not clear on the current
shared-library story on Windows. Consider an existing C++ application that
can be extended by writing plugins, which are usually written in C or C++,
and compiled as DLLs. Very generally speaking, is DMD capable of producing
DLLs that could be used by such an application?

If so, should I expect runtime-related issues if I create multiple plugins
with DMD, and load them all into the app? (I recall some discussion about
runtime problems with multiple shared libs, but perhaps that was in the
context of a D program loading D shared-libs.)

Thanks,
Graham
May 19 2011
parent reply Trass3r <un known.com> writes:
Am 19.05.2011, 22:28 Uhr, schrieb Graham Fawcett <fawcett uwindsor.ca>:

 Hi folks,

 I've only used D on Linux so far, so I'm not clear on the current
 shared-library story on Windows. Consider an existing C++ application  
 that
 can be extended by writing plugins, which are usually written in C or  
 C++,
 and compiled as DLLs. Very generally speaking, is DMD capable of  
 producing
 DLLs that could be used by such an application?

Yep. Just be sure to use dll_helper as described in http://www.digitalmars.com/d/2.0/dll.html to intialize the runtime properly.
 If so, should I expect runtime-related issues if I create multiple  
 plugins with DMD, and load them all into the app?

Never tried that.
May 19 2011
next sibling parent Trass3r <un known.com> writes:
(I've already successfully created and used Matlab .mex/.dll plugins with  
D)
May 19 2011
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
dll helper is dead in latest release, you should use core.sys.windows.dll;

Bug report for the website has been reported already.
May 19 2011
prev sibling next sibling parent Jimmy Cao <jcao219 gmail.com> writes:
--0016363b880e142dbf04a3a998cf
Content-Type: text/plain; charset=ISO-8859-1

I've even created a dll that is used as a keylogger hook thing for Windows
with only D.

--0016363b880e142dbf04a3a998cf
Content-Type: text/html; charset=ISO-8859-1

I&#39;ve even created a dll that is used as a keylogger hook thing for Windows
with only D.

--0016363b880e142dbf04a3a998cf--
May 19 2011
prev sibling next sibling parent Trass3r <un known.com> writes:
Am 20.05.2011, 01:44 Uhr, schrieb Jimmy Cao <jcao219 gmail.com>:
 I've even created a dll that is used as a keylogger hook thing for  
 Windows
 with only D.

Just remembering that I also created a COM dll with D to intercept DirectDraw calls in an old game.
May 19 2011
prev sibling next sibling parent Graham Fawcett <fawcett uwindsor.ca> writes:
On Fri, 20 May 2011 03:43:09 +0200, Trass3r wrote:

 Am 20.05.2011, 01:44 Uhr, schrieb Jimmy Cao <jcao219 gmail.com>:
 I've even created a dll that is used as a keylogger hook thing for
 Windows
 with only D.

Just remembering that I also created a COM dll with D to intercept DirectDraw calls in an old game.

Thanks, Trass3r et al! I'll give it a try in D, then. Best, Graham
May 20 2011
prev sibling next sibling parent Trass3r <un known.com> writes:
 Thanks, Trass3r et al! I'll give it a try in D, then.

Of course you can't create 64Bit dlls though ;)
May 20 2011
prev sibling parent Graham Fawcett <fawcett uwindsor.ca> writes:
On Fri, 20 May 2011 16:19:27 +0200, Trass3r wrote:

 Thanks, Trass3r et al! I'll give it a try in D, then.

Of course you can't create 64Bit dlls though ;)

D'oh! There's always something. :) (I don't *think* this is a problem in my case, though.) Cheers, Graham
May 20 2011