Changeset 20397

Show
Ignore:
Timestamp:
06/30/07 07:09:06 (1 year ago)
Author:
patrick
Message:

When looking up the Gadgeteer DLL to get the icon for the window, factor in
that the DLL is versioned.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/gadgeteer/gadget/Devices/KeyboardMouseDevice/InputWindowWin32.cpp

    r20345 r20397  
    3636#include <gadget/Util/Debug.h> 
    3737#include <gadget/InputManager.h> 
     38#include <gadget/gadgetParam.h> 
    3839#include <gadget/Devices/KeyboardMouseDevice/InputWindowWin32.h> 
     40 
     41// The following is used below in InputWindowWin32::MenuInit(). The key parts 
     42// are GADGET_LIB_RT_OPT and GADGET_VERSION_STR. 
     43#  if defined(GADGET_DEBUG) 
     44#     if defined(_DEBUG) 
     45#        define GADGET_LIB_RT_OPT "_d" 
     46#     else 
     47#        define GADGET_LIB_RT_OPT "_g" 
     48#     endif 
     49#  else 
     50#     define GADGET_LIB_RT_OPT "" 
     51#  endif 
     52 
     53#  define GADGET_STRINGIZE(X) GADGET_DO_STRINGIZE(X) 
     54#  define GADGET_DO_STRINGIZE(X) #X 
     55#  define GADGET_VERSION_STR GADGET_STRINGIZE(__GADGET_MAJOR__) "_" \ 
     56                             GADGET_STRINGIZE(__GADGET_MINOR__) "_" \ 
     57                             GADGET_STRINGIZE(__GADGET_PATCH__) 
    3958 
    4059 
     
    283302   pWndClass->lpszClassName = ("Gadgeteer Event Window"); 
    284303 
    285 #if defined(GADGET_DEBUG) 
    286 #  if defined(_DEBUG) 
    287 #     define LIBNAME "gadget_d.dll" 
    288 #  else 
    289 #     define LIBNAME "gadget_g.dll" 
    290 #  endif 
    291 #else 
    292 #  define LIBNAME "gadget.dll" 
    293 #endif 
    294  
    295304   if (pWndClass->hIcon == NULL) 
    296305   { 
    297       HINSTANCE hDLLInstance = LoadLibrary( LIBNAME ); 
     306      HINSTANCE hDLLInstance = 
     307         LoadLibrary("gadget" GADGET_LIB_RT_OPT "-" GADGET_VERSION_STR ".dll"); 
    298308      if (hDLLInstance != NULL) 
    299309      {