From: Alessandro Antonangeli on
Hi all.
How can a different declaration give a 5333 error?

I did changed a little method, because i need more flexibility. So, instead
of creating an object with the init, I want to create it with
CreateInstance(SymClassName...), so that i can create a different subclass
of the object depending on the application which is using the library this
class belong to.

In the init method I pass a Symbol of the class i want to create, and assign
to a Protect variable

To make it more clear:
Before changing:

CLASS ConnessioneTCP
.....
METHOD IN_FD_ACCEPT(dwSock AS DWORD) CLASS ConnessioneTCP
LOCAL nSock AS DWORD
LOCAL oNewSocket AS MioSocket
....
nSock := accept(dwSock, NULL, NULL)
oNewSocket:=MioSocket{SOCK_STREAM,nSock,SSTAT_CONNECTED}
.....
RETURN oNewSockt


AFTER the changes

CLASS ConnessioneTCP
PROTECT symSubMioSocket AS SYMBOL

METHOD Init(...,symSMO) CLASS ConnessioneTCP
symSubMioSocket :=symSMO

METHOD IN_FD_ACCEPT(dwSock AS DWORD) CLASS ConnessioneTCP
LOCAL nSock AS DWORD
LOCAL oNewSocket AS OBJECT
....
nSock := accept(dwSock, NULL, NULL)
*verified it is symSubMioSocket==#MioSocket as in the original
oNewSocket:=CreateInstance(symSubMioSocket,SOCK_STREAM,nSock,SSTAT_CONNECTED)
....
RETURN oNewSockt

After this changes (and the others necessary to make it works), after a
while the application give an error 5333 in the dispatch method of the main
class and after that it close asking for sending information about the error
to MS

After some hour I tryed
INSTANCE symSubMioSocket AS SYMBOL
instead of
PROTECT symSubMioSocket AS SYMBOL

And no more problem
WHY?

--
Ciao
Alessandro


 | 
Pages: 1
Prev: News at Fabtoys
Next: No exported method in 2.8