|
Look into
CeSetUserNotification(Ex) or the older CeRunAppAtEvent/Time
and
GetIdleTime
Im not sure you can get notifications tied to idle time, but you could write a gui-less application that gets started by the times events to check if the device has been idle for long enough, and then starts the program that should run.
If your app is always running (or if you implement a service), you should get by with just GetIdleTime.
HTH
---
"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
|
|
|
|
|
Again, thank you for the reply, Jonas. I will run a few tests with this and see what I can come up with!
ZapMe1
|
|
|
|
|
Hello,
I'm looking for evc++ code that will "Disable ActiveSync" when the program is run, and restore connection (or at least the ability to connect), when the program is shutdown!
Can anyone help me with this?
Much Appreciated.
ZapMe1
|
|
|
|
|
Hi,
I've used this registry key in the past, dont know if it's still valid:
[HKEY_CURRENT_USER\ControlPanel\Comm]
"AutoCnct"=dword:00000000
This will stop the decive from trying to start an activesync session when a cable is plugged into the rs232/usb hybrid, but I guess it wont terminate an active connection. Unsure if that is what you are after.
HTH
---
"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
|
|
|
|
|
Thank you, Jonas. I'll give it a try, and post results back here! I appreciate the reply.
BTW: I'm not concerned with stopping the connection if already started, but would like to stop from connecting to ActiveSync if my program is already running!
ZapMe1
-- modified at 18:44 Thursday 23rd February, 2006
|
|
|
|
|
Hi Jonas,
Just wanted to say thank you! The registry change for "AutoCnct" worked like a charm!
When the value is set to it's default "1", then AS works & connects as usual! When this value is set to "0", then AS is ignored, and no connection is made!
I am a happy boy!
Thank You Again....
ZapMe1
|
|
|
|
|
Hello. Is there any way of modifying the look and feel of the application without having to repaint the controls (i.e. without inheriting from CDialog and catching the WM_PAINT message)?
Thanks a lot,
Ah Z.T.X.
A polar bear is a bear whose coordinates has been changed in terms of sine and cosine.
|
|
|
|
|
Greetings:
I've been struggling with writting a communications IO thread for a Windows Mobile .NET 2003. I have boiled my concerns down to a couple of basic questions:
Is it possible to have one thread send an asynchronous message to another thread. In other words, I'm looking for something equivalent to the "PostMessage" API procedure which places a message into a message queue of a window or command target but does not wait for for the message handler to finish (the way "SendMessage" would). Does this facility exist in Windows Mobile? Can it be implemented in Windows Mobile .NET or must I import things from the CoreLib.DLL?
I have also noticed that Windows Mobile .NET does not seem to support waiting on an AutoResetEvent or ManualResetEvent with a timeout. The overrides for "WaitOne" that allow you to provide a timeout parameter don't seem to be there for Windows CE.NET. Ditto on the static function "WaitAll".
With these elements removed, I don't know how one goes about writing efficient threads that can sleep when they are not needed and send messages to each othere without having to be "joined at the hip".
Have I misunderstood something? I hope I have. If anyone has some insight, I'd appreciate hearing from you.
Cheers,
Mark
|
|
|
|
|
I recently ran thru the same problem you are describing. After researching other discussions, my solution was to implement a "native" event class using the underlying windows CE API. Next, create a thread-safe message queue (using generics in my solution) that signalled an embedded native event when events were added and reset the event when the queue emptied.
I used these pieces to implements a WaitForAny on an array of the native handles. Final result was the desired WaitForAny that you are describing.
|
|
|
|
|
Um trying to add web service in a pocket PC application when i debug my solution there is an unhandled exception when trying to connect to the web service. this exception is "Can not establish connection to network". please tell me how I could fix that exception.
Eng.Kholyo
|
|
|
|
|
hi friends
can anyone pls tell me of any helpful material for the development of a system that allows remote access to windows/linux pc platforms using a symbian OS based PDA -basically any article, guidelines or source code regd it.
i'll be grateful.thanks
SB
|
|
|
|
|
Greetings:
I am writing this application for a PDA on Visual Studio .NET 2003. It has a USB Host interface. Everything is going along tickety-boo until I realize that I can't figure out a way to send information asyncronously from the data-reader thread to the main form.
The data-reader thread runs in the background and services the USB driver when new incoming data shows up. Now, I want the thread to be able to notify the main form when it has put new data into a shared buffer. I can't figure out how to do this with the compact framework. I do NOT want the thread having to wait for the main form to finish processing before it can continue (synchronous). I would like the two things to act indepedendantly...
Any suggestions? And please, I am relatively new to .NET framework programming, take it easy on me!
Thanks in advance to anyone who responds,
Mark
-- modified at 13:55 Friday 17th February, 2006
|
|
|
|
|
Store the data in a thread protected statically accessible area that the form can get to and then call Invoke on one of the form's controls or the form itself when data is present, then in the overridden Invoke method access the data and do what you will with it.
This statement is false.
|
|
|
|
|
Hi Chris:
Isn't "Invoke" synchronous? Doesn't it wait until the "invoked" procedure returns? What inspired my original message was when I discovered that "BeginInvoke", which is asynchronous, is not offered under the compact framework.
I also discovered that "Invoke" under the compact framework does not offer any of the extra overrides. You can only send the delegate as a parameter. It does not let you include the object array as a second parameter.
Cheers,
Mark
-- modified at 14:15 Friday 17th February, 2006
|
|
|
|
|
Yep. Invoke is synchronous. But what your asking for is a method to notify your main form that the background process has data available. So you would need to set your delegate to simply notify that the operation has finished. Then inside your form, access the static data in a protected common area and use a set of flags or state machine to determine the operation that was performed and respond accordingly.
With this you can simulate asynchronous behavior with your background thread and only use the Invoke of the form as a notifier. If your worried that the invoke will hang your background thread while processing the data then you could just use it to set a flag and have another thread maybe on a timer or something watch the flag and operate on the data from there instead of during the invoking from the background thread. A little klugy but that's what we got.
The Compact way of threading is to have parameterless invokes. So that's why the need for a state machine or set of flags.
This statement is false.
|
|
|
|
|
Hi Again:
I understand everything you are saying. I guess that I am a bit surprised that CE.NET does not seem to provide anything similar to "PostMessage" which provides a means to trigger the invocation of a procedure in another thread without having to wait around for the procedure to finish.
I'll have to go and do some ascertainin' and determinatin'...
Thanks for your help.
Mark
|
|
|
|
|
You might need to research this further but I believe you can override the WndProc method of the MessageWindow class after deriving from it. I'm inexperienced with this so don't hold me to it. But this might be more work than its worth unless your needing to do a bit of interop with win32.
This statement is false.
|
|
|
|
|
Hi Chris:
Just as an aside to all of this, is there somewhere a relatively clear and simple summary of what CE.NET can and can't do? Either in a book or on the WEB?
Thanks,
Mark
|
|
|
|
|
This is my choice of book:
http://www.amazon.com/gp/search/ref=br_ss_hs/103-3646719-5627005?search-alias=aps&keywords=.NET%20Compact%20Framework%20Programming%20with%20C%23
Its not just a reference but goes into detail of all sorts of interop and ASync apps. I highly recommend it. As far as the web... I google and google and google. And find myself bouncing between a few sites, but the book is where I end up most.
Hope this helps. If you want to discuss more offline I don't mind.
This statement is false.
|
|
|
|
|
Thanks a lot, Chris. This has been very helpful.
Mark
|
|
|
|
|
Hi all,
We recently were asked to do maintenance of an already developed mobile application. The app is already deployed and used on PDAs.
Now we received change request. We completed them using VS.NET 2003, .NET Framework 1.1. Now I have not used .NET compact framework. If I deploy my binaries created on our regular .NET framework, will the binaries work in production system on PDA? Also:
a. What is .NET Compact framework?
b. From where to download it?
c. Can .NET Framework and compact framework run on same machine?
d. Which version of compact framework to use so that it is compatible with VS.NET 2003 and .NET framework 1.1?
Help is appreciated.
Vilas
|
|
|
|
|
please help me, how can i connect database SQL server in my Pocket PC, when i run it in Visual studio 2003 this run correct but when i run in Pocket PC, it can't connect to my PC
|
|
|
|
|
Hi,
I m developing an application in the windows CE and MFC Smart Device App.
I am using Dialog based application .
I want that my menu will come at command bar the bottom bat where the new menu comes in the document view architecture application.
I want that my coustamize menu will come at the bottom bar.
I m using Visual Studio 2005.
Dialog Based Aaplicaion with MFC Smart Device App.
Please help me out of this problem and Thnx in advace.
Bye
This is Rocky
|
|
|
|
|
Greetings:
I am trying to write a PDA program that supports a USB Host port. I am using Visual Studio 2003, C# with some imported Win32 DLL's. The driver for the USB port was provided by FTDI and appears to be installed and working very well. There is just one detail:
There is one procedure in the USB DLL that requires an "event" handle that has been created and non-signaled. I am talking about the kind of event that you create with the Win32 API function "CreateEvent". The idea is that the procedure stores the event handle internally and when incoming characters are available, it will signal the event so that your read-data thread can wake up and process the new data.
I have imported a few procedures from the Kernel32.DLL successfully but "CreateEvent" is not working. I have consulted the WEB site "P-Invoke.NET" which provides DllImport proper syntax for every conceivable procedure in a variety of DLL's. But whenever I make a call to "CreateEvent", I get the "MissingMethodException".
So I have a few questions:
1. Does Windows CE support "CreateEvent"?
2. If not, how can I create a read-data thread that sleeps until characters are available, especially since the USB Win32 driver uses a Win32 DLL to signal?
3. Is there a repository of information anywhere where I can quickly look up what Win32 API functions are available under Windows CE? I have checked the MSDN "Platform SDK: DLLs, Processes, and Threads" document. It does NOT say that it IS supported under Windows CE but it does NOT say that it isn't either.
Finally, I tried using a .NET AutoResetEvent object. It has one property "Handle" and the documentation refers to this as "the native operating system handle". I thought that perhaps that this was in fact the event handle ultimately created by "CreateEvent". However, when I passed this to the USB DLL, it did not signal as expected when characters came in (I am absolutely certain that characters were received). Have I misunderstood or misused this object?
Thanks in advance to anybody who responds.
Mark
|
|
|
|
|
Hi,
1: Probably yes, I use it all the time, although from C++ and on the PPC2000, 2002, WM2003 & 2005 platforms. It's highly unlikely that your OEM pulled that function from their build of Windows CE if you're using a custom build, but ofcourse possible.
3: You should get a helpfile (.chm) for the SDK if you're targeting PPC or WM. I'm still stuck with EVC3, so I cant help you with where it ends up when using VS2003.
Last question: .Net is not my thing and its hard to know whats wrong without seeing some code, but perhaps you should try writing a testprogram using that class? ie a thread that does the .Net equivalent of:
DWORD WINAPI thread(void* lp)
{
while (true)
{
WaitForSingleObject(event, INFINITE);
MessageBox(0, L"event signaled", L"thread", 0);
}
return 0;
}
And then you can add a button that sigals the event when pressed.
---
"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
|
|
|
|