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
Longtime 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.
 

agraham

Expert
Licensed User
Longtime 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