[nsbasic-ce] Re: setting the date and time

2009-04-29 Thread t2thecathp
I was thinking about making a SOAP call that will grab the correct date/time.

I don't thing I will go so far as to write a NTP client, but I plan to grab the 
time/date from a network source.


--- In nsbasic...@yahoogroups.com, "bwolodko"  wrote:
>
> --- In nsbasic...@yahoogroups.com, "t2thecathp"  wrote:
> >
> > Is it possible to set the date and time on the handheld device with 
> > NSBasic/CE code?
> > 
> > Everytime I reset the device, it thinks it is 2004 or 2005.
> >
> 
> Sounds like the RTC is not working... need new battery?
> 
> I think you can set or retrieve the time and date by using:
> 
> addobject "MGCEWin32.API", "API", 0, 0, 0, 0
> d = API.SystemTime
> API.SystemTime = Now
> 
> See The Big Red Toolbox , MGCEWin32
> 
> http://www.nsbasic.com/ce/info/BigRedToolbox/MGCEWin32.htm
> 
> The problem is who sets the values before you call this? InputBox?
> 
> Shades of old DOS when it asked you for the time and date at boot time.
> 
> Hope this helps..
> Ben
>



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~--~~~~--~~--~--~---



[nsbasic-ce] Re: ShellExecute and regsvrce question

2009-04-29 Thread Chris Kenworthy
--- In nsbasic...@yahoogroups.com, "bwolodko"  wrote:
>
> --- In nsbasic...@yahoogroups.com, "styskul"  wrote:
> >
> > --- In nsbasic...@yahoogroups.com, "t2thecathp"  wrote:
> > >
> > > With the IP*Works! tools, I have to execute something like this after 
> > > copying the *.ocx file to the /windows folder of the PDA:
> > > 'ShellExecute "open","regsvrce","http50.ocx" 
> > > 
> > > I have 3 questions:
> > >   1.  Is there a way to check to see if an object is registered before 
> > > calling ShellExecute?
> > > 
> > >   2.  Is there a way to copy the *.ocx file to the /windows folder of the 
> > > PDA?  Can the *.ocx file be embedded inside an .exe file?  Or do I have 
> > > to grab it over TCP/IP?
> > For #2, I believe the answer to the .ocx embedded in .exe part would be no. 
> >  As long as you know what the name of the Windows folder is (not sure if it 
> > can be different in PDAs like it can on Desktops) then you should be able 
> > to copy the file over.  There might be an example of file copying in the 
> > tech notes.
> For CE 5.0 Pro on a CuWin3500 HMI panel I did the following, having both 
> Flash and an SD card on board.
> 
> Copy the .dll or .ocx to the Flash or SD location then register from there
> 
> ShellExecute "open","regsvrce.exe","\Storage Card\NSBMCEControls\MSCEComm.dll"
> 
> Have to put in the full path.
> 
> Hope this helps.
> 
> Ben

File Copying using the NewObjects filecontrol object is covered here: 
http://www.nsbasic.com/ce/info/technotes/TN09.htm

I'd try to copy to onboard memory instead of registering the dll on a storage 
card - that way you don't have problems running the program when that card 
isn't inserted, right?

To test for the object being registered, you can use an error test after 
addobject:

on error resume next
addObject "IPWorks.HTTP","http"

if err.number <> 0 then
  ShellExecute "open","regsvrce","http50.ocx" 
  addObject "IPWorks.HTTP","http"
end if
on error goto 0

When I tested out doing an addobject for "fake.street.123", I got an err.number 
of 103, but that might not be universal.

Let us know how things go,
Chris.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~--~~~~--~~--~--~---



[nsbasic-ce] Re: setting the date and time

2009-04-29 Thread bwolodko
--- In nsbasic...@yahoogroups.com, "t2thecathp"  wrote:
>
> Is it possible to set the date and time on the handheld device with 
> NSBasic/CE code?
> 
> Everytime I reset the device, it thinks it is 2004 or 2005.
>

Sounds like the RTC is not working... need new battery?

I think you can set or retrieve the time and date by using:

addobject "MGCEWin32.API", "API", 0, 0, 0, 0
d = API.SystemTime
API.SystemTime = Now

See The Big Red Toolbox , MGCEWin32

http://www.nsbasic.com/ce/info/BigRedToolbox/MGCEWin32.htm

The problem is who sets the values before you call this? InputBox?

Shades of old DOS when it asked you for the time and date at boot time.

Hope this helps..
Ben


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~--~~~~--~~--~--~---



[nsbasic-ce] setting the date and time

2009-04-29 Thread t2thecathp
Is it possible to set the date and time on the handheld device with NSBasic/CE 
code?

Everytime I reset the device, it thinks it is 2004 or 2005.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~--~~~~--~~--~--~---