Error after compiling

J12345T

Member
Licensed User
Hi,

I have compiled a project which runs perfectly well under B4PPC and compiles without error. When trying to execute the file however, I get the following error:-

Unable to cast object of type 'del1' to type 'del0'.

Any ideas?

Thanks.

JT
 

agraham

Expert
Licensed User
It's this line
B4X:
   AddEvent("Imagebuttonsearch",click,"search")
Event Subs cannot have parameters, that's the del0 bit. Your event Sub has one parameter, that's the del1 bit. You are trying to use a del1 type of Sub where a del0 type is expected.
 

Erel

Administrator
Staff member
Licensed User
Event Subs cannot have parameters
Just a small correction. The "added" event sub must have the same number of parameters as a similar event sub that was added by the designer.
For most events there are no parameters at all.
 

agraham

Expert
Licensed User
Just a small correction. The "added" event sub must have the same number of parameters as a similar event sub that was added by the designer.
:signOops: I forgot that some "built-in" events did have parameters. I'm too used to dealing with events, mainly from libraries, that don't have parameters and need a different data passing mechanism (properties).:sign0013:
 
Top