home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / ODynamicLib.hpp < prev    next >
C/C++ Source or Header  |  1996-02-06  |  3KB  |  94 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // ODynamicLib.hpp
  5.  
  6. /*
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  13.  *    endorse or promote products derived from this software
  14.  *    without specific prior written permission.
  15.  * 3. See OCL.INF for a detailed copyright notice.
  16.  *
  17.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  18.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27.  * SUCH DAMAGE.
  28.  */
  29.  
  30. // $Header: E:/Projects/OCL/Include/rcs/ODynamicLib.hpp 1.9 1996/01/16 10:12:18 B.STEIN Release B.STEIN $
  31.  
  32. #ifndef ODYNAMICLIB_INCLUDED
  33.   #define ODYNAMICLIB_INCLUDED
  34.  
  35. #ifndef OSTRING_INCLUDED
  36.   #include <OString.hpp>
  37. #endif
  38.  
  39. #ifndef OVIOEXCEPTION_INCLUDED
  40.   #include <OVioException.hpp>
  41. #endif
  42.  
  43. typedef class ODynamicLib *pODynamicLib;
  44.  
  45. class __CPP_EXPORT__ ODynamicLib
  46.   : virtual public OCLObject
  47. {
  48.  private:
  49.    HMODULE modHandle;
  50.  
  51.  public:
  52.  
  53.    ODynamicLib          (HMODULE mod = (HMODULE)NULL);
  54.  
  55.    ODynamicLib          (PCSZ libname);
  56.  
  57.    virtual
  58.       ~ODynamicLib      (); // frees the module!!
  59.  
  60.    virtual
  61.       PSZ isOfType      () const;
  62.  
  63.    HMODULE getLibHandle ();
  64.  
  65.    PSZ queryModuleName  ();
  66.  
  67.    ODynamicLib
  68.      &setLibHandle      (HMODULE mod = (HMODULE)NULL),
  69.      &freeModule        (),
  70.      &freeResource      (PVOID resOffset);
  71.                         // frees resource (offset returned by ::getResource)
  72.    PFN
  73.      queryFn            (ULONG ordinal),  // query fn by ordinal **
  74.      queryFn            (PCSZ fnName);    // query fn by name **
  75.  
  76.    ULONG
  77.      queryFnType        (ULONG ordinal),  // query fn type (16 or 32) by ordinal **
  78.      queryFnType        (PCSZ fnName),    // query fn type (16 or 32) by name **
  79.      queryAppType       (),               // query application type **
  80.      queryResourceSize  (ULONG resType,   // query size of this resource object (RC-bound) **
  81.                          ULONG resID);
  82.  
  83.    PVOID getResource    (ULONG resType,   // get offset of a resource (RC-bound) **
  84.                          ULONG resID);
  85. };
  86.  
  87. // ** throws OVioException in case of any error
  88.  
  89.  
  90.  
  91. #endif // ODYNAMICLIB_INCLUDED
  92.  
  93. // end of source
  94.