I write a customized win32 control which need serval icon resources. I want to reuse this control for some other projects.
The control have a header file which including the definition of the control's structure like this:
typedef struct __control_my_customized__ {
HIMAGELIST icon_list;
} RCustCtrl,*pCustCtrl;
Together there is a .c file which including the initialization of the control resource and the handle of win32 messages.
Also there would be a .rc file which including the icon files referred in the HIMAGELIST as before.
So the composition of the control's source code would be several parts like this:
1. custctrl.h: definition of the control's structure.
2. custctrl.c
3. custctrl.rc: definition of the resources referred in the control
4. icon files.
Now with MSVC, if I want to wrap the control , for example , a lib file or a dll file, there would be some complier commands like this:
1. rc custctrl.rc
generate the .res file
2. cl -c custctrl.c
generate the .obj file
3. lib custctrl.obj /link custctrl.res
generate the lib file
That's all OK. Right Now I need to use this control in some projects.
I think I only need custctrl.h/custctrl.lib, however, I need copy the resource files together and regenerate the .res file.
That's not what I want.
What I have tried:
I do not want to expose the resource (the icon files) to the users.
So how should I wrap the control ?