Shop OBEX P1 Docs P2 Docs Learn Events
ShowEditPorts problem in Propellent Library — Parallax Forums

ShowEditPorts problem in Propellent Library

Keith LeinenbachKeith Leinenbach Posts: 25
edited 2012-01-24 16:26 in Propeller 1
Hi. I am using your DLL for the Propellent Library and most calls seem to work quite well. Unfortunately, when I call ShowEditPorts and I right click and try to choose a menu item (such as to ignore a port) the dialog "Invalid Pointer Operation" appears twice and the menu disappears. I am using version 1.3 R2 of your library on a Win 7 machine. Dragging the ports around works fine by the way.

Thanks,
Keith

Comments

  • tdlivingstdlivings Posts: 437
    edited 2012-01-22 07:26
    Keith
    Here is my test program written in Delphi 2007. The GetVersion button in the dialog is getting the propeller chip version so it expects something to be connected.
    It expects propellent.dll to be in the same folder as the app.
    Give it a try, mostly has been used with v1.2 of the dll. If you see the issue with my app
    I will try it on my lab pc which I can connect up some hardware.


    What language are you trying to use the dll with?

    I wrote a unit which is a wrapper on the dll functions, included in the zip.

    Tom
  • Keith LeinenbachKeith Leinenbach Posts: 25
    edited 2012-01-22 15:12
    Tom. Thanks for the post. I am using Delphi XE2. Our wrapper code and calls were identical so that didn't seem to be the problem. The fact that you used Delphi 2007 did give me an idea though. I compiled my code under Delphi 2010 and ran it and it worked. This creates a new headache of course. What is different? The crash happens only if the mouse hovers over the popup menu for the right click, not if you never hover over it or hover elsewhere. Strange. Even a plain dialog with just a button and the init, call, and finalize of the prop library will produce the same problem. I'll have to look into this more monday.


    Keith
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2012-01-22 16:14
    Just out of interest what are the parameters being passed in InitPropellent, are you using the default path or did you set a pointer to your own registry path.

    Jeff T.
  • tdlivingstdlivings Posts: 437
    edited 2012-01-22 20:14
    Keith
    Just a thought may not be what you are doing but Delphi XE2 creates 64bit exe's for Windows 64bit. Do you have the target for the
    compiler set to 32 or 64bit. The ports dialog imbeded in propellent.dll may not like 64 bit windows.
    I have XE2 also and will try rebuilding my Hellodll test tomorrow 32 bit version to see if it has issues.

    Tom
  • Keith LeinenbachKeith Leinenbach Posts: 25
    edited 2012-01-23 11:01
    Jeff - I don't use the preference storage option, so I don't pass a registry path either.

    InitPropellent(whandle,false,nil);

    Tom - I am compiling to a 32 bit program in XE2. I'm interested in the result of your XE2 compilation result ...

    Thanks again,
    Keith
  • tdlivingstdlivings Posts: 437
    edited 2012-01-23 20:03
    Keith
    I did a recompile of the code under XE2 with no changes and it has issues.
    First when I click on the getinfo button I get what looks like Chineese characters
    instead of a printable font. This looks like a Unicode issue. The default char type in
    XE2 is Unicode so I am thinking where I have PChar's defined in my D2007 version
    needs to become PAnsiChar which is what PChar was in D2007.
    That would also mess up the internal Dialog that pop's up when you ask to Show the
    com ports.
    I now also get the error you get if I right click on the context menu that pops up.

    D2010 which you have also does Unicode but I am not sure if it is the default string
    type in that version.

    Tom
  • tdlivingstdlivings Posts: 437
    edited 2012-01-24 09:45
    Keith
    Changing Char to AnsiChar and PChar to PAnsiChar get's rid of the Unicode issue and the info in the memo is now
    readable characters.
    I still get a stack overflow error when I right click on the com ports dialog. It shows fine and shows the context menu fine on
    a right click but as you said the moment you move the mouse over an entry you get stack overflow.

    Tom
  • Keith LeinenbachKeith Leinenbach Posts: 25
    edited 2012-01-24 16:26
    Well. At least I know it isn't just my setup... Why it does it is another matter. I guess I am stuck with Delphi 2010 for now.
Sign In or Register to comment.