someting wrong with luabind in DLL

kuku super <[email protected]> Tue, 21 Jun 2011 15:07:50 +0800
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
hello everybody:


My Game Export Functions to Lua use luabind. now the memory used by
"link.exe" when linked my game with vs2008 had exceed 1.5G, and then the
link.exe failed with error LNK1102


So, i move the codes binding C++ classes to Lua object to DLL. as follow:
all the member functions were called successed,but all the variables had no
effect.
//-------------------------------------------.lua------------
local data = pdlobj_VerifyVersionReq();    --successed
data.iVersion = 251; --data.iVersion is 251 in lua,but no effect in c++
data.strClientVersion = "";   --the function binded wasn't called
data:PDL_Send(PlayerContext:GetClient());  -- call PDL_Send fucntion with
the data.iVersion = 0xcdcdcdcd and data.strClientVersion = .........both
didn't initialized.


//--------------------------------------------------------------------------------.h--
#ifndef ___loginClient_pn_objbind_include__
#define ___loginClient_pn_objbind_include__

#include "FilterId.h"
#include "CommonDefine.h"

typedef struct DLLEXPORT pdlobj_VerifyVersionReq : public DOE::PdlObject {
static _U16 s_iStaticCommandId;
pdlobj_VerifyVersionReq();
_U32 iVersion;
char strClientVersion[(CLIENT_VERSION_MAX)+1];
virtual DOE::PDL_RESULT PDL_Send(DOE::PdlObjectSendParam* hpdl);
virtual void PDL_Print(_U8* strBuf, _U32 iLen);
}pdlobj_VerifyVersionReq;

DLLEXPORT pdlobj_VerifyVersionReq*
pdlobj_VerifyVersionReq_CastPointer(DOE::PdlObject* ptr);

DLLEXPORT void objbind_VerifyVersionReq(pdlobj_VerifyVersionReq &obj, _U32
iVersion, const char* strClientVersion);

#endif

//------------------------------------------------------------------------------------------------.inl--
#ifdef PDLLUABIND_DEF
static luabind::object
pdlobj_VerifyVersionReq_strClientVersion_geter(pdlobj_VerifyVersionReq
const& obj, lua_State* L) { return luabind::object(L, obj.strClientVersion);
}
static void
pdlobj_VerifyVersionReq_strClientVersion_seter(pdlobj_VerifyVersionReq& obj,
luabind::argument const& table){ strcpy_s(obj.strClientVersion,
(CLIENT_VERSION_MAX)+1, luabind::object_cast<const char*>(table)); }
#endif // PDLLUABIND_DEF
#ifdef PDLLUABIND_IMPL
#ifdef PDLLUABIND_IMPL_LoginClient

{
luabind::object g = luabind::globals(L);
g["VerifyVersionReq_CODE"] = pdlobj_VerifyVersionReq::s_iStaticCommandId;
luabind::module(L)
[
luabind::def("pdlobj_VerifyVersionReq_CastPointer",
&pdlobj_VerifyVersionReq_CastPointer),
luabind::class_<pdlobj_VerifyVersionReq>("pdlobj_VerifyVersionReq")
.def(luabind::constructor<>())
.def_readonly("m_iCommandId", &pdlobj_VerifyVersionReq::m_iCommandId)
.def_readwrite("iVersion", &pdlobj_VerifyVersionReq::iVersion)
.property("strClientVersion",
pdlobj_VerifyVersionReq_strClientVersion_geter,
pdlobj_VerifyVersionReq_strClientVersion_seter)
.def("PDL_Send", &pdlobj_VerifyVersionReq::PDL_Send)

];
}
#endif // PDLLUABIND_IMPL_LoginClient
#endif // PDLLUABIND_IMPL




could anybody help me. this problem is such a big headache to me..... why?
....

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user