Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - CE Contact Database

CE Contact Database

Discuss PocketC for CE (including Desktop Edition)

Postby everton on Fri Jun 20, 2003 8:15 pm

Test this code made in my Cassiopeia E-105 (wince 2.11):
// ContactView
#include "/Archivos de programa/pocketc/include/winuser.h"
#include "/Archivos de programa/pocketc/include/windbase.h"
#define PROPERTIES 29
#define FileAs 0x4013001F
#define Name1 0x3A06001F
#define Name2 0x3A11001F
#define Spouse 0x400A001F
#define Movile 0x3A1C001F
#define Email 0x4083001F
#define Home1Street 0x4040001F
#define Home1Tel 0x3A09001F
#define Home1Zip 0x4043001F
#define Home1City 0x4041001F
#define Home1State 0x4042001F
#define Home2Street 0x404A001F
#define Home2Tel 0x3A2F001F
#define Home2Zip 0x404D001F
#define Home2City 0x404B001F
#define Home2State 0x404C001F
#define Company 0x3A16001F
#define Department 0x3A18001F
#define WorkTel 0x3A08001F
#define WorkStreet 0x4045001F
#define WorkFax 0x3A24001F
#define WorkZip 0x4048001F
#define WorkCity 0x4046001F
#define WorkState 0x4047001F

main()
{

int lbID, hdb;
CEOID oidDb=0;
DWORD dwNumProperties;
CEPROPVAL rProperties[PROPERTIES];
CEPROPID rWanted[2];
LPBYTE lpBuffer;
DWORD dwBufferSize;
int swfin, ev, gi, i, found;
string contacto[24];

title("ContactView 3.5");
about("ContactView 3.5\r\n(c) 2003 Antonio Tapia\r\natapia@arrakis.es");
devicesip(FALSE);
clearg();
cursorwait(TRUE);
createctrl("BUTTON","fin",WS_VISIBLE|WS_POPUP,0,170,1,40,22,200);
lbID=createctrl("LISTBOX","ListBox",WS_VISIBLE|LBS_STANDARD,0,1,25,238,268,300);

hdb=CeOpenDatabase(&oidDb,"contacts database",FileAs,CEDB_AUTOINCREMENT,NULL);
dwNumProperties=1;
rWanted[0]=FileAs;
lpBuffer = rProperties;
while(CeReadRecordProps(hdb,0,&dwNumProperties,rWanted,&lpBuffer,&dwBufferSize)!=FALSE)
lbaddstr(lbID,rProperties[0].val.lpwstr);
CloseHandle(hdb);

if(lbgetcur(lbID)<0)lbsetcur(lbID,0);else lbsetcur(lbID,lbgetcur(lbID));
cursorwait(FALSE);
swfin=FALSE;
while(swfin==FALSE)
{
wndshow(lbID,5);
while(TRUE)
{
sleep(0);ev=event(0);gi=guiid();
if(ev==PM_DBCLICK && gi==300)
{
wndshow(lbID,0);
setbrushattr(127,127,255);
rect(0,0,240,320);
setbrushattr(255,255,255);
roundrect(5, 28,235, 50,10,10);sleep(1);
roundrect(5, 53,235,116,10,10);sleep(1);
roundrect(5,119,235,169,10,10);sleep(1);
roundrect(5,172,235,222,10,10);sleep(1);
roundrect(5,225,235,290,10,10);sleep(1);

hdb=CeOpenDatabase(&oidDb,"contacts database",FileAs,CEDB_AUTOINCREMENT,NULL);
lpBuffer=rProperties;

found=FALSE;
while(found==FALSE)
{
dwNumProperties=PROPERTIES;
CeReadRecordProps(hdb,0,&dwNumProperties,0,&lpBuffer,&dwBufferSize);
for(i=0;i<(int)dwNumProperties;i++)
{
if(rProperties[i].propid==FileAs)
{
if((string)rProperties[i].val.lpwstr==(string)lbgettxt(lbID,lbgetcur(lbID)))
{
found=TRUE;
break;
}
}
}
}
for(i=0;i<(int)dwNumProperties;i++)
{
switch(rProperties[i].propid)
{
case FileAs: contacto[ 0]=rProperties[i].val.lpwstr;break;
case Name1: contacto[ 1]=rProperties[i].val.lpwstr;break;
case Name2: contacto[ 2]=rProperties[i].val.lpwstr;break;
case Spouse: contacto[ 3]=rProperties[i].val.lpwstr;break;
case Email: contacto[ 4]=rProperties[i].val.lpwstr;break;
case Movile: contacto[ 5]=rProperties[i].val.lpwstr;break;
case Home1Street:contacto[ 6]=rProperties[i].val.lpwstr;break;
case Home1Zip: contacto[ 7]=rProperties[i].val.lpwstr;break;
case Home1City: contacto[ 8]=rProperties[i].val.lpwstr;break;
case Home1State: contacto[ 9]=rProperties[i].val.lpwstr;break;
case Home1Tel: contacto[10]=rProperties[i].val.lpwstr;break;
case Home2Street:contacto[11]=rProperties[i].val.lpwstr;break;
case Home2Zip: contacto[12]=rProperties[i].val.lpwstr;break;
case Home2City: contacto[13]=rProperties[i].val.lpwstr;break;
case Home2State: contacto[14]=rProperties[i].val.lpwstr;break;
case Home2Tel: contacto[15]=rProperties[i].val.lpwstr;break;
case Company: contacto[16]=rProperties[i].val.lpwstr;break;
case Department: contacto[17]=rProperties[i].val.lpwstr;break;
case WorkStreet: contacto[18]=rProperties[i].val.lpwstr;break;
case WorkZip: contacto[19]=rProperties[i].val.lpwstr;break;
case WorkCity: contacto[20]=rProperties[i].val.lpwstr;break;
case WorkState: contacto[21]=rProperties[i].val.lpwstr;break;
case WorkTel: contacto[22]=rProperties[i].val.lpwstr;break;
case WorkFax: contacto[23]=rProperties[i].val.lpwstr;break;
}
}
setfontattr("Arial",0,0,0,700,5,19);
text(10,029,contacto[0]); //FileAs
setfontattr("Arial",0,0,0,400,6,16);
text(10,054,contacto[1]+" "+contacto[2]); //Name1 + Name2
text(10,069,contacto[3]); //Spouse
text(10,084,contacto[4]); //Email
setfontattr("Arial",0,0,0,700,6,16);
text(10,099,contacto[5]); //Movile
setfontattr("Arial",0,0,0,400,6,16);
text(10,122,contacto[6]); //Home1Street
text(10,137,contacto[7]+" "+contacto:?:+" "+contacto[9]); //Home1Zip + Home1City + Home1State
setfontattr("Arial",0,0,0,700,6,16);
text(10,152,contacto[10]); //Home1Tel
setfontattr("Arial",0,0,0,400,6,16);
text(10,175,contacto[11]); //Home2Street
text(10,190,contacto[12]+" "+contacto[13]+" "+contacto[14]); //Home2Zip + Home2City + Home2State
setfontattr("Arial",0,0,0,700,6,16);
text(10,205,contacto[15]); //Home2Tel
setfontattr("Arial",0,0,0,400,6,16);
text(10,228,contacto[16]+" "+contacto[17]); //Company + Department
setfontattr("Arial",0,0,0,400,6,16);
text(10,243,contacto[18]); //WorkStreet
text(10,258,contacto[19]+" "+contacto[20]+" "+contacto[21]); //WorkZip + WorkCity + WorkState
setfontattr("Arial",0,0,0,700,6,16);
text(10,273,contacto[22]+" "+contacto[23]); //WorkTel + WorkFax
settextdefault();

for(i=0;i<24;i++)contacto[i]=" ";
for(i=0;i<PROPERTIES;i++)rProperties[i].val.lpwstr=" ";

CloseHandle(hdb);

while(TRUE)
{
sleep(0);
if(event(0)==PM_COMMAND && guiid()==200)break;
}
break;
}
if(ev==PM_COMMAND && gi==200)
{
swfin=TRUE;
break;
}
}
}
quit();
}
everton
 
Posts: 2
Joined: Thu May 22, 2003 7:02 pm
Location: Spain

Previous

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests

cron