Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Load DLL in plugin?

    SDK Help
    0
    3
    336
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 19/05/2013 at 02:46, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R13+ 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Anybody know of the best way to load a dll from within a plugin (Command plugin in this case)?  There are no facilities in the SDK so it would either need to be platform specific or it might be made independent using Qt or some other library, one that supports dll loading/unloading, statically built into the plugin.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 19/05/2013 at 05:34, xxxxxxxx wrote:

        Originally posted by xxxxxxxx

        <ADDRESS>
        User Information:
        Cinema 4D Version:   R13+ 
        Platform:   Windows  ;  
        Mac OSX  ; 
        Language(s) :    
        C++  ;

        ---------
        </ADDRESS> Anybody know of the best way to load a dll from within a plugin (Command plugin in this case)?  There are no facilities in the SDK so it would either need to be platform specific or it might be made independent using Qt or some other library, one that supports dll loading/unloading, statically built into the plugin.

        On the PC use:

          
        dll_handle = LoadLibrary( path );   
        

        (Have a look at MS docs for error codes).

        On OS X (/Linux) use

          
                  handle = dlopen( path, mode );               // RTLD_LOCAL: The loaded images exported symbols are generally hidden. They are available only to dlsym invocations that use the handle returned by this function                  
                  error_message = dlerror();   
                  if ( error_message )   
                       GeDebugOut("OS error at dlopen %s", error_message );   
          
        

        (See man page or OS X docs for possible values of <mode> and error codes).

        Best regards,

        Wilfried

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 19/05/2013 at 08:08, xxxxxxxx wrote:

          Alright.  It looks like I will be going the platform-independent support way.

          Thanks!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post