Skip to content

Error 17

Forums Forums SIMPOL Programming Error 17

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #100
    Jim Locker
    Member

    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?

    #1615
    Michael
    Keymaster

    Jim 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

    #1810
    Jim Locker
    Member

    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

    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.

    #1811
    Jim Locker
    Member

    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.

    #1543
    Michael
    Keymaster

    Jim 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.