At first adding syslink to my dialog box, prevented it from opening. I was asked to add the following line in my code to display a dialog box with "Syslink" control.
#pragma comment(linker,"\"/manifestdependency:type='win32'\name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
It worked fine when I added this line to my VS project. What does this line of code imply ?
Secondly, when i added the same code for the dialog box and syslink control in another project's .rc file and resource.h file and when I compiled it using make file, I encountered the same problem. However this time I have added the #pragma comment line. ( FYI - If I remove the syslink control from the rc file, the dialog box works fine ). What could be the problem ?
@ScottMcP-MVP Thanks for your response.
Actually I solved the second problem. "/ALLOWISOLATION:NO" was set as a linker option in my makefile, which built the object file and binaries as if there was no manifest file. So the "# pragma comment" directive which modified the manifest had no effect when compiled from makefile. When I removed that linker option everything worked fine even without calling "InitCommonControls"
According to my understanding, the specified "# pragma directive" adds a comment in the object file to link the common controls library and it also adds an entry in the manifest file to link the common controls library only if it's version is 6 or above. ( Since syslink is defined only from version 6 )
Please correct me if I'm wrong.