<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Wikipedia described how this can be done:<br>
    <a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Dynamic_loading#In_C.2FC.2B.2B">http://en.wikipedia.org/wiki/Dynamic_loading#In_C.2FC.2B.2B</a><br>
    <br>
    It's not so difficult at all. You just need to create function
    pointer variables for the functions you want to call, then use
    dlopen(...) to open the mono library, and dlsym(...) to lookup a
    symbol.<br>
    <br>
    However, do you really need to cleanup/unload the mono runtime? You
    could use a global variable to indicate whether the mono runtime has
    been initialized before, and if it is you don't initialize the
    runtime again. You don't need to unload the runtime itself. If you
    want to get rid of what's running, you can probably unload the
    assembly and application domain.<br>
    <br>
    --<br>
    Ivo<br>
    <br>
    Op 13-5-2011 15:30, Zoltan Varga schreef:
    <blockquote
      cite="mid:BANLkTim+HkO6aEB3BwZy5aL0Bk4nPodhNQ@mail.gmail.com"
      type="cite">You need to use mono's shared library libmono.so, and
      somehow make the OS load/unload it. Its not easy to do, but
      doable.
      <div><br>
      </div>
      <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Zoltan<br>
        <br>
        <div class="gmail_quote">On Fri, May 13, 2011 at 2:43 PM,
          MartinAlexander <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:martin.arvidsson@gmail.com">martin.arvidsson@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">How do you mean? I think this is what I
            am doing now . I admit I was unclear<br>
            but the commercial application is written in native C++ and
            calls my native<br>
            library (dll/so). In OnInit I call mono_jit_init and in
            OnUninit I call<br>
            mono_jit_cleanup.<br>
            <font color="#888888"><br>
              --<br>
              View this message in context: <a moz-do-not-send="true"
href="http://mono.1490590.n4.nabble.com/Embedding-Mono-multiple-calls-to-mono-jit-init-tp3519842p3520110.html"
                target="_blank">http://mono.1490590.n4.nabble.com/Embedding-Mono-multiple-calls-to-mono-jit-init-tp3519842p3520110.html</a><br>
            </font>
            <div>
              <div class="h5">Sent from the Mono - Dev mailing list
                archive at Nabble.com.<br>
                _______________________________________________<br>
                Mono-devel-list mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:Mono-devel-list@lists.ximian.com">Mono-devel-list@lists.ximian.com</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.ximian.com/mailman/listinfo/mono-devel-list"
                  target="_blank">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Mono-devel-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Mono-devel-list@lists.ximian.com">Mono-devel-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-devel-list">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a>
</pre>
    </blockquote>
  </body>
</html>