Here are some images of the results of the macro change:
Here are some images of the results of the macro change:
Thursday, April 24, 2008
Old errors coming back
Developing the testcase I came across an error like the one I had with the insert code for notebooks and tabs. Only this time I decided I wasn't going to give up. I went over the code many times to verify that this new error wasn't mine.
The call was MM_QUERYITEM, where you have to pass the ID of the item to be queried, whether or not you want to include the submenus on the search and a pointer to a MENUITEM structure.
I created a menuitem and gave it a 100d as it's ID value. I knew it worked because the call SETITEMTEXT, using that ID was working (I was seeing the text). Still the call to query the item would not return. Then I decided to debug the parameters on the C call. I just printed the values of the parameters. Everything looked fine, the first parameter was in fact a handle and the same one being created and used on the Java code. The message was the right one (0x182) and the third parameter looked just fine with the value of 640001 for MPFROM2SHORT(100, TRUE). Still the call didn't work.
After more debug messages I decided to make a parallel call this time using my own variables. At first I used only the MENUITEM parameter different from the rest. I passed a null pointer. Still no luck.
Finally I decided to ignore the third parameter and used MPFROM2SHORT(100, TRUE) directly on the call. Surprised,,, it worked. To find out why I then printed the result value of that macro and "bingo",, I got 10064!!! the right result only reversed from what I was getting from Java.
Scary to think that the macro being used extensively on the port is broken.
The good is that probably that is going to fix the problem I had with the insertion of tabs.
The bad is that probably I'm going to see some new stuff broken.
Tonight we will see
The call was MM_QUERYITEM, where you have to pass the ID of the item to be queried, whether or not you want to include the submenus on the search and a pointer to a MENUITEM structure.
I created a menuitem and gave it a 100d as it's ID value. I knew it worked because the call SETITEMTEXT, using that ID was working (I was seeing the text). Still the call to query the item would not return. Then I decided to debug the parameters on the C call. I just printed the values of the parameters. Everything looked fine, the first parameter was in fact a handle and the same one being created and used on the Java code. The message was the right one (0x182) and the third parameter looked just fine with the value of 640001 for MPFROM2SHORT(100, TRUE). Still the call didn't work.
After more debug messages I decided to make a parallel call this time using my own variables. At first I used only the MENUITEM parameter different from the rest. I passed a null pointer. Still no luck.
Finally I decided to ignore the third parameter and used MPFROM2SHORT(100, TRUE) directly on the call. Surprised,,, it worked. To find out why I then printed the result value of that macro and "bingo",, I got 10064!!! the right result only reversed from what I was getting from Java.
Scary to think that the macro being used extensively on the port is broken.
The good is that probably that is going to fix the problem I had with the insertion of tabs.
The bad is that probably I'm going to see some new stuff broken.
Tonight we will see
Thursday, April 10, 2008
Some success
Finally a break. After sitting in front of the code for a while and looking at some examples I found on the web, I found the problem with my menu code. I was using the desktop as the parent of the the menu instead of using the window frame (I'm talking about a menu bar). When I changed it I got my empty menu bar.
Now I'm working on the code to add menus to other menus. So far I'm working to understand the Windows code. I believe today I'm going to have a nice looking menu with text on it and if I do I'll post it tomorrow.
Now I'm working on the code to add menus to other menus. So far I'm working to understand the Windows code. I believe today I'm going to have a nice looking menu with text on it and if I do I'll post it tomorrow.
Wednesday, April 9, 2008
I'm back
I haven't posted here for a while and there are lots of reasons, but it can be summarized as life. Anyway, I kept on adding methods to the Menu and MenuItem classes and now I'm testing things against a testcase. The problem is that I see no menu so far. I'll keep on working until I see some result.
Subscribe to:
Posts (Atom)