哪位好心的大侠知道在PB中怎么使用【comctl32.dll】中的日历控件【sysdatetimepick32】
我刚用PB不久,刚刚用PBkiller反编译别人的程序来学习,但是我使用反编译出来的代码去不能显示【comctl32.dll】中的日历控件【sysdatetimepick32】
,而我运行他的安装程序日历控件却是可以用的!
弄了好久都没有弄出来,不知道是反编译的出来的代码有问题还是别的原因?后来我参考了一下反编译出来的代码,自己做了一个用户对象【uo_sysdatetimepick32】,不过把它加到窗口中,也没有看到这个日历控件!
我把我反编译的代码和我自己做的【uo_sysdatetimepick32】的代码都列在下面!
哪位好心的大侠可以帮帮我,非常感谢!
我反编译出来的代码如下:
====================
forward
global type uo_comctl_datetime from userobject
end type
end forward
global type uo_comctl_datetime from userobject
integer width = 508
integer height = 99
long backcolor = 0
string classname = "sysdatetimepick32"
string libraryname = "comctl32.dll"
long style = 1174405120
end type
global uo_comctl_datetime uo_comctl_datetime
type variables
private nvo_comctl_datetime iuodatetime
end variables
forward prototypes
public subroutine of_getobject (ref nvo_comctl_datetime auodatetimepicker)
public function datetime of_getdate ()
public subroutine of_setdate (date ld_rq)
public subroutine of_setdate (datetime ldt_rq)
public subroutine of_setdate (string ls_rq)
public subroutine of_getdate (ref string ls_date)
public subroutine of_getdate (ref datetime ldt_rq)
public subroutine of_getdate (ref date ld_rq)
public subroutine of_getdate (ref time lt_rq)
public subroutine of_setdate (time lt_time)
end prototypes
public subroutine of_getobject (ref nvo_comctl_datetime auodatetimepicker);auodatetimepicker = iuodatetime
return
end subroutine
public function datetime of_getdate ();nvo_comctl_datetime lnvodatetime
datetime ldtselected
string lsselecteddate
if isvalid(this) then
of_getobject(lnvodatetime)
ldtselected = lnvodatetime.of_getdatetime()
end if
return ldtselected
end function
public subroutine of_setdate (date ld_rq);datetime ldt_rq
ldt_rq = datetime(ld_rq)
iuodatetime.of_setdatetime(ldt_rq)
end subroutine
public subroutine of_setdate (datetime ldt_rq);iuodatetime.of_setdatetime(ldt_rq)
end subroutine
public subroutine of_setdate (string ls_rq);date ld_rq
datetime ldt_rq
if len(ls_rq) = 8 then
ls_rq = left(ls_rq,4) + "-" + mid(ls_rq,5,2) + "-" + right(ls_rq,2)
end if
ld_rq = date(ls_rq)
ldt_rq = datetime(ld_rq)
iuodatetime.of_setdatetime(ldt_rq)
end subroutine
public subroutine of_getdate (ref string ls_date);nvo_comctl_datetime lnvodatetime
datetime ldtselected
date ldselected
if isvalid(this) then
of_getobject(lnvodatetime)
ldtselected = lnvodatetime.of_getdatetime()
ldselected = date(ldtselected)
ls_date = string(year(ldselected)) + string(month(ldselected),"00") + string(day(ldselected),"00")
end if
end subroutine
public subroutine of_getdate (ref datetime ldt_rq);nvo_comctl_datetime lnvodatetime
if isvalid(this) then
of_getobject(lnvodatetime)
ldt_rq = lnvodatetime.of_getdatetime()
end if
end subroutine
public subroutine of_getdate (ref date ld_rq);nvo_comctl_datetime lnvodatetime
if isvalid(this) then
of_getobject(lnvodatetime)
ld_rq = date(lnvodatetime.of_getdatetime())
end if
end subroutine
public subroutine of_getdate (ref time lt_rq);nvo_comctl_datetime lnvodatetime
if isvalid(this) then
of_getobject(lnvodatetime)
lt_rq = time(lnvodatetime.of_getdatetime())
end if
end subroutine
public subroutine of_setdate (time lt_time);datetime ldt_date
ldt_date = datetime(date("1900-01-01"),lt_time)
iuodatetime.of_setdatetime(ldt_date)
end subroutine
event constructor;iuodatetime = create nvo_comctl_datetime
iuodatetime.of_sethandle(handle(this))
return 0
end event
on uo_comctl_datetime.create
end on
on uo_comctl_datetime.destroy
end on
event destructor;destroy(iuodatetime)
end event
【uo_sysdatetimepick32】
====================
forward
global type uo_sysdatetimepick32 from userobject
end type
end forward
global type uo_sysdatetimepick32 from userobject
integer width = 508
integer height = 99
boolean border = true
userobjects objecttype = externalvisual!
long backcolor = 0
string classname = "sysdatetimepick32"
string libraryname = "J:\shareDll\comctl32.dll"
long style = 1174405120
end type
global uo_sysdatetimepick32 uo_sysdatetimepick32
on uo_sysdatetimepick32.create
end on
on uo_sysdatetimepick32.destroy
end on