when you add the xml file to exe, if you open the exe by winrar, you can see the xml file.
a new way is add xml file to a dll
OK, let see the xml file's content
<?xml version="1.0" encoding="UTF-8"?>
<Window size="340,280" caption="0,0,0,35">
<Font id="0" name="Courier New Bold" size="22" bold="false"/>
<VerticalLayout>
<HorizontalLayout bkcolor="#FFff1a1a"/>
<HorizontalLayout>
<Button name="btn_close" font="0" text="duilib use dll resource" bkcolor="#FF00b33c"/>
</HorizontalLayout>
<HorizontalLayout bkcolor="#FFffd633"/>
</VerticalLayout>
</Window>
and rename xml file: main_wnd.xml
make main_wnd.xml to theme.zip
1. create a new project ( dll project )
add theme.zip to the resource, type is ZIPRES
note: please copy theme.zip to :D:\duilib\project\resdll
build project. you will get dll:
1>Finished generating code
1>resdll.vcxproj -> D:\duilib\project\duilib_hello\Release\resdll.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
add code to app.cpp
HINSTANCE hRCDll = ::LoadLibrary(_T("resdll.dll"));
CPaintManagerUI::SetResourceDll(hRCDll);
run exe
you can download the dll project and duilib_hello project
resdll.zip
duilib_hello.zip