<!-- MHonArc v2.4.4 --> <!--X-Subject: Re: [MUD-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-ix6.ix.netcom.com --> <!--X-Content-Type: text/plain --> <!--X-Reference: 9803211803.8w26@ami-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> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00824.html">Previous</a> | <a href="msg00826.html">Next</a> ] Thread: [ <a href="msg00808.html">Previous</a> | <a href="msg00804.html">Next</a> ] Index: [ <A HREF="author.html#00825">Author</A> | <A HREF="#00825">Date</A> | <A HREF="thread.html#00825">Thread</A> ] <!--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" <<A HREF="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</A>></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: > [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 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 <<A HREF="http://www.netcom.com/~jlsysinc">http://www.netcom.com/~jlsysinc</A>> /*\-- --/*\ "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> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>