#include <oiltool.h>
Public Member Functions | |
OILTool (UINT32 ModuleID) | |
Create an OILTool object that can be linked to a Tool object (via a ToolListItem object). This object (the OILTool) knows the instance handle of the DLL that contains the tool. | |
HCURSOR | LoadCursor (UINT32 ID) |
Find a cursor resource, which may be in the kernel's resources, or it may be from the tool's own resources. | |
HBITMAP | LoadBitmap (UINT32 ID) |
Find a bitmap resource, which may be in the kernel's resources, or it may be from the tool's own resources. | |
HICON | LoadIcon (UINT32 ID) |
Find an icon resource, which may be in the kernel's resources, or it may be from the tool's own resources. | |
BOOL | LoadString (UINT32 ID, char *) |
Find a string resource, which may be in the kernel's resources, or it may be from the tool's own resources. | |
Public Attributes | |
HINSTANCE | hInstance |
Definition at line 108 of file oiltool.h.
|
Create an OILTool object that can be linked to a Tool object (via a ToolListItem object). This object (the OILTool) knows the instance handle of the DLL that contains the tool.
Definition at line 126 of file oiltool.cpp. 00127 { 00128 // Obtain and remember the Instance handle of the DLL that holds the resources 00129 // of the parent module of this tool (and hence holds the resources of the tool). 00130 hInstance = OILModule::GetInstance(ModuleID); 00131 }
|
|
Find a bitmap resource, which may be in the kernel's resources, or it may be from the tool's own resources.
Definition at line 183 of file oiltool.cpp. 00184 { 00185 HINSTANCE Inst; 00186 00187 if ((DLLs[0] == (HINSTANCE)HINSTANCE_ERROR || DLLs[0] == 0) || ((ID >= KID_FIRST) && (ID <= KID_LAST))) 00188 Inst = AfxGetResourceHandle(); // Kernel resource - get the HINSTANCE of our .EXE 00189 else 00190 Inst = hInstance; // otherwise use the HINSTANCE of the Tool's DLL 00191 00192 // If the HINSTANCE we have is valid, attempt to load the resource, otherwise 00193 // return a NULL value. 00194 00195 if (Inst > (HINSTANCE)HINSTANCE_ERROR) 00196 return ::LoadBitmap(Inst, MAKEINTRESOURCE(ID)); 00197 else 00198 return NULL; 00199 }
|
|
Find a cursor resource, which may be in the kernel's resources, or it may be from the tool's own resources.
Definition at line 149 of file oiltool.cpp. 00150 { 00151 HINSTANCE Inst; 00152 00153 if ((DLLs[0] == (HINSTANCE)HINSTANCE_ERROR || DLLs[0] == 0) || ((ID >= KID_FIRST) && (ID <= KID_LAST))) 00154 Inst = AfxGetResourceHandle(); // Kernel resource - get the HINSTANCE of our dll, or .EXE 00155 else 00156 Inst = hInstance; // otherwise use the HINSTANCE of the Tool's DLL 00157 00158 // If the HINSTANCE we have is valid, attempt to load the resource, otherwise 00159 // return a NULL value. 00160 00161 if (Inst > (HINSTANCE)HINSTANCE_ERROR) 00162 return ::LoadCursor(Inst, MAKEINTRESOURCE(ID)); 00163 else 00164 return NULL; 00165 }
|
|
Find an icon resource, which may be in the kernel's resources, or it may be from the tool's own resources.
Definition at line 217 of file oiltool.cpp. 00218 { 00219 HINSTANCE Inst; 00220 00221 if ((DLLs[0] == (HINSTANCE)HINSTANCE_ERROR || DLLs[0] == 0) || ((ID >= KID_FIRST) && (ID <= KID_LAST))) 00222 Inst = AfxGetResourceHandle(); // Kernel resource - get the HINSTANCE of our .EXE 00223 else 00224 Inst = hInstance; // otherwise use the HINSTANCE of the Tool's DLL 00225 00226 // If the HINSTANCE we have is valid, attempt to load the resource, otherwise 00227 // return a NULL value. 00228 00229 if (Inst > (HINSTANCE)HINSTANCE_ERROR) 00230 return ::LoadIcon(Inst, MAKEINTRESOURCE(ID)); 00231 else 00232 return NULL; 00233 }
|
|
Find a string resource, which may be in the kernel's resources, or it may be from the tool's own resources.
Definition at line 251 of file oiltool.cpp. 00252 { 00253 // Maximum allowable size of a windows string resource 00254 const INT32 MaxStringSize = 256; 00255 00256 HINSTANCE Inst; 00257 00258 if ((DLLs[0] == (HINSTANCE)HINSTANCE_ERROR || DLLs[0] == 0) || ((ID >= KID_FIRST) && (ID <= KID_LAST))) 00259 Inst = AfxGetResourceHandle(); // Kernel resource - get the HINSTANCE of our .EXE 00260 else 00261 Inst = hInstance; // otherwise use the HINSTANCE of the Tool's DLL 00262 00263 // If the HINSTANCE we have is valid, attempt to load the resource, otherwise 00264 // return FALSE. 00265 00266 if (Inst > (HINSTANCE)HINSTANCE_ERROR) 00267 return ::LoadString(Inst, ID, Description, MaxStringSize); 00268 else 00269 return FALSE; 00270 }
|
|
|