Changeset 119


Ignore:
Timestamp:
Oct 7, 2023, 10:41:00 PM (22 months ago)
Author:
erdmann
Message:

rework the way the MMCDTrack class object is loaded: we cannot load it via dynamic linking because CWMM.DLL is not on libpath. Therefore, on class construction of CWMediaFolder, we query the location of class library for class MMCDTrack dynamically (find CWMM.DLL) and then have the class object for MMCDTrack constructed and saved in a member variable of CWMediaFolder

Location:
branches/v2.9_Lars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/v2.9_Lars/classes/makefile

    r115 r119  
    179179#
    180180#######################################
    181 all: cwmm.dll $(LIBDIR)/cwmm.lib $(HLP_FILES) nlv
     181all: cwmm.dll $(HLP_FILES) nlv
    182182        cd ./mm-progs && make
    183183
     
    193193        rc ./res/common_res/cwaudio.res cwmm.dll
    194194        MAPSYM cwmm.map
    195 
    196 $(LIBDIR)/cwmm.lib: $(OBJDIR)/cwmm.def
    197         implib /NOLOGO $@ $(OBJDIR)/cwmm.def
    198195
    199196###################################
  • branches/v2.9_Lars/mediafolder/c/helper/launchpad.cpp

    r117 r119  
    269269  if (DrgAccessDraginfo(pDragInfo)) {
    270270      PDRAGITEM pDragItem = NULL;
     271      M_CWMediaFolder *mediaFolderClass = NULL;
    271272
    272273        /* Get number of items */
     
    292293      */
    293294      wpObject = (WPObject *)OBJECT_FROM_PREC(pDragItem->ulItemID);
    294       if (!somIsObj(wpObject) || wpObject->somIsA(MMCDTrack::__ClassObject)) {
     295      mediaFolderClass = (M_CWMediaFolder *)CWMediaFolder::__ClassObject;
     296      if (!somIsObj(wpObject) || wpObject->somIsA(mediaFolderClass->MMCDTrackClass)) {
    295297         usIndicator = DOR_NEVERDROP;
    296298         usOp = 0;
  • branches/v2.9_Lars/mediafolder/c/mediafldr/mediafolderoverridenwpclsmethods.cpp

    r47 r119  
    11/*
    22 * This file is (C) Chris Wohlgemuth 1999-2003
    3  * 
     3 *
    44 * It's part of the Audio/Data-CD-Creator distribution
    55 */
     
    132132
    133133  hps=WinGetPS(HWND_DESKTOP);
    134  
     134
    135135  /* The main BMP */
    136136  allBMPs[MAIN_BMP_IDX].hbm=GpiLoadBitmap(hps, hResource, IDBMP_TOPMIDDLE, 0, 0);
     
    352352          if(DosQueryModuleHandle(pathname,&hmod)) {
    353353            pathname=((WPClassManager*)SOMClassMgrObject)  //Query Pathname of class file
    354               ->wpModuleForClass("CWAudioShadow");           
     354              ->wpModuleForClass("CWAudioShadow");
    355355            if(DosQueryModuleHandle(pathname,&hmod)) {
    356356              pathname=((WPClassManager*)SOMClassMgrObject)  //Query Pathname of class file
    357                 ->wpModuleForClass("M_CWCDFolder");           
     357                ->wpModuleForClass("M_CWCDFolder");
    358358              if(DosQueryModuleHandle(pathname,&hmod)) {
    359359                pathname=((WPClassManager*)SOMClassMgrObject)  //Query Pathname of class file
    360                   ->wpModuleForClass("CWCDFolder");           
     360                  ->wpModuleForClass("CWCDFolder");
    361361                if(DosQueryModuleHandle(pathname,&hmod)) {
    362362                  hmod=0;
     
    378378        if((found=strrchr(chrInstallDir,'\\'))!=NULLHANDLE)
    379379          *found=0;
    380        
     380
    381381        /* Save the dir for config files. */
    382382        //strcpy( chrConfigDir, chrInstallDir);
     
    393393
    394394  if(!hmod) {
    395     char path[CCHMAXPATH]; 
     395    char path[CCHMAXPATH];
    396396    char buf[CCHMAXPATH];
    397397    char* found;
    398398    APIRET rc;
    399    
    400     /* Get the language code of our system and load the 
     399
     400    /* Get the language code of our system and load the
    401401       resource DLL with the right language */
    402402    do {
     
    404404      PCSZ pszLang=chrLang;
    405405      char *chrPtr;
    406      
     406
    407407      /* Get Language var */
    408408      if(NO_ERROR!=DosScanEnv("LANG", &pszLang))
     
    419419      while(*chrPtr==' ')
    420420        chrPtr++;
    421      
     421
    422422      /* Check if value seems to be valid. The var must be something like xx_XX thus length is 5 */
    423423      if(strlen(chrPtr)<5)
    424424        break;
    425      
     425
    426426      if(DosQueryModuleName(queryModuleHandle("M_CWMediaFolder"),sizeof(path),path)!=NO_ERROR)
    427427        break;
    428      
     428
    429429      found=strrchr(path,'\\');
    430430      if(!found)
    431431        break;
    432432      *found=0;
    433      
    434       /* Extract the first two chars */               
     433
     434      /* Extract the first two chars */
    435435      sprintf(buf, RESDLLNAME, chrPtr[0], chrPtr[1]);
    436436      strcat(path,buf);
     
    438438      if(DosLoadModule(buf,sizeof(buf),path, &hmod)==NO_ERROR)
    439439        break;
    440      
     440
    441441      /* NLS DLL not found. Try to load default */
    442442      found=strrchr(path,'\\');
    443443      if(!found)
    444444        break;
    445      
     445
    446446      *found=0;
    447447      sprintf(buf, DEFRESDLLNAME);
     
    530530void M_CWMediaFolder::wpclsInitData()
    531531{
     532  static char *cls = "MMCDTrack";
     533  static somId classId = &cls;
     534
    532535  COUNTRYCODE country= {0};
    533536  COUNTRYINFO countryInfo= {0};
    534537  ULONG ulInfoLen=0;
    535538  APIRET rc;
    536   char path[CCHMAXPATH]; 
     539  char path[CCHMAXPATH];
    537540  char* found;
    538541  char buf[CCHMAXPATH];
     
    543546  /* Call parent */
    544547  M_CWProgFolder::wpclsInitData();
     548
     549  /* find out what module contains the MMCDTrackClass */
     550  /* and load MMCDTrackClass dynamically */
     551  /* need to do it this way because MMCDTrack class is */
     552  /* contained in CWMM.DLL which is not on LIBPATH */
     553  MMCDTrackClass = SOMClassMgrObject->somFindClass(classId,0,0);
    545554
    546555  /* Get slider cursor */
     
    574583  /* We don't want an automatic template because we create it during
    575584     installation because we need one with an ID so we can create a shadow
    576      without problems. So we return CLSSTYLE_DONTTEMPLATE. 
     585     without problems. So we return CLSSTYLE_DONTTEMPLATE.
    577586     Another way would be an override of wpclsCreateDefaultTemplate()
    578587     but this works, too, and we have to override this method anyway. We must
     
    591600  if(PrfQueryProfileInt(HINI_USERPROFILE, APPKEY_CWMM, MFLDR_NO_TEMPLATE_SHADOW, 0))
    592601    return;
    593  
     602
    594603  if(!WinQueryObject(ID_MEDIALDRTMPL_SHADOW))
    595604    {
     
    778787
    779788    return rc;
    780 #endif   
    781 
    782 }
    783 
    784 
    785 
    786 
    787 
    788 
    789 
    790 
    791 
    792 
     789#endif
     790
     791}
     792
     793
     794
     795
     796
     797
     798
     799
     800
     801
  • branches/v2.9_Lars/mediafolder/include/mediafolder.hh

    r4 r119  
    8484  USEITEM useItem;
    8585  VIEWITEM viewItem;
    86 }MYVIEWITEM; 
     86}MYVIEWITEM;
    8787
    8888typedef struct
     
    115115  WPObject* thisPtr;
    116116  char chrRexxScript[CCHMAXPATH];
    117 }INSERTTRACKPARMS; 
     117}INSERTTRACKPARMS;
    118118
    119119typedef  struct _MEDIAFLDRDATA
     
    129129  int iNumPlayed;     /* # of random played tracks */
    130130  int iNumToPlay;
    131   HWND hwndPlayObject;/* Object window which handles the play commands so the WPS is not blocked. */ 
     131  HWND hwndPlayObject;/* Object window which handles the play commands so the WPS is not blocked. */
    132132}MEDIAFLDRDATA;
    133133typedef   MEDIAFLDRDATA*   PMEDIAFLDRDATA;
     
    183183#pragma SOMCallstyle(oidl)
    184184public:
     185  SOMClass *MMCDTrackClass;
    185186  virtual PSZ  wpclsQueryTitle();
    186187  virtual void wpclsInitData();
     
    203204#pragma SOMCallstyle(oidl)
    204205private:
    205   /* 
     206  /*
    206207     Added with V0.2.8 (07.09.2003)
    207208
     
    209210
    210211     Tells the folder:
    211      MFLDR_CURACTION_ADDFOLDERVIEW3: currently processing the wpAddFolderView3Page() 
     212     MFLDR_CURACTION_ADDFOLDERVIEW3: currently processing the wpAddFolderView3Page()
    212213     MFLDR_VIEW_COMPACT:             folder is in compact view
    213214
     
    222223  WPObject* currentObject; /* Currently playing object */
    223224  PMINIRECORDCORE mrcPlaying;
    224   MYVIEWITEM myViewItem; 
     225  MYVIEWITEM myViewItem;
    225226
    226227  HWND hwndTopMiddle;/* */
     
    262263  virtual BOOL    wpSaveState();
    263264  virtual MRESULT wpDragOver(HWND hwndCnr,PDRAGINFO pDragInfo);
    264   virtual MRESULT wpDrop(HWND hwndCnr,PDRAGINFO pDragInfo,PDRAGITEM pDragItem); 
     265  virtual MRESULT wpDrop(HWND hwndCnr,PDRAGINFO pDragInfo,PDRAGITEM pDragItem);
    265266  virtual BOOL    wpAddSettingsPages(HWND hwndNotebook);
    266267  virtual ULONG   wpInsertSettingsPage(HWND hwndNotebook, PPAGEINFO ppageinfo);
  • branches/v2.9_Lars/mediafolder/makefile

    r116 r119  
    127127                @create_mfldr_def.CMD mediafolder.DEF
    128128                implib /NOLOGO lib\progfldr.lib progfolder\progfolder.def
    129                 icc -Ge- /Q+ /D$(ECS) /Fe$@ /Fm$*.map $(OBJECTS) ../classes/lib/cwmm.lib lib/progfldr.lib $(LIBS) mediafolder.def
     129                icc -Ge- /Q+ /D$(ECS) /Fe$@ /Fm$*.map $(OBJECTS) lib/progfldr.lib $(LIBS) mediafolder.def
    130130                rc ./res/mediafolder.res $@
    131131                MAPSYM $*.map
Note: See TracChangeset for help on using the changeset viewer.