On Friday 12 December 2008 02:25:26 Jose Luis Capel wrote: > Hi all, > > Sorry for the off-topic and sorry for my low C level...
Hello Jose, I think that this is fully on-topic :) > > I saw that __GETMESSAGE in classes.c is defined as: > > HB_FUNC( __GETMESSAGE ) > { > hb_retc( > hb_stackItem(hb_stackBaseItem()->item.asSymbol.stackstate->lBaseItem > )->item.asSymbol.value->szName ); } > > Then, in my proyect I want to integrate that piece of code. I do this: > > #pragma BEGINDUMP Somehow this is the reason (I don't know yet exactly the details, but the problem is in the includes ("#include 'hbvmpub.h'") on the final C code obtained from the prg). So, for the moment, please use a separate C file to contain the HB_FUNC(): /---------------- start C code --------------------/ #include "hbvmopt.h" #include "hbstack.h" HB_FUNC( __GETMESSAGE2 ) { hb_retc(hb_stackItem(hb_stackBaseItem()->item.asSymbol.stackstate->lBaseItem )->item.asSymbol.value->szName); } /---------------- end C code --------------------/ this will compile fine . > > #include "hbapi.h" > #include "hbstack.h" > > HB_FUNC ( __MYFUNCTION ) > { > char * cMessage = (hb_stackItem( > hb_stackBaseItem()->item.asSymbol.stackstate->lBaseItem > )->item.asSymbol.value->szName) ; > > /* My code will go below */ > > } > > #pragma ENDDUMP > > > > But when compiling this little example I have these messages error: > > tdatabase.c > tdatabase.prg(220) : error C2223: left of '->item' must point to > struct/union tdatabase.prg(220) : error C2198: 'hb_stackItem' : too few > actual parameters tdatabase.prg(220) : error C2223: left of '->item' must > point to struct/union > > And this is my problem: I cannot understand these errors and also I cannot > understand why in classes.c compile OK whilst in my project throws these > errors. Check the C program obtained from the compiled prg code and check what does the include files in it to see the problem. best regards, Teo. _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour