Menu

DLL Functions

Developers
2002-04-05
2002-04-14
  • Angel Freire

    Angel Freire - 2002-04-05

    First we must discuss the dll filename.
    openmts.dll is OK in my opinion but it would be like the name of the proyect, so we must to keep an eye in OSDE thread (http://sourceforge.net/forum/forum.php?thread_id=662336&forum_id=165271).

    The the funtions. Open MTS must "compile" the theme like KTE does (not exactly the same way, just for an example) and after that load it on the mIRC. So a function for that:
    LoadTheme <File> <SchemeNum>
    It must first, check if the <File> is a valid MTS. After that it must call the /theme.text Unload for the unload event of the theme. Then it should write the .mrc file with the theme in a temporary file, load the colors/images/fonts, an then it need to Unload the old theme file, erase it (or save it for buffer) rename the new one and load it, at last it should do a /theme.text Load

    Mostly scripts that uses MTS are prety similar, but anyways no one should need all-around MTS features, a function for disable some of theme before the Loadind stuff is needed so all scripters can use this:
    SetFeatures <Codes>
    Codes can be a list of 1 and 0 tokenisen with ,. First the color stuff, then the Nicklist, then the Fonts, then the Images, and after that the Miscellaneous. This is the order that uses the draft.

    An example of this function can be:
    dll openmts.dll SetFeatures 1,1,1,0,1
    This would set all features exept for the background images.

    Also a MTSInfo can help a lot, this Class can retrieve info from the files without any need of load them:
    $dll(openmts.dll, MTSInfo, <ThemeFile> <TAG>)
    Where tag can be something like Name or Scheme1.
    This way anyone who wants preview the theme or take info of it to put it in a dialog have half of the work done.

    Other ideas pals?
    Maybe a preview system able to make custom bmps, or just a custom /drawtext command that can use RGB values from a theme without load it.

    PS: I don't know how to write this "Functions", have 0 idea if it is spelled Funcions or something, please excuse me.
    PS2: Sorry for my english, it su*** more every day.

     
    • Albert Smithson

      Albert Smithson - 2002-04-06

      Great ideas!

       
      • Greg Weible

        Greg Weible - 2002-04-12

        Ok, a couple of questions...

        First, DLL development is in C++ correct? (please say yes, my Delphi knowledge blows!)

        Second, a list of desired functions would be nice.  What all will the DLL handle?  What all will be handled by mIRC?  What misc functions will be incorporated into the DLL?

        Third, sir_homer, please setup the CVS functionality here so that we can share the coding for the DLL.  I believe you can set the CVS up to only allow our members to grab from it until development allows us to release a public version.  (I also think that we should keep the DLL source closed to non-members until after we make an official release... for security reasons.)

        Till next time, fare thee well...

        Lord Tiernan
        tiernan(at)lomag.net

         
        • Greg Weible

          Greg Weible - 2002-04-12

          Here's a couple ideas on calls made to and returning information from the functions DLL...

          1) Each function within the DLL should have an internal ID number for debugging purposes... ErrorID should be comprised of: DLL version + Function Number

          *** Both mFunction() and mReturn() are custom C++ functions that I am using to cut down on DLL size.  I am submitting a template for developers to use that include the two functions.  I am also writing a header that will include some more advanced functions for text parsing etc. ***

          // ErrorID: 1001
          mFunction(mts_version) {
            char* tmp = data
            if (!tmp) {
              mReturn("-Error [1001]: Improper/invalid function call: $dll(openmts.dll,FUCNTION,PARMS)");
            }
            mReturn("+OK OpenMTS 1.0 - http://sourceforge.net/projects/openmts"\);
          }

          2) All DLL calls should be via $dll(openmts.dll,data,parameters)

          3) Each call will return either:
          a) +OK returned information
          or
          b) -ERROR [ErrorID]: Error text here

          That's all I can think of at this moment... of course it's 4:50am and I have been up since 11am the day before!!!  Let me know what y'all think of these ideas, and please feel free to add ideas, etc :o)

          Till next time, fare thee well...

          Lord Tiernan
          tiernan(at)lomag.net

           
    • Albert Smithson

      Albert Smithson - 2002-04-12

      DLL code will be in C++ (or C). The backend of the MTS engine should be completly DLL, and this includes the actual loading of the MTS theme (the DLL should send the proper commands to mIRC and load the proper variables).

       
    • Angel Freire

      Angel Freire - 2002-04-14

      Yes, DLL should be made in C++, I think that if its posible should be Visual C++ 6.0, this one will run on all windows (.NET sucks with wins9X).

      Also the DLL source must wait to be release.

      Great work lrdtiernan, I will be helping you soon (My computer is at the service but I'll be here on monday). So send me this "template" when it's finish so I can start coding, my work until now has ben 100% in mIRC.

      See you soon ppl.

       

Log in to post a comment.

MongoDB Logo MongoDB