Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Custom container widget crashing Windows hosted PhAB: (4 Items)
   
Custom container widget crashing Windows hosted PhAB  
Hi,

I am trying to create a custom container widget (subclassed from PtContainer) and find that it crashes PhAB when hosted 
under Windows. I'm using QNX 6.5.0 SDP on Windows 7 Pro x64. My target is x86 and for testing I have VirtualBox running 
with QNX installed from the SDP CD.

I have managed to create a custom widget subclassed from PtBasic in the past and have been able to add it, set resources
 and see the live widget display and am following pretty much the same procedure. I could only find cygwin 1.5.25 to 
install, which is different from the one supplied with QNX (1.5.24). It stops me being able to use cygwin's bash at the 
same time as PhAB but I don't know if there any other conflicts.

Now I am trying to create a custom widget subclassed from PtContainer and am going through the help as I do it, but in 
order to get some confidence I have done only the minimum (I think) I need to get a custom container going. I've 
attached the source here but there is basically only 1 new resource, I override the defaults function and no others. 
After I build, make the DLL available on my path and add the definition to PhAB I try to use it. I select "Add Widget 
Class..", which then prompts for the class. Enter that, PhAB finds it as it says it is going to add a widget of class <
name> to my base window and when I click on continue it crashes.

Are there any hints on how to track down what is causing this crash? The output on PhAB's console window doesn't say 
anything. Are there any functions I must provide for a custom container widget?

I know this has no bearing on the correctness of my code but I am able to built the custom widget for my target, add it 
to the self hosted PhAB and use it without crashes. Whether there is some stray error in my widget code that causes 
Windows PhAB to crash but not QNX PhAB I don't know.

Thanks.
Attachment: Compressed file IwcTabGroup.zip 1.55 KB
Re: Custom container widget crashing Windows hosted PhAB  
I have the exact same problem. I am currently working with QNX support but I don't know if it will be resolved since 
PhAB is basically going away. But they should still supported it up to 6.5.0 I think. Were you able to even compile with
 your cygwin 1.5.25? I tried this and I get bunch of compile errors.  I know I had to update two .h file (type.h and 
compiler_gnu.h) supplied by QNX originally to compile under windows XP but this same approach does not work under 
windows 7 and I think it has to do with cygwin1.dll compatability. I would be curious to know how you compiled in XP and
 how you are doing it on Win7?
Re: Custom container widget crashing Windows hosted PhAB  
okay I got it working yesterday, basically you need to update your cygwin to the latest version so that it actually 
works in win7 64bit properly.  
Here is the basic steps:

1) I upgraded my cygwin from 1.5.5 to 1.7.18 (latest version as of today) there is no way to go back to older version 
after you upgrade so I would make necessary backup just in case you need to go back.
2) update your compiler_gnu.h and types.h in your c:\QNX650\host\win32\x86\usr\include\libqnx\sys with the attached file

3) replace the cygwin1.dll in your c:\QNX650\host\win32\x86\usr\photon\bin 
4) replace the string.h file in your c:\cygwin\usr\include\ (this is kind of cheating but I had no time to troubleshoot 
and update all QNX .h file to match the new cygwin gcc version.  I know I don't use string.h in my dll so just took the 
string.h from the old cygwin 1.5.5 version.
5) now you can compile and link your custome widget code with following commands
(compile)
gcc -c -nostdinc -I /lib/gcc/i686-pc-cygwin/3.4.4/include -I/cygdrive/c/QNX632/host/win32/x86/usr/include -I/usr/include
 -I/cygdrive/c/qnx650/target/qnx6/usr/include custom.c
(link)
gcc -shared -o custom.dll custom.o -L/cygdrive/c/qnx650/host/win32/x86/usr/lib/ -lph -lcygwin -lkernel32
Attachment: Compressed file custom.zip 973.44 KB
Re: Custom container widget crashing Windows hosted PhAB  
> okay I got it working yesterday, basically you need to update your cygwin to 
> the latest version so that it actually works in win7 64bit properly.  

Glad to hear you got it working and thanks for solving it, I'll try this out and see if it works for me too. I can't 
remember now why I stuck with the cygwin 1.5 series (maybe trying to be as compatible as possible?).

I ended up going a different route rather than persisting with PhAB under Windows, which was to map a shared drive under
 the VirtualBox QNX and use ab on it, with the IDE running under Windows. Im sure there are potential pitfalls doing it 
that way but it works for my needs.