DirectDance
03-14-2007, 11:33 AM
Hi,
this code sharing example should help to access the POOM library (Calendar, Contacts, etc.) wich is build in your PPC.
First of all, thanks to Kornalius who changed the COM accessing in PPL, version 1.22. Please note, that you will need at least V1.22 of PPL to get access to the POOM functionality.
I am using a PPC WM5.0 device. It seems, that the needed dll (pimstore) is installed and started on those devices on default.
If you are running a version less than WM5.0, it could be, that you will need the eVB runtime to get access to the POOM functionality.
To test, if your device is compatible on default, you could do this:
COMObjects(objects$, -1);
ShowMessage("\ActiveX Objects:\n\n" + ListToStr(objects$, #13#10, "", "")+"\n");
The result should include a line:
PocketOutlook.Application,pimstore.dll
or something sililar. If not, get the eVB runtime here: http://msdn.microsoft.com/mobility/windowsmobile/downloads/evb.aspx
This is a .cab file wich can be copied to your device and starting it. It installs plenty of dll´s. I hope, after installing the cab file, you should have a entry "PocketOutlook.Application" because, this is the main handle of POOM. As told before, I could not test it, because the pimstore is installed by default on my device. It would be very nice, if somebody using an older device could respond to this thread and tell us if it is correct.
Ok, now back to the POOM access. I will explain it mainly on using the Contacts folder. But it should work with Calendar, Tasks, etc., too. This is, because the POOM structure is equal in every folder structure. The folder structure is like this (simplified):
- Poom Main Entry
- Folder Contacts
- Contact Items
- Folder Calendar
- Calendar Items
- Folder Tasks
- Folder City
- Folder Infrared
1. Initialize POOM
poom$ = CreateCOMObject("PocketOutlook.Application");
You will get a main handle to the POOM object. This has to be done only once, e.g. after your program was started. At this point, the variable poom$ is containing the handle but no operations on POOM could be done before log into the POOM object.
2. Logon to the POOM Object
poomlogon$ = Invoke(poom$, "logon");
Now you are connected to POOM.
Please, before closing your application, do not forget to logoff from POOM.
Ok, here are a few examples to play with POOM:
3. Create a new Contact
folder$ = Invoke(poom$, "GetDefaultFolder", 10); //Enter the Contacts Folder (10 for contacts)
items$ = GetProperty(folder$, "items"); //Set a handle pointer to the Items object (contacts themselfes)
newContact$ = invoke(items$, "add"); //We would like to ADD a new contact
newContactProp$ = SetProperty(newContact$, "LastName", "Smith"); //Set the LastName variable of POOM to "Smith"
tasksave$ = invoke(newContact$, "save"); //Save the stuff. Without this command, the new contact wont be saved
Of course, you can assign every datafield of POOM using the SetProperty method (LastName, FirstName, etc.. A complete list of the contact properties can be found on the microsoft websites.
At this point I would like to do the same as in point -3-, but creating a new task
4. Create a new Task
folder$ = Invoke(poom$, "GetDefaultFolder", 13);
items$ = GetProperty(folder$, "items");
newTask$ = invoke(items$, "add");
newtasksubject$ = SetProperty(newTask$, "subject", "Go shopping");
tasksave$ = invoke(newTask$, "save");
Almost the same as in the contacts folder ;-)
5. Load / Search for a contact
folder$ = Invoke(poom$, "GetDefaultFolder", 10); //Explained above
items$ = GetProperty(folder$, "items"); //Explained above
SearchContact$ = invoke(items$, "find", "[LastName] >= \"A\""); //Search for Contacts where the Lastname is equal or greater than a letter "A"
ContactOID$ = getproperty(SearchContact$, "oid"); //Get the OID of the first contact found
loadmycontact$ = invoke(poom$, "GetItemFromOid", ContactOID$); //Load the Contact using the OID
name1$ = getproperty(loadmycontact$, "firstname"); //Get the First Name
name2$ = getproperty(loadmycontact$, "lastname"); //Get the Last Name
showmessage(name1$ % ", " % name2$); //Show the result
The "Find" command is very flexible. For more infos about that command, please have a look into the MS Docs.
Get the next data ("find" will only load the first data)
SearchContact$ = invoke(items$, "findnext");
ContactOID$ = getproperty(SearchContact$, "oid");
loadmycontact$ = invoke(poom$, "GetItemFromOid", votest$);
name1$ = getproperty(loadmycontact$, "firstname");
name2$ = getproperty(loadmycontact$, "lastname");
showmessage(name1$ % ", " % name2$);
Puh ..., now my fingers are aching.
I hope, the above listed examples will help you creating great apps using PPL.
There are many other possibilities I have not described here. Of course, you can delete, modify, etc. those items.
You will find tons of examples on the internet how to dodiffrent things using POOM. With the above listed examples it should be an easy one to rewrite any example wich was written for e.g. using eVB to PPL.
A last important sentence: PPL is best!
Cheers,
DirectDance
this code sharing example should help to access the POOM library (Calendar, Contacts, etc.) wich is build in your PPC.
First of all, thanks to Kornalius who changed the COM accessing in PPL, version 1.22. Please note, that you will need at least V1.22 of PPL to get access to the POOM functionality.
I am using a PPC WM5.0 device. It seems, that the needed dll (pimstore) is installed and started on those devices on default.
If you are running a version less than WM5.0, it could be, that you will need the eVB runtime to get access to the POOM functionality.
To test, if your device is compatible on default, you could do this:
COMObjects(objects$, -1);
ShowMessage("\ActiveX Objects:\n\n" + ListToStr(objects$, #13#10, "", "")+"\n");
The result should include a line:
PocketOutlook.Application,pimstore.dll
or something sililar. If not, get the eVB runtime here: http://msdn.microsoft.com/mobility/windowsmobile/downloads/evb.aspx
This is a .cab file wich can be copied to your device and starting it. It installs plenty of dll´s. I hope, after installing the cab file, you should have a entry "PocketOutlook.Application" because, this is the main handle of POOM. As told before, I could not test it, because the pimstore is installed by default on my device. It would be very nice, if somebody using an older device could respond to this thread and tell us if it is correct.
Ok, now back to the POOM access. I will explain it mainly on using the Contacts folder. But it should work with Calendar, Tasks, etc., too. This is, because the POOM structure is equal in every folder structure. The folder structure is like this (simplified):
- Poom Main Entry
- Folder Contacts
- Contact Items
- Folder Calendar
- Calendar Items
- Folder Tasks
- Folder City
- Folder Infrared
1. Initialize POOM
poom$ = CreateCOMObject("PocketOutlook.Application");
You will get a main handle to the POOM object. This has to be done only once, e.g. after your program was started. At this point, the variable poom$ is containing the handle but no operations on POOM could be done before log into the POOM object.
2. Logon to the POOM Object
poomlogon$ = Invoke(poom$, "logon");
Now you are connected to POOM.
Please, before closing your application, do not forget to logoff from POOM.
Ok, here are a few examples to play with POOM:
3. Create a new Contact
folder$ = Invoke(poom$, "GetDefaultFolder", 10); //Enter the Contacts Folder (10 for contacts)
items$ = GetProperty(folder$, "items"); //Set a handle pointer to the Items object (contacts themselfes)
newContact$ = invoke(items$, "add"); //We would like to ADD a new contact
newContactProp$ = SetProperty(newContact$, "LastName", "Smith"); //Set the LastName variable of POOM to "Smith"
tasksave$ = invoke(newContact$, "save"); //Save the stuff. Without this command, the new contact wont be saved
Of course, you can assign every datafield of POOM using the SetProperty method (LastName, FirstName, etc.. A complete list of the contact properties can be found on the microsoft websites.
At this point I would like to do the same as in point -3-, but creating a new task
4. Create a new Task
folder$ = Invoke(poom$, "GetDefaultFolder", 13);
items$ = GetProperty(folder$, "items");
newTask$ = invoke(items$, "add");
newtasksubject$ = SetProperty(newTask$, "subject", "Go shopping");
tasksave$ = invoke(newTask$, "save");
Almost the same as in the contacts folder ;-)
5. Load / Search for a contact
folder$ = Invoke(poom$, "GetDefaultFolder", 10); //Explained above
items$ = GetProperty(folder$, "items"); //Explained above
SearchContact$ = invoke(items$, "find", "[LastName] >= \"A\""); //Search for Contacts where the Lastname is equal or greater than a letter "A"
ContactOID$ = getproperty(SearchContact$, "oid"); //Get the OID of the first contact found
loadmycontact$ = invoke(poom$, "GetItemFromOid", ContactOID$); //Load the Contact using the OID
name1$ = getproperty(loadmycontact$, "firstname"); //Get the First Name
name2$ = getproperty(loadmycontact$, "lastname"); //Get the Last Name
showmessage(name1$ % ", " % name2$); //Show the result
The "Find" command is very flexible. For more infos about that command, please have a look into the MS Docs.
Get the next data ("find" will only load the first data)
SearchContact$ = invoke(items$, "findnext");
ContactOID$ = getproperty(SearchContact$, "oid");
loadmycontact$ = invoke(poom$, "GetItemFromOid", votest$);
name1$ = getproperty(loadmycontact$, "firstname");
name2$ = getproperty(loadmycontact$, "lastname");
showmessage(name1$ % ", " % name2$);
Puh ..., now my fingers are aching.
I hope, the above listed examples will help you creating great apps using PPL.
There are many other possibilities I have not described here. Of course, you can delete, modify, etc. those items.
You will find tons of examples on the internet how to dodiffrent things using POOM. With the above listed examples it should be an easy one to rewrite any example wich was written for e.g. using eVB to PPL.
A last important sentence: PPL is best!
Cheers,
DirectDance