Label: ♦english ♦bug report

[261] returning a string from function to c++ code!

Comment
Hi,
I run in some trouble while calling a dao function from the c++ code. The dao function should return a string, but the returned code contains an invalid pointer (garbage). However, the type indicates a string. The following code does demonstrate the problem: The dao script looks like this:
function  getSomeString(){
    return'StringFromDao'
}
The C++ code it looks like this:
DValue  value  =  DaoNameSpace_FindData(m_nameSpace,  "getSomeString"  );
if(  value.t  ==  DAO_ROUTINE  ){
      DaoVmProcess_Call(  m_vmProcess,  value.v.routine,  NULL,  NULL,  0  );
}
value  =  DaoVmProcess_GetReturned(  m_vmProcess  );
where by the value is:
value.t = 5
value.v.s.mbs = Bad Ptr
If I call the function in the dao script I get the string returned.
like
str  =  getSomeString();
str  contains  StringFromDao.

Hope you can help out. Thanks
Comments
There was a minor bug in storing returned value in the DaoVmProcess structure. Now it is fixed and updated to the google code repository. Thank you for reporting this bug.

Change picture:

Choose file:

123 4
56 78910 11
121314151617 18
192021222324 25
26272829

fu: ... I forgot to say something about the plan for the whole new year in my previous reply. Well, besides w ... (Jan.19,01:40)

fu: ... Happy new dragon year (which will start from this sunday)! Actually, it was a busy month (I wish th ... (Jan.18,22:46)

ybabel: What's the plan for the new year ? Hello 'vry budy :- ) happy new year (when is the new year for you Fu ?) I saw you come back and comm ... (Jan.18,18:59)

This site is powered by Dao
Copyright (C) 2009,2010, daovm.net.
Webmaster: admin@daovm.net