Read contacts Pocket outlook wm5

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Sun Mar 15, 2009 9:24 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Sun Mar 15, 2009 9:29 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Sun Mar 15, 2009 9:40 pm

Bueno, parece que Microsoft proporciona un ejemplo completo, y usa estos ficheros:
http://msdn.microsoft.com/en-us/library/ms880668.aspx
c:/Archivos de programa/Windows Mobile 5.0 SDK R2/Samples/Smartphone/CPP/Win32/Poommaster/

Ahora necesitamos localizar esos ficheros. Buscando en google, puede ser que sean estos:

POOMContact.cpp: implementation of the POOMContact class
Code: Select all  Expand view

// POOMContact.cpp: implementation of the POOMContact class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "POOMContact.h"

#include "PimalDateHelper.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// extractViewData
// extracts only the ids from the datasets from the device and returns this:
// [ID on device]+DATASET_SEP
// ...
//////////////////////////////////////////////////////////////////////

CString POOMContact::extractViewData()
{
    CString retVal;
    // get the information needed out of the actual item and store it into temp variables
    long id;   
    contact->get_Oid(&id);

       
    // formatting the id as a CString
    CString strId;
    strId.Format(_T("%ld"), id);

    // attach a new line with the data accomplished to the return value
    retVal = strId + DATASET_SEP;

    return retVal;
}

//////////////////////////////////////////////////////////////////////
// extractAllData
// extracts all data from this contact puts it into a String formatted like this:
// [ID on device]+D1_SEP+[Title]+D1_SEP+[FirstName]+D1_SEP+[MiddleName]+D1_SEP+[LastName]+D1_SEP+[Suffix]+D1_SEP+[Job Title]+D1_SEP+[Department]+D1_SEP+[Company]+D1_SEP+[Work Tel]+D1_SEP+[Work2 Tel]+D1_SEP+[Home Tel]+D1_SEP+[Home2 Tel]+D1_SEP+[Mobile Tel]+D1_SEP+[Pager]+D1_SEP+[Car Tel]+D1_SEP+|Work fax]+D1_SEP+[Home fax]+D1_SEP+[Assistant tel]+D1_SEP+[Radio tel]+D1_SEP+[Email]+D1_SEP+[Email2]+D1_SEP+[Email3]+D1_SEP+[Web Page]+D1_SEP+[Work Street]+D1_SEP+[Work City]+D1_SEP+[Work State]+D1_SEP+[Work ZIP]+D1_SEP+[Work Country]+D1_SEP+[Office loc]+D1_SEP+[Home Street]+D1_SEP+[Home City]+D1_SEP+[Home State]+D1_SEP+[Home ZIP]+D1_SEP+[Home Country]+D1_SEP+[Other Street]+D1_SEP+[Other City]+D1_SEP+[Other State]+D1_SEP+[Other CIP]+D1_SEP+[Other Country]+D1_SEP+[Categories, separated by ?]+D1_SEP+[Assistant]+D1_SEP+[Birthday, format JJJJ-MM-DD]+D1_SEP+[Anniversary, format JJJJ-MM-DD]+D1_SEP+[Spouse]+D1_SEP+[Children]+D1_SEP+[Note]+DATASET_SEP
// [ID on device]+D1_SEP+[Title]+D1_SEP+[FirstName]+D1_SEP+[MiddleName]+D1_SEP+[LastName]+D1_SEP+[Suffix]+D1_SEP+[Job Title]+D1_SEP+[Department]+D1_SEP+[Company]+D1_SEP+[Work Tel]+D1_SEP+[Work2 Tel]+D1_SEP+[Home Tel]+D1_SEP+[Home2 Tel]+D1_SEP+[Mobile Tel]+D1_SEP+[Pager]+D1_SEP+[Car Tel]+D1_SEP+|Work fax]+D1_SEP+[Home fax]+D1_SEP+[Assistant tel]+D1_SEP+[Radio tel]+D1_SEP+[Email]+D1_SEP+[Email2]+D1_SEP+[Email3]+D1_SEP+[Web Page]+D1_SEP+[Work Street]+D1_SEP+[Work City]+D1_SEP+[Work State]+D1_SEP+[Work ZIP]+D1_SEP+[Work Country]+D1_SEP+[Office loc]+D1_SEP+[Home Street]+D1_SEP+[Home City]+D1_SEP+[Home State]+D1_SEP+[Home ZIP]+D1_SEP+[Home Country]+D1_SEP+[Other Street]+D1_SEP+[Other City]+D1_SEP+[Other State]+D1_SEP+[Other CIP]+D1_SEP+[Other Country]+D1_SEP+[Categories, separated by ?]+D1_SEP+[Assistant]+D1_SEP+[Birthday, format JJJJ-MM-DD]+D1_SEP+[Anniversary, format JJJJ-MM-DD]+D1_SEP+[Spouse]+D1_SEP+[Children]+D1_SEP+[Note]+DATASET_SEP
// ...
//////////////////////////////////////////////////////////////////////

CString POOMContact::extractAllData()
{
        CString retVal;
        // get the information needed out of the actual item and store it into temp variables
        LPTSTR title, firstName, middleName, lastName, suffix, jobTitle, department, company, workTel, workTel2, homeTel, homeTel2, mobileTel, pager, carTel, workFax, homeFax, assistantTel, radioTel, email, email2, email3, webPage, workStreet, workCity, workState, workZip, workCountry, officeLoc, homeStreet, homeCity, homeState, homeZip, homeCountry, otherStreet, otherCity, otherState, otherZip, otherCountry, categories, assistant, spouse, children, note;
        CString birthday, anniversary;
        DATE anniversaryAsDate, birthdayAsDate;
        long id;   
        contact->get_Oid(&id);
        contact->get_Title(&title);
        contact->get_FirstName(&firstName);
        contact->get_MiddleName(&middleName);
        contact->get_LastName(&lastName);
        contact->get_Suffix(&suffix);
        contact->get_JobTitle(&jobTitle);
        contact->get_Department(&department);
        contact->get_CompanyName(&company);
        contact->get_BusinessTelephoneNumber(&workTel);
        contact->get_Business2TelephoneNumber(&workTel2);
        contact->get_HomeTelephoneNumber(&homeTel);
        contact->get_Home2TelephoneNumber(&homeTel2);
        contact->get_MobileTelephoneNumber(&mobileTel);
        contact->get_PagerNumber(&pager);
        contact->get_CarTelephoneNumber(&carTel);
        contact->get_BusinessFaxNumber(&workFax);
        contact->get_HomeFaxNumber(&homeFax);
        contact->get_AssistantTelephoneNumber(&assistantTel);
        contact->get_RadioTelephoneNumber(&radioTel);
        contact->get_Email1Address(&email);
        contact->get_Email2Address(&email2);
        contact->get_Email3Address(&email3);
        contact->get_WebPage(&webPage);
        contact->get_BusinessAddressStreet(&workStreet);
        contact->get_BusinessAddressCity(&workCity);
        contact->get_BusinessAddressState(&workState);
        contact->get_BusinessAddressPostalCode(&workZip);
        contact->get_BusinessAddressCountry(&workCountry);
        contact->get_OfficeLocation(&officeLoc);
        contact->get_HomeAddressStreet(&homeStreet);
        contact->get_HomeAddressCity(&homeCity);
        contact->get_HomeAddressState(&homeState);
        contact->get_HomeAddressPostalCode(&homeZip);
        contact->get_HomeAddressCountry(&homeCountry);
        contact->get_OtherAddressStreet(&otherStreet);
        contact->get_HomeAddressCity(&otherCity);
        contact->get_HomeAddressState(&otherState);
        contact->get_HomeAddressPostalCode(&otherZip);
        contact->get_HomeAddressCountry(&otherCountry);
        contact->get_Categories(&categories);
        contact->get_AssistantName(&assistant);
        contact->get_Anniversary(&anniversaryAsDate);
        contact->get_Birthday(&birthdayAsDate);
        contact->get_Spouse(&spouse);
        contact->get_Children(&children);
        contact->get_Body(&note);
       
        // formatting anniversary and birthday as a String
        PimalDateHelper anniversaryAsPimalDateHelper(anniversaryAsDate);
        PimalDateHelper birthdayAsPimalDateHelper(birthdayAsDate);     

        // formatting the id as a CString
        CString strId;
        strId.Format(_T("%ld"), id);

        // storing the value in oid (attribute) as BSTR
        oid = strId.AllocSysString();

        // attach a new line with the data accomplished to the return value
        retVal = strId + D1_SEP + (CString)title + D1_SEP + (CString)firstName + D1_SEP + (CString)middleName + D1_SEP + (CString)lastName + D1_SEP + (CString)suffix + D1_SEP + (CString)jobTitle + D1_SEP + (CString)department + D1_SEP + (CString)company + D1_SEP + (CString)workTel + D1_SEP + (CString)workTel2 + D1_SEP + (CString)homeTel + D1_SEP + (CString)homeTel2 + D1_SEP + (CString)mobileTel + D1_SEP + (CString)pager + D1_SEP + (CString)carTel + D1_SEP + (CString)workFax + D1_SEP + (CString)homeFax + D1_SEP + (CString)assistantTel + D1_SEP + (CString)radioTel + D1_SEP + (CString)email + D1_SEP + (CString)email2 + D1_SEP + (CString)email3 + D1_SEP + (CString)webPage + D1_SEP + (CString)workStreet + D1_SEP + (CString)workCity + D1_SEP + (CString)workState + D1_SEP + (CString)workZip + D1_SEP + (CString)workCountry + D1_SEP + (CString)officeLoc + D1_SEP + (CString)homeStreet + D1_SEP + (CString)homeCity + D1_SEP + (CString)homeState + D1_SEP + (CString)homeZip + D1_SEP + (CString)homeCountry + D1_SEP + (CString)otherStreet + D1_SEP + (CString)otherCity + D1_SEP + (CString)otherState + D1_SEP + (CString)otherZip + D1_SEP + (CString)otherCountry + D1_SEP + (CString)categories + D1_SEP + (CString)assistant + D1_SEP + birthdayAsPimalDateHelper.getGenericDateString() + D1_SEP + anniversaryAsPimalDateHelper.getGenericDateString() + D1_SEP + (CString)spouse + D1_SEP + (CString)children + D1_SEP + (CString)note + DATASET_SEP;

        return retVal;
}


//////////////////////////////////////////////////////////////////////
// save() saves the stored IContact (all changes made are stored on the device
// and refreshes the oid
//////////////////////////////////////////////////////////////////////

BOOL POOMContact::save()
{
    HRESULT h = contact->Save();
    long id;
    CString strId;
    contact->get_Oid(&id);
    strId.Format(_T("%ld"), id);

    oid = strId.AllocSysString();
   return h == 0;
}

//////////////////////////////////////////////////////////////////////
// getOid() returns the Oid of the IContact as a BSTR
//////////////////////////////////////////////////////////////////////

BSTR POOMContact::getOid()
{
    return oid;
}

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

POOMContact::POOMContact(IContact* tmp)
{
    contact = tmp;
}

POOMContact::POOMContact(IContact* tmp, BSTR middleName)
{
    contact = tmp;
   contact->put_FirstName(middleName);
}

POOMContact::POOMContact(IContact* tmp, BSTR title, BSTR firstName, BSTR middleName, BSTR lastName, BSTR suffix, BSTR jobTitle, BSTR department, BSTR company, BSTR workTel, BSTR workTel2, BSTR homeTel, BSTR homeTel2, BSTR mobileTel, BSTR pager, BSTR carTel, BSTR workFax, BSTR homeFax, BSTR assistantTel, BSTR radioTel, BSTR email, BSTR email2, BSTR email3, BSTR webPage, BSTR workStreet, BSTR workCity, BSTR workState, BSTR workZip, BSTR workCountry, BSTR officeLoc, BSTR homeStreet, BSTR homeCity, BSTR homeState, BSTR homeZip, BSTR homeCountry, BSTR otherStreet, BSTR otherCity, BSTR otherState, BSTR otherZip, BSTR otherCountry, BSTR categories, BSTR assistant, BSTR birthdayAsPimalDateHelperGenericDateString, BSTR anniversaryAsPimalDateHelperGenericDateString, BSTR spouse, BSTR children, BSTR note)
{
    contact = tmp;

    if (title && title != UNCHANGED) contact->put_Title(title);
    if (firstName && firstName != UNCHANGED) contact->put_FirstName(firstName);
    if (middleName && middleName != UNCHANGED) contact->put_MiddleName(middleName);
    if (lastName && lastName != UNCHANGED) contact->put_LastName(lastName);
    if (suffix && suffix != UNCHANGED) contact->put_Suffix(suffix);
    if (jobTitle && jobTitle != UNCHANGED) contact->put_JobTitle(jobTitle);
    if (department && department != UNCHANGED) contact->put_Department(department);
    if (company && company != UNCHANGED) contact->put_CompanyName(company);
    if (workTel && workTel != UNCHANGED) contact->put_BusinessTelephoneNumber(workTel);
    if (workTel2 && workTel2 != UNCHANGED) contact->put_Business2TelephoneNumber(workTel2);
    if (homeTel && homeTel != UNCHANGED) contact->put_HomeTelephoneNumber(homeTel);
    if (homeTel2 && homeTel2 != UNCHANGED) contact->put_Home2TelephoneNumber(homeTel2);
    if (mobileTel && mobileTel != UNCHANGED) contact->put_MobileTelephoneNumber(mobileTel);
    if (pager && pager != UNCHANGED) contact->put_PagerNumber(pager);
    if (carTel && carTel != UNCHANGED) contact->put_CarTelephoneNumber(carTel);
    if (workFax && workFax != UNCHANGED) contact->put_BusinessFaxNumber(workFax);
    if (homeFax && homeFax != UNCHANGED) contact->put_HomeFaxNumber(homeFax);
    if (assistantTel && assistantTel != UNCHANGED) contact->put_AssistantTelephoneNumber(assistantTel);
    if (radioTel && radioTel != UNCHANGED) contact->put_RadioTelephoneNumber(radioTel);
    if (email && email != UNCHANGED) contact->put_Email1Address(email);
    if (email2 && email2 != UNCHANGED) contact->put_Email2Address(email2);
    if (email3 && email3 != UNCHANGED) contact->put_Email3Address(email3);
    if (webPage && webPage != UNCHANGED) contact->put_WebPage(webPage);
    if (workStreet && workStreet != UNCHANGED) contact->put_BusinessAddressStreet(workStreet);
    if (workCity && workCity != UNCHANGED) contact->put_BusinessAddressCity(workCity);
    if (workState && workState != UNCHANGED) contact->put_BusinessAddressState(workState);
    if (workZip && workZip != UNCHANGED) contact->put_BusinessAddressPostalCode(workZip);
    if (workCountry && workCountry != UNCHANGED) contact->put_BusinessAddressCountry(workCountry);
    if (officeLoc && officeLoc != UNCHANGED) contact->put_OfficeLocation(officeLoc);
    if (homeStreet && homeStreet != UNCHANGED) contact->put_HomeAddressStreet(homeStreet);
    if (homeCity && homeCity != UNCHANGED) contact->put_HomeAddressCity(homeCity);
    if (homeState && homeState != UNCHANGED) contact->put_HomeAddressState(homeState);
    if (homeZip && homeZip != UNCHANGED) contact->put_HomeAddressPostalCode(homeZip);
    if (homeCountry && homeCountry != UNCHANGED) contact->put_HomeAddressCountry(homeCountry);
    if (otherStreet && otherStreet != UNCHANGED) contact->put_OtherAddressStreet(otherStreet);
    if (otherCity && otherCity != UNCHANGED) contact->put_HomeAddressCity(otherCity);
    if (otherState && otherState != UNCHANGED) contact->put_HomeAddressState(otherState);
    if (otherZip && otherZip != UNCHANGED) contact->put_HomeAddressPostalCode(otherZip);
    if (otherCountry && otherCountry != UNCHANGED) contact->put_HomeAddressCountry(otherCountry);
    if (categories && categories != UNCHANGED) contact->put_Categories(categories);
    if (assistant && assistant != UNCHANGED) contact->put_AssistantName(assistant);
    if (anniversaryAsPimalDateHelperGenericDateString && anniversaryAsPimalDateHelperGenericDateString != UNCHANGED)
    {
        PimalDateHelper anniversary(anniversaryAsPimalDateHelperGenericDateString);
        contact->put_Anniversary(anniversary.getDATE());
    }
    if (birthdayAsPimalDateHelperGenericDateString && birthdayAsPimalDateHelperGenericDateString != UNCHANGED)
    {
        PimalDateHelper birthday(birthdayAsPimalDateHelperGenericDateString);
        contact->put_Birthday(birthday.getDATE());
    }
    if (spouse && spouse != UNCHANGED) contact->put_Spouse(spouse);
    if (children && children != UNCHANGED) contact->put_Children(children);
    if (note && note != UNCHANGED) contact->put_Body(note);
}
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby JmGarcia » Sun Mar 15, 2009 10:59 pm

Antonio Linares wrote:Accediendo a los contactos usando C#:
http://www.codeguru.com/csharp/csharp/c ... php/c10773
Posiblemente podamos adaptarlo a FWPPC

Digo yo que se podrá... parece viable... :roll:
Ansioso espero :wink:

En el directorio windows del PPC existe un programa poutlook.exe que ademas esta arrancado siempre .
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Sun Mar 15, 2009 11:28 pm

Continuando la busqueda, he encontrado esta conversacion que parece dar la solucion para poder usar el objeto OLE:
http://www.arianesoft.ca/e107_plugins/forum/forum_viewtopic.php?5867.30

En concreto este codigo, que tenemos que adaptar:
Code: Select all  Expand view

#include "registry"

new(hKey$, TINT);
new(dwDispostion$, TINT);
if (RegOpenKeyEx(HKEY_CLASSES_ROOT, "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0\\0\\win32", 0, 0, &hKey$) != 0)
  RegCreateKeyEx(HKEY_CLASSES_ROOT, "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey$, &dwDisposition$);
  RegCreateKeyEx(HKEY_CLASSES_ROOT, "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey$, &dwDisposition$);
  RegCreateKeyEx(HKEY_CLASSES_ROOT, "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0\\0", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey$, &dwDisposition$);
  RegCreateKeyEx(HKEY_CLASSES_ROOT, "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0\\0\\win32", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey$, &dwDisposition$);
end;
ShowMessage(hKey$);

value$ = "\\windows\\pimtlb.dll";
RegSetValueEx(hKey$, 0, NULL, REG_SZ, value$, length(value$) * 2 + 1);
RegCloseKey(hKey$);

showmessage(registerdll("pimstore.dll"));
poom$ = CreateCOMObject("PocketOutlook.Application");
ShowMessage(poom$);
result$ = Invoke(poom$, "logon");
showMessage(result$);
folder$ = Invoke(poom$, "GetDefaultFolder", 10);
ShowMessage(folder$);
 

Si usamos RegisterServer() entonces no es necesario ese codigo, pues DllRegisterServer() se encarga de hacerlo:
Instructs an in-process server to create its registry entries for all classes supported in this server module
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby JmGarcia » Mon Mar 16, 2009 12:08 am

Parece que registrando la dll pimtlb.dll se podrá usar "PocketOutlook.Application"

En mi HTC ya esta registrada ya que en HKEY_CLASSES_ROOT\TypeLib\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\1.0\0\win32 pone \\windows\pimtlb.dll
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Mon Mar 16, 2009 2:12 am

JM,

He implementado RegisterDLL() para poder usarla como en el ejemplo: RegisterDLL( cNombreDLL )
Code: Select all  Expand view

#pragma BEGINDUMP

#include <hbapi.h>

#define UNDER_CE

#include <windows.h>

LPWSTR AnsiToWide( char * );
typedef LONG ( * PDLLREGISTERSERVER ) ( void );

HB_FUNC( REGISTERDLL )
{
   LPWSTR pW = AnsiToWide( hb_parc( 1 ) );
   HMODULE hDll = LoadLibrary( pW );
   LONG lReturn = 0;
   
   hb_xfree( pW );
   
   if( hDll )
   {
      LPWSTR pW = AnsiToWide( "DllRegisterServer" );
      FARPROC pRegisterServer = GetProcAddress( hDll, pW );
     
      hb_xfree( pW );
     
      if( pRegisterServer )
         lReturn = ( ( PDLLREGISTERSERVER ) pRegisterServer )();

      FreeLibrary( hDll );
   }
   
   hb_retnl( lReturn );
}        

#pragma ENDDUMP
 

Como has inspeccionado ese valor del registro ? Con RegQueryValue() ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Mon Mar 16, 2009 2:19 am

Prueba este codigo:
Code: Select all  Expand view

#include "fwce.ch"

function Main()

   MsgInfo( ValType( CreateObject( "4E130E40-7DBE-11D2-8F23-0000F87A4335" ) ) )

return nil
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Mon Mar 16, 2009 2:24 am

De todas formas en el ejemplo la que registra es esta:

showmessage(registerdll("pimstore.dll"))
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby JmGarcia » Mon Mar 16, 2009 8:43 pm

Antonio Linares wrote:Como has inspeccionado ese valor del registro ? Con RegQueryValue() ?
Con el Resco Registry.

Antonio Linares wrote:Prueba este codigo:
Code: Select all  Expand view
#include "fwce.ch"
function Main()
   MsgInfo( ValType( CreateObject( "4E130E40-7DBE-11D2-8F23-0000F87A4335" ) ) )
return nil 
Me da el mismo error.

Antonio Linares wrote:De todas formas en el ejemplo la que registra es esta:
showmessage(registerdll("pimstore.dll"))
Esta librería esta referenciada en:
HKEY_CLASSES_ROOT\CLSID\{05058F23-20BE-11D2-8F18-0000F87A4335}\InProcServer32
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Tue Mar 17, 2009 9:00 am

JM,

Has podido instalar la version demo de Resco Registry en el emulador ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Sat Apr 18, 2009 12:15 pm

JM,

Hemos localizado este regedit.exe para Windows Mobile y Windows CE, que es gratuito y es identico al de Windows PC :-)
http://www.mediafire.com/?sharekey=d045 ... 8114394287

Asi que podemos continuar con la investigacion del PocketOutlook :-)

Haciendo un repaso, necesitabamos usar estas DLLs:
pimstore.dll
pimtlb.dll

Ahora tenemos que comprobar si ambas estan en WM y WinCE...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Sat Apr 18, 2009 12:22 pm

Probando en que versiones de WM y WinCE estan las DLLs:

WM2003 y WM 6.1:
"pimstore.dll" si esta
"pimtlb.dll" no esta

WinCE 5.0: (el emulador ARM que hemos construido)
"pimstore.dll" no esta (puede ser que no hayamos incluido esta opcion en el "platform builder")
"pimtlb.dll" no esta

De momento, necesitamos localizar "pimtlb.dll"
Aqui esta: http://www.mediafire.com/?sharekey=d045 ... 0a1ae8665a

Code: Select all  Expand view

#include "FWCE.ch"

function Main()

   local hDLL1 := LoadLibrary( "pimstore.dll" )
   local hDLL2 := LoadLibrary( "pimtlb.dll" )

   MsgInfo( hDLL1 )
   MsgInfo( hDLL2 )

   FreeLibrary( hDLL1 )
   FreeLibrary( hDLL2 )

return nil
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Sat Apr 18, 2009 3:02 pm

Construyendo un ejemplo. Ojo, aun no esta terminado:

test.prg
Code: Select all  Expand view

#include "FWCE.ch"

#define HKEY_CLASSES_ROOT   0x80000000

function Main()

   local oOutLook, hKey

   RegCreateKeyEx( HKEY_CLASSES_ROOT, "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}" )
   RegCreateKeyEx( HKEY_CLASSES_ROOT,;
                   "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0" )
   RegCreateKeyEx( HKEY_CLASSES_ROOT,;
                   "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0\\0" )
   RegCreateKeyEx( HKEY_CLASSES_ROOT,;
                   "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0\\0\\win32",;
                   ,,,,, @hKey, )
   MsgInfo( hKey )

   MsgInfo( RegisterServer( "pimstore.dll" ) )

   oOutLook = CreateObject( "PocketOutlook.Application" )
   MsgInfo( oOutLook:ClassName() )

return nil

#pragma BEGINDUMP

#include <hbapi.h>

#define UNDER_CE

#include <windows.h>

LPWSTR AnsiToWide( char * );
typedef LONG ( * PDLLREGISTERSERVER ) ( void );

HB_FUNC( REGISTERSERVER )
{
   LPWSTR pW = AnsiToWide( hb_parc( 1 ) );
   HMODULE hDll = LoadLibrary( pW );
   LONG lReturn = 0;
   
   hb_xfree( pW );
   
   if( hDll )
   {
      LPWSTR pW = AnsiToWide( "DllRegisterServer" );
      FARPROC pRegisterServer = GetProcAddress( hDll, pW );
     
      hb_xfree( pW );
     
      if( pRegisterServer )
         lReturn = ( ( PDLLREGISTERSERVER ) pRegisterServer )();

      FreeLibrary( hDll );
   }
   
   hb_retnl( lReturn );
}        

HB_FUNC( REGCREATEKEYEX )
{
   LPWSTR pW = AnsiToWide( hb_parc( 2 ) );
   HKEY hkResult;
   DWORD dwDisposition;
   
   hb_retnl( RegCreateKeyEx( ( HKEY ) hb_parnl( 1 ), pW, hb_parnl( 3 ),
                             ( LPWSTR ) hb_parnl( 4 ), hb_parnl( 5 ), KEY_ALL_ACCESS,
                             ( LPSECURITY_ATTRIBUTES ) hb_parnl( 7 ),
                             ( PHKEY ) &hkResult, &dwDisposition ) );
   hb_xfree( pW );                          
   hb_stornl( ( LONG ) hkResult, 8 );
   hb_stornl( ( LONG ) dwDisposition, 9 );
}

#pragma ENDDUMP
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Read contacts Pocket outlook wm5

Postby Antonio Linares » Sun Apr 19, 2009 11:52 am

Una version mas avanzada, aunque todavia no funciona:
Code: Select all  Expand view
#include "FWCE.ch"

#define HKEY_CLASSES_ROOT   0x80000000

function Main()

   local oOutLook, hKey
   
   RegCreateKeyEx( HKEY_CLASSES_ROOT, "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}" )
   RegCreateKeyEx( HKEY_CLASSES_ROOT,;
                   "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0" )
   RegCreateKeyEx( HKEY_CLASSES_ROOT,;
                   "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0\\0" )
   RegCreateKeyEx( HKEY_CLASSES_ROOT,;
                   "TypeLib\\{4E130E40-7DBE-11D2-8F23-0000F87A4335}\\1.0\\0\\win32",;
                   ,,,,, @hKey, )
   RegSetValueEx( hKey, 0, 0, 0, "\\Storage card\\pimtlb.dll" )
   RegQueryValueEx( hKey )

   RegisterServer( "pimstore.dll" )

   oOutLook = CreateObject( "PocketOutlook.Application" )
   MsgInfo( oOutLook:ClassName() )

return nil

#pragma BEGINDUMP

#include <hbapi.h>

#define UNDER_CE

#include <windows.h>

LPWSTR AnsiToWide( char * );
typedef LONG ( * PDLLREGISTERSERVER ) ( void );

HB_FUNC( REGISTERSERVER )
{
   LPWSTR pW = AnsiToWide( hb_parc( 1 ) );
   HMODULE hDll = LoadLibrary( pW );
   LONG lReturn = 0;
   
   hb_xfree( pW );
   
   if( hDll )
   {
      LPWSTR pW = AnsiToWide( "DllRegisterServer" );
      FARPROC pRegisterServer = GetProcAddress( hDll, pW );
     
      hb_xfree( pW );
     
      if( pRegisterServer )
         lReturn = ( ( PDLLREGISTERSERVER ) pRegisterServer )();

      FreeLibrary( hDll );
   }
   
   hb_retnl( lReturn );
}        

HB_FUNC( REGCREATEKEYEX )
{
   LPWSTR pW = AnsiToWide( hb_parc( 2 ) );
   HKEY hkResult;
   DWORD dwDisposition;
   
   hb_retnl( RegCreateKeyEx( ( HKEY ) hb_parnl( 1 ), pW, hb_parnl( 3 ),
                             ( LPWSTR ) hb_parnl( 4 ), hb_parnl( 5 ), KEY_ALL_ACCESS,
                             ( LPSECURITY_ATTRIBUTES ) hb_parnl( 7 ),
                             ( PHKEY ) &hkResult, &dwDisposition ) );
   hb_xfree( pW );                          
   hb_stornl( ( LONG ) hkResult, 8 );
   hb_stornl( ( LONG ) dwDisposition, 9 );
}

HB_FUNC( REGSETVALUEEX )
{
   LPWSTR pW = AnsiToWide( hb_parc( 5 ) );
   
   hb_retnl( RegSetValueEx( ( HKEY ) hb_parnl( 1 ), NULL, hb_parnl( 3 ),
                            REG_SZ, ( const BYTE * ) pW, ( hb_parclen( 5 ) * 2 ) + 1 ) );
   hb_xfree( pW );                        
}

HB_FUNC( REGQUERYVALUEEX )
{
   DWORD dwType;
   BYTE buffer[ 100 ];
   DWORD cbData = 99;
   
   hb_retnl( RegQueryValueEx( ( HKEY ) hb_parnl( 1 ), NULL, 0, &dwType, buffer, &cbData ) );
   MessageBox( 0, ( LPWSTR ) buffer, L"ok", 0 );
}

#pragma ENDDUMP
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

PreviousNext

Return to FiveWin para Pocket PC

Who is online

Users browsing this forum: No registered users and 3 guests