鍏堟妸lua, luabind 緙栨垚闈?rùn)鎬佸簱錛岋紙涓嬪浘鍙槸debug,release綾諱技)錛?br>

鍋氬畬涔嬪悗鏁寸悊錛宭ua, luabind 浠dk 褰㈠紡緇勭粐濂斤紝鎴戞槸榪欐牱緇勭粐:
\luabind_build\sdk\luabind\include
\luabind_build\sdk\luabind\msvc-9.0-sp1\lib
\luabind_build\sdk\lua\include
\luabind_build\sdk\lua\msvc-9.0-sp1\lib
榪欐牱錛屾妸sdk涓殑涓滀笢淇濆瓨涓浠斤紝鏂逛究浠ュ悗浣跨敤銆傚啓涓涓狹FC灝忕▼搴忔祴璇?br>
1 //鍏抽敭浠g爜
2 //mfc class function
3 void CMFC_LuaDlg::SetEditText(const char* text)
4 {
5 Edit_1.SetWindowText(text);
6 UpdateData(FALSE);
7 }
8 //register
9 luabind::module(L)
10 [
11 luabind::class_<CMFC_LuaDlg>("mfc_dlg")
12 .def"set_text",&CMFC_LuaDlg::SetEditText)
13 ];
14 //load lua file
15 if (0==luaL_dofile(L,filepath))
16 {
17 ret=true;
18 }
19 //run lua function
20 luabind::call_function<void>(L,"update_text",dlg);
21
鑴氭湰鍐呭:
1 function update_text(dlg)
2 dlg:set_text("浣犲ソ錛屾榪庢潵鍒發(fā)ua 鑴氭湰涓栫晫")
3 end
榪愯緇撴灉錛?br>

]]>