PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

SQLite Database Manager Attempt

Hi all,

Here is my first attempt to create a small but usable database manager for the pocket pc using PPL.

The application still crash a lot on my device but i can't be sure it related to my code only, i tested various way.

There is also plenty of things to changes, to add, it's a first attempt only :-)

Test only with the packed database or database you can destroy, this is a real sql query tool so you can drop all you data by mistake from you db !!!

Do not hesitate to give me any suggestions about the code or the app. (i haven't yet found how to deal with the combobox change value since it only give the old one value ?!?) :-|

But again, i'm a newbee in visual programming so i'm probably going the wrong way...

PS: Kornalius, thanks for the functions list feature !
Attachments:
MyDBTool.zip (67 KB)
Your program doesn't do much. I don't see any code in here that relates to db functions. All I see is a program that returns the list of functions available in PPL.

Regards,
Kornalius
Are you serious ?

Here is a screen shot of the program in the visual dev.

http://etxredshift.cjb.net/testing/PPLF ... anager.jpg

I have downloaded te linked file, it's the correct one, are you sure you have tested my application ? :wink:
PointOfLight · 07 Jul 2004, 19:20 UTC
I believe there is something amiss. What I saw in the download was nothing like that screenshot. I was going to say something yesterday after I tried it, but I didn't get a chance. All I see on the form is and Edit box and a button with the text "Start".

Here's a link to a screen shot (note: I just redownloaded this file from the link earlier in the thread): http://www.csdatasol.net/MyDBTool.png
Okay, i repost it since it seems you also have the problem... i can't understand what's wrong ?!?

I have tested this one too with 0.6c
The code is in the main form.
Attachments:
MyDBTool3.zip (67 KB)
PointOfLight · 07 Jul 2004, 22:18 UTC
Still the same project that I downloaded before. Maybe you can try emailing the project to registerstuff @ csdatasol.net.
You can also download evrything here ;-)

http://etxredshift.cjb.net/testing/PPLForDummies/Progs

Help Kornalius !, Is there a problem with the forum file attach tool ?

Try downloading my other files (control libs and functions menu) to see if you also have the problem with theses ones.
PointOfLight · 08 Jul 2004, 01:59 UTC
I'm not sure what was going on, but I downloaded the MyDBTool.zip from the link in your last post, and it was not the same file as the one that was attached to your first post. The one that I downloaded just now had all of the SQL stuff in it.
I got the same problem when i tried to get the file from my workplace... i don't know to whats it's related but when i downloaded again the MyDBTool.zip it's now the correct one.
Really strange... 8O
I continued to investigate on this tool and i isolate one problem at least.

When i try to use the combo box notification message code CBN_SELCHANGE, it works fine, it give me the value just before the change.
But i can't get any other notification code working !

So actually i can't refresh on change selection of the combobox... since it's the old value i get.

I tried the following codes: CBN_SELENDOK, CBN_CLOSEUP, CBN_KILLFOCUS and probably others.

Regards,
mervjoyce · 12 Jul 2004, 12:07 UTC — Combobox Notification Events
My experience here may assist (or may not)

I have used the code fragment below to log events

Code:

case (Msg$)
WM_COMMAND:
wmId$ = LOWORD(wParam$);
wmEvent$ = HIWORD(wParam$);
case (wmId$)
1002:
Case (wmEvent$)
CBN_SETFOCUS:
memo_addline(memo1$,"CBN_SETFOCUS"+
" Index="+combobox_GetItemIndex(combobox1$)+
" Text="+combobox_GetText(combobox1$));
CBN_CLOSEUP:
memo_addline(memo1$,"CBN_CLOSEUP"+
" Index="+combobox_GetItemIndex(combobox1$)+
" Text="+combobox_GetText(combobox1$));
CBN_SELENDOK:
memo_addline(memo1$,"CBN_SELENDOK"+
" Index="+combobox_GetItemIndex(combobox1$)+
" Text="+combobox_GetText(combobox1$));
CBN_DROPDOWN:
memo_addline(memo1$,"CBN_DROPDOWN"+
" Index="+combobox_GetItemIndex(combobox1$)+
" Text="+combobox_GetText(combobox1$));
CBN_SELCHANGE:
memo_addline(memo1$,"CBN_SELCHANGE"+
" Index="+combobox_GetItemIndex(combobox1$)+
" Text="+combobox_GetText(combobox1$));
DEFAULT:
memo_addline(memo1$,"EventId="+wmEvent$+
" Index="+combobox_GetItemIndex(combobox1$)+
" Text="+combobox_GetText(combobox1$));
end;



I set up the combobox with 8 entries "COM1:" through to "COM8". Initially none were selected (eg index = -1. I then selected "COM3:" and made it the selected index. The lines below show the notification messages and the "index" and "text" status

CBN_SETFOCUS Index=-1 Text=
CBN_DROPDOWN Index=-1 Text=
CBN_SELENDOK Index=2 Text=COM3:
CBN_CLOSEUP Index=2 Text=COM3:
CBN_SELCHANGE Index=2 Text=COM3:

Hope this helps toward solving your problem
Thanks a lot for you code, i tried it, and it cleary show to me that only the CBN_SELCHANGE is triggered !

I used the same data as the one you used (COM1 ->COM8)
Blank selected at startup, and i select COM3, it output:

CBN_SELCHANGE Index = 2 Text =
EventId = 0 Index = -1 Text =

I change again and select COM7:
It display now:

CBN_SELCHANGE Index = 6 Text = COM3
EventId = 0 Index = 2 Text = COM3
CBN_SELCHANGE Index = 2 Text =
EventId = 0 Index = -1 Text =

So CBN_SETFOCUS, CBN_CLOSEUP, CBN_SELENDOK, CBN_DROPDOWN and CBN_SELCHANGE are not working on my ppc... sniff

Regards,
PointOfLight · 12 Jul 2004, 18:51 UTC
Are you putting this code in the form's function or the combo's function? If it's in the combo's, try moving it to the form's and see what happens.
For sure when i check your code i see that it could be set in th main form code instead of the combobox code.
I tried the 2, but it only work when i set it in the combobox code and partially like explained before, only CBN_SELCHANGE.

I included my test app for comboboxes.
Attachments:
ComboBox.zip (3 KB)
PointOfLight · 12 Jul 2004, 21:56 UTC
In the event procedure for your form, right before the case statement with the CBN_ events, put a 101: The problem is that it is trying to process all those events for the control with ID 110, not for the combo (which is ID 101). If this doesn't make sense let me know and I'll send you the code (I know I don't always explain things well).
mervjoyce · 12 Jul 2004, 23:11 UTC — Combobox Notification Events
My test code was in the "Form" procedure. I think the "notification" events are only sent to the "form" proc. In fact I have no "ComboBox" proc (its set to null at create time).

As Eric explained you need to trap signals only for the combobox before applying the case tests as per my example - if you don't it is easy to get a "race"/"lockup" condition caused by signal events for other components also being processed as a result of this code - in my case the edit/memo control.

Its interesting that not only are you not seeing all the events, but at the time of the notification "index" and "text" are the "before-change" values where as what I see is the "new" data - strange!

regards
Thanks a lot for again for your great expertize !

I can now get the CNB_SELCHANGE, CBN_CLOSEUP, CBN_SELENDOK working, and i can see that i can get the current selected value using a GetText jsut after the SELCHANGE.

Thanks a lot Eric !
mervjoyce · 12 Jul 2004, 23:22 UTC — Combobox Notification Events
Its always good to have a "happy ending"!

cheers
Thanks guys for helping me out with the support a bit. I am very busy trying to figure out a bug with the machine code compiler. It is sucking all my time.

Regards,
Kornalius
PointOfLight · 13 Jul 2004, 03:28 UTC
Hey, glad I could help. I just wish I had more time to work with PPL so I could answer more people's questions.
And another good news, i managed to get a .Net visual studio working :-)
So now i'm learning PPL and visual Basic.Net in // and asp.Net if I have time after.

Thanks again for you great help !