More problems with set date on DatePicker

Discuss topics that apply across the products, such as the PocketC language, or development in general

Postby FrappyDan on Sat Jan 04, 2003 3:42 am

I typed in the following code to try out the code for setting the time in a Time/Date picker. I had no success getting the date in the box to change & fail to understand why. This is the last problem I have to resolve before I can complete my app. What do you think & how do I fix it? I already tried putting the rTime declarations outside and inside of main()...Also I've tried this with and without the control visible.
--------------------------------------------------------------------
//setcalenderdate
#include "/pocketc/winbase.h"
#include "/pocketc/commctrl.h"
#define DSC_SYSTEMTIME "wwwwwwww"
SYSTEMTIME rTime;
LPVOID lpData;

main(){
int nID;
nID=500;

rTime.wYear=2003;
rTime.wMonth=1;
rTime.wDayOfWeek=0;
rTime.wDay=1;
rTime.wHour=11;
rTime.wMinute=25;
rTime.wSecond=0;
rTime.wMilliseconds=0;
lpData=LocalAlloc(LPTR, sizeofx(DSC_SYSTEMTIME));
memwriteStruct(&rTime,DSC_SYSTEMTIME,lpData);
createctrl("SysDateTimePick32", "DateTime1", 0x40810000, 0x200, 23, 100, 80, 20, nID) ;
sendmsg(nID,DTM_SETSYSTEMTIME,lpData,GDT_VALID);
wndshow(nID,5);
LocalFree(lpData);
text(0,0,editget(nID));
waitp();
quit();
}:evil:

FrappyDan
FrappyDan
FrappyDan
 
Posts: 16
Joined: Mon Nov 25, 2002 4:09 am
Location: USA

Postby guy on Sat Jan 04, 2003 12:01 pm

Sorry, this may have been my fault in a previous post. You have the wparam and lparam parameters to the sendmsg the wrong way round:

sendmsg(nID,DTM_SETSYSTEMTIME,GDT_VALID,lpData);



Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby FrappyDan on Sun Jan 05, 2003 2:23 am

Oh good, I was hoping it was that simple. I will try this and hopefully won't have any problem.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by guy</i>
<br />Sorry, this may have been my fault in a previous post. You have the wparam and lparam parameters to the sendmsg the wrong way round:

sendmsg(nID,DTM_SETSYSTEMTIME,GDT_VALID,lpData);



Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum

<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

FrappyDan
FrappyDan
FrappyDan
 
Posts: 16
Joined: Mon Nov 25, 2002 4:09 am
Location: USA


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron