1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]	Dynamic Loading of Modules -->
<!--X-From-R13: ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO (Quevf Uenl) -->
<!--X-Date: Sat, 21 Mar 1998 17:58:21 +0000 -->
<!--X-Message-Id: 9803211803.8w26@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Content-Type: text -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]	Dynamic Loading of Modules</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00807.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00809.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00813.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00825.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00808">Author</A>
&nbsp;|&nbsp;<A HREF="#00808">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00808">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev]	Dynamic Loading of Modules</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev]	Dynamic Loading of Modules</LI>
<LI><em>From</em>: <A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A> (Chris Gray)</LI>
<LI><em>Date</em>: Sat, 21 Mar 98 11:03:48 MST</LI>
<LI><em>>Received</em>: by ami-cg.GraySage.Edmonton.AB.CA (V1.17-beta/Amiga)  id &lt;8w26#ami-cg,GraySage.Edmonton.AB.CA&gt;; Sat, 21 Mar 98 11:03:48 MST</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
[Niklas Elmqvist:]

:Yes, I do know that Windows has dynamically linked libraries, just like
:Sun and Linux and whatnot (I think they had that *before* it went
:32-bit, however). However, I suppose you did not read the earlier
:part (this may be blamed on my too-active-snippage), where I explained
:about my "discovery" where a server binary with a base class called aClass
:could dynamically load a module which implemented a subclass of aClass
:called bClass and *still* use the bClass (as a reference to an aClass
:object, of course, using polymorphism) even though the server had no idea
:of its existence at compile-time. (Phew.) According to my RL friend (I
:have no personal experience in this), this scheme is impossible to
:implement using Windows DLLs -- I believe he tried after hearing me
:explain about it.

Well, I hate to think I'm becoming knowledgeable about Windows, but I
guess its actually true. A co-worker and I have been playing with a small
DLL on NT, and the debugger and paging interfaces. We haven't been using
C++, however, just C, so there may be some extra stuff we haven't noticed.

In order to get your dynamic stuff working right, you have to (of course)
ensure that the main code and the dynamic code are compiled by the same
compiler, so that the mangled names come out right. You also normally
use the '__cdecl(dllexport)' magic word with DLL entry points. So, you
would need the partner '__cdecl(dllimport)' on the declaration of the
function pointers you use. I don't know whether that is syntactically
allowed or not. If its not, then perhaps you don't want your exported
routines to actually show up as DLL entry points. That makes it harder
to find them in the loaded DLL code. One way would be to have a standard
entry point in each DLL, say 'getPointers', which returns a vector of
function pointers and names, so that your base code can then find the
proper ones at run time. Those routines wouldn't need the magic decoration.
So, I don't see any reason why your scheme wouldn't work with DLL's.

Oh yes, make sure everything is compiled with the same linkage convention,
such as '_cdecl'.

--
Chris Gray   cg#ami-cg,GraySage.Edmonton.AB.CA


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00825" HREF="msg00825.html">Re: [MUD-Dev] Dynamic Loading of Modules</A></strong>
<ul compact><li><em>From:</em> "Jon A. Lambert" &lt;jlsysinc#ix,netcom.com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00807.html">Re: [MUD-Dev]  Parlez vous NPC?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00809.html">Re: [MUD-Dev]	Parlez vous NPC?</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00813.html">Re: [MUD-Dev] Parlez vous NPC?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00825.html">Re: [MUD-Dev] Dynamic Loading of Modules</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00808"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00808"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00859" HREF="msg00859.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Mon 23 Mar 1998, 20:48 GMT
</LI>
</ul>
</ul>
<LI><strong><A NAME="00857" HREF="msg00857.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Mon 23 Mar 1998, 20:41 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00809" HREF="msg00809.html">Re: [MUD-Dev]	Parlez vous NPC?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 21 Mar 1998, 18:10 GMT
<UL>
<LI><strong><A NAME="00813" HREF="msg00813.html">Re: [MUD-Dev] Parlez vous NPC?</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Sun 22 Mar 1998, 12:46 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00808" HREF="msg00808.html">Re: [MUD-Dev]	Dynamic Loading of Modules</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 21 Mar 1998, 17:58 GMT
<UL>
<LI><strong><A NAME="00825" HREF="msg00825.html">Re: [MUD-Dev] Dynamic Loading of Modules</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 22 Mar 1998, 19:31 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00804" HREF="msg00804.html">Parlez vous NPC?</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Sat 21 Mar 1998, 02:49 GMT
<UL>
<LI><strong><A NAME="00805" HREF="msg00805.html">Re: [MUD-Dev]  Parlez vous NPC?</A></strong>, 
Vadim Tkachenko <a href="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</a>, Sat 21 Mar 1998, 04:26 GMT
<UL>
<LI><strong><A NAME="00807" HREF="msg00807.html">Re: [MUD-Dev]  Parlez vous NPC?</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Sat 21 Mar 1998, 13:12 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>