Forums › Forums › SIMPOL Programming › Error 17
- This topic has 4 replies, 2 voices, and was last updated 15 years, 5 months ago by
Jim Locker.
- AuthorPosts
- December 2, 2009 at 7:50 am #100
Jim Locker
MemberI have an error 17 (wrong type) coming out of wxprocess. This error message has no explanation in the docs, and is only happening on one form. All of my forms are straight translations of superbase .sbv files, accomplished with the provided tools. All forms go through the same startup procedure (using the same routines and a function reference to get the proper form), and all startup ends with the same wxprocess line. All forms work, save this one which bombs the whole program whenever any control other than a formedittext is clicked on. Compiler reports no errors or warnings. What is causing this?
December 3, 2009 at 10:53 am #1615Michael
KeymasterJim wrote:
> I have an error 17 (wrong type) coming out of wxprocess. This error
> message has no explanation in the docs, and is only happening on one
> form.
>
> All of my forms are straight translations of superbase .sbv files,
> accomplished with the provided tools.
>
> All forms go through the same startup procedure (using the same
> routines and a function reference to get the proper form), and all
> startup ends with the same wxprocess line.
>
> All forms work, save this one which bombs the whole program whenever
> any control other than a formedittext is clicked on.
>
> Compiler reports no errors or warnings.
>
> What is causing this?Wrong type is usually a bit miserable to track down. If it is being
missed by the IDE and compiler, then chances are that the error is
occurring when calling a function and in the process, passing the wrong
type. It is sometimes hard to see it. I know, I have done it often
enough myself. If you debug it, you should at least track down where it
is failing. Once there, check the parameters being passed. Then check
them again. One thing I have done more than once was to pass a sysrgb
object on a parameter list, rather than the sysrgb.value. The other side
was expecting an integer, but instead it got an object of type sysrgb.Hope this helps.
Ciao, Neil
December 4, 2009 at 12:09 am #1810Jim Locker
MemberNeil Robinson wrote:
> Wrong type is usually a bit miserable to track down. If it is being
> missed by the IDE and compiler, then chances are that the error is
> occurring when calling a function and in the process, passing the wrong
> type. It is sometimes hard to see it. I know, I have done it often
> enough myself. If you debug it, you should at least track down where it
> is failing. Once there, check the parameters being passed. Then check
> them again. One thing I have done more than once was to pass a sysrgb
> object on a parameter list, rather than the sysrgb.value. The other side
> was expecting an integer, but instead it got an object of type sysrgb.> Hope this helps.
> Ciao, Neil
I cannot figure out where it is failing because the program and IDE tell
me nothing. Form builds, looks OK. Doesn't die until I click on
something, then the error is reported back from wxprocess with the
enlightening statement that there is no source code available.December 4, 2009 at 12:35 am #1811Jim Locker
MemberNeil Robinson wrote:
> Wrong type is usually a bit miserable to track down. If it is being
> missed by the IDE and compiler, then chances are that the error is
> occurring when calling a function and in the process, passing the wrong
> type. It is sometimes hard to see it. I know, I have done it often
> enough myself. If you debug it, you should at least track down where it
> is failing. Once there, check the parameters being passed. Then check
> them again. One thing I have done more than once was to pass a sysrgb
> object on a parameter list, rather than the sysrgb.value. The other side
> was expecting an integer, but instead it got an object of type sysrgb.> Hope this helps.
> Ciao, Neil
That was it. I had created my stub event handlers by copying/pasting from
another section of my code and I copied/pasted menu event handlers, that
take an argument of type wxmenuitem rather than the wxformcontrol that I
needed.December 4, 2009 at 6:04 pm #1543Michael
KeymasterJim wrote:
> Neil Robinson wrote:
>
>> Wrong type is usually a bit miserable to track down. If it is being
>> missed by the IDE and compiler, then chances are that the error is
>> occurring when calling a function and in the process, passing the
>> wrong type. It is sometimes hard to see it. I know, I have done it
>> often enough myself. If you debug it, you should at least track
>> down where it is failing. Once there, check the parameters being
>> passed. Then check them again. One thing I have done more than once
>> was to pass a sysrgb object on a parameter list, rather than the
>> sysrgb.value. The other side was expecting an integer, but instead
>> it got an object of type sysrgb.
>
>> Hope this helps.
>
>> Ciao, Neil
>
> That was it. I had created my stub event handlers by copying/pasting
> from another section of my code and I copied/pasted menu event
> handlers, that take an argument of type wxmenuitem rather than the
> wxformcontrol that I needed.That will do it. Sometimes I use the same functions to do dual duty for
menus and toolbar icons, so then I declare the incoming parameter as:type(*) item
As long as I don't rely on that specific item for driving other code, it
doesn't matter, it is ignored anyway.Ciao, Neil
- AuthorPosts
- You must be logged in to reply to this topic.