1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Dynamic Loading of Modules -->
<!--X-From-R13: "Xba O. Znzoreg" <wyflfvapNvk.argpbz.pbz> -->
<!--X-Date: Sun, 22 Mar 1998 19:31:59 +0000 -->
<!--X-Message-Id: 199803221931.NAA00670@dfw&#45;ix6.ix.netcom.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 9803211803.8w26@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--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:jlsysinc#ix,netcom.com">
</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="msg00824.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00826.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00808.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00804.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00825">Author</A>
&nbsp;|&nbsp;<A HREF="#00825">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00825">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>: "Jon A. Lambert" &lt;<A HREF="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</A>&gt;</LI>
<LI><em>Date</em>: Sun, 22 Mar 1998 14:34:54 -5</LI>
<LI><em>Reply-to</em>: <A HREF="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On 21 Mar 98 at 10:21, Chris Gray wrote:
&gt; [Niklas Elmqvist:]
&gt; 
&gt; :Yes, I do know that Windows has dynamically linked libraries, just like
&gt; :Sun and Linux and whatnot (I think they had that *before* it went
&gt; :32-bit, however). However, I suppose you did not read the earlier
&gt; :part (this may be blamed on my too-active-snippage), where I explained
&gt; :about my "discovery" where a server binary with a base class called aClass
&gt; :could dynamically load a module which implemented a subclass of aClass
&gt; :called bClass and *still* use the bClass (as a reference to an aClass
&gt; :object, of course, using polymorphism) even though the server had no idea
&gt; :of its existence at compile-time. (Phew.) According to my RL friend (I
&gt; :have no personal experience in this), this scheme is impossible to
&gt; :implement using Windows DLLs -- I believe he tried after hearing me
&gt; :explain about it.
&gt; 
&gt; Well, I hate to think I'm becoming knowledgeable about Windows, but I
&gt; guess its actually true. A co-worker and I have been playing with a small
&gt; DLL on NT, and the debugger and paging interfaces. We haven't been using
&gt; C++, however, just C, so there may be some extra stuff we haven't noticed.
&gt; 
&gt; In order to get your dynamic stuff working right, you have to (of course)
&gt; ensure that the main code and the dynamic code are compiled by the same
&gt; compiler, so that the mangled names come out right. You also normally
&gt; use the '__cdecl(dllexport)' magic word with DLL entry points. So, you
&gt; would need the partner '__cdecl(dllimport)' on the declaration of the
&gt; function pointers you use. 

I have only played with this stuff in C++, specifically BorlandC++.  
I know that Visual C++ 4.1 and earlier did not support the _import 
keyword.  Most of the items Nicklas mentions are more compiler 
dependent than OS dependent.  Prologue and epilogue code (vtables) 
are generated by the compiler to handle run-time polymorphism, thus, 
while it can be done in C, you will be writing this code yourself.  
All modules must be prepared with the same compiler.

--
--/*\ Jon A. Lambert - TychoMUD     Internet:jlsysinc#ix,netcom.com /*\--
--/*\ Mud Server Developer's Page &lt;<A  HREF="http://www.netcom.com/~jlsysinc">http://www.netcom.com/~jlsysinc</A>&gt; /*\--
--/*\   "Everything that deceives may be said to enchant" - Plato   /*\--

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00808" HREF="msg00808.html">Re: [MUD-Dev]	Dynamic Loading of Modules</A></STRONG>
<UL><LI><EM>From:</EM> cg#ami-cg,GraySage.Edmonton.AB.CA (Chris Gray)</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00824.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00826.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00808.html">Re: [MUD-Dev]	Dynamic Loading of Modules</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00804.html">Parlez vous NPC?</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00825"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00825"><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>
<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>
<LI><strong><A NAME="00869" HREF="msg00869.html">Re: [MUD-Dev]  Parlez vous NPC?</A></strong>, 
Nathan F Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Tue 24 Mar 1998, 03:39 GMT
</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>