G
Guest
I'd like to be able to use this message (RBN_AUTOBREAK) with my rebar control in Windows XP, and I just can't seem to get there. The application I'm working on is a .dll that is loaded by another application.
To start with, the RBN_AUTOBREAK definition in commctrl.h is surrounded by an "#if (_WIN32_WINNT >= 0x0501)". Unfortunately, this is not defined for my application, which includes only windows.h, and commctrl.h! I can just define _WIN32_WINNT as 0x0501 myself, but I'm unsure what other consequences that will have -- there should be a better way. It's also defined in stdafx.h. Unfortunately, I can't use any of the MFC stuff in my DLL, because it requires OLE, and I can't initialise OLE in a DLL (see help for AfxOleInit function). There's also one (_WIN32_WINNT) in winresrc.h -- maybe I should use that. Whatever I need is certainly undocumented in the RBN_AUTOBREAK help, where IMHO, it should be.
Now, beyond that (and assuming I fake the definition of RBN_AUTOBREAK myself), I'm just not getting the RBN_AUTOBREAK notification. According to the MSDN help page on RBN_AUTOBREAK, you need to declare that you want to use common controls verson 6 in a manifest -- so this is probably the issue. I honestly have no idea what version I'm using now, nor do I know how to find out.
Trying to look into that, I look at the help on "Using Windows XP Visual Styles" (I don't actually want to use Win XP Visual Styles, just RBN_AUTOBREAK, but the RBN_AUTOBREAK help points here!), which very nicely has a section called "Using ComCtl32 Version 6 in an Application That Uses Extensions, Plug-ins, or a DLL That Is Brought into a Process". Whee! So far so good!
Only, I really am stumped by the last step (5), which says "Add the manifest to your application's resource file as follows: ". Which windows resource file am I supposed to add this to? My .rc file? I should just go in and manually edit that? Or my resource.h file? Tried that -- it wouldn't compile, unsurprisingly. The line they are asking me to add is "MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.manifest"
", which parses out to: "2 MAKEINTRESOURCE(24) "YourApp.manifest", which is certainly not valid C/C++ in any form I know.
Maybe the documentation is wrong? Maybe I'm going crazy? Help! I just want to get the RBN_AUTOBREAK message from my rebar control!
To start with, the RBN_AUTOBREAK definition in commctrl.h is surrounded by an "#if (_WIN32_WINNT >= 0x0501)". Unfortunately, this is not defined for my application, which includes only windows.h, and commctrl.h! I can just define _WIN32_WINNT as 0x0501 myself, but I'm unsure what other consequences that will have -- there should be a better way. It's also defined in stdafx.h. Unfortunately, I can't use any of the MFC stuff in my DLL, because it requires OLE, and I can't initialise OLE in a DLL (see help for AfxOleInit function). There's also one (_WIN32_WINNT) in winresrc.h -- maybe I should use that. Whatever I need is certainly undocumented in the RBN_AUTOBREAK help, where IMHO, it should be.
Now, beyond that (and assuming I fake the definition of RBN_AUTOBREAK myself), I'm just not getting the RBN_AUTOBREAK notification. According to the MSDN help page on RBN_AUTOBREAK, you need to declare that you want to use common controls verson 6 in a manifest -- so this is probably the issue. I honestly have no idea what version I'm using now, nor do I know how to find out.
Trying to look into that, I look at the help on "Using Windows XP Visual Styles" (I don't actually want to use Win XP Visual Styles, just RBN_AUTOBREAK, but the RBN_AUTOBREAK help points here!), which very nicely has a section called "Using ComCtl32 Version 6 in an Application That Uses Extensions, Plug-ins, or a DLL That Is Brought into a Process". Whee! So far so good!
Only, I really am stumped by the last step (5), which says "Add the manifest to your application's resource file as follows: ". Which windows resource file am I supposed to add this to? My .rc file? I should just go in and manually edit that? Or my resource.h file? Tried that -- it wouldn't compile, unsurprisingly. The line they are asking me to add is "MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.manifest"
", which parses out to: "2 MAKEINTRESOURCE(24) "YourApp.manifest", which is certainly not valid C/C++ in any form I know.
Maybe the documentation is wrong? Maybe I'm going crazy? Help! I just want to get the RBN_AUTOBREAK message from my rebar control!