|
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
|
|
|
|
|
Greetings:
I am developing a fairly simple application on a Fujitsu Siemens Loox 720 Pocket PC running Windows Mobile 2003. I am using Visual Studio 2003 with a project configured for Smart Devices using C#.NET.
OK, I have noticed a strange problem and I find it is repeatedable with the simplest of programs and also with applications that come with the operating system like "File Explorer".
All you have to do is run these programs ONCE and then close them again immediately. Now, my Loox 720 comes with a utility program called "Running Programs". I start this program and it lists the applications that are, apparently, running. What I am finding is that my program remains on this list even after I have closed it. My impulse would be to check for un-released resources allocated from my application, but I must emphasis, I have reproduced this problem with a simple program that does nothing else but put a Windows Form on the display and lets you close it. It also happens with File Explorer. Try it: Start File Explorer, close it, then check "Running Programs" - there it is!
I wouldn't really care about this but I find that when I need to deploy my application, if I run the application and then try to make a change and then deploy it again, it won't let me! I have tried to delete the program EXE file from the Program Files directory but the PDA won't let me saying that the program is in use! I have to start the "Running Programs" utility and FORCE it to close before the PDA will allow me to delete or update the EXE! That is NOT going to make development easy.
Can anybody shed some light on this issue? Why do certain programs that run on the PDA APPEAR to close but remain running to some extent? How can I write MY simple application so that when it is closed, it actually CLOSES?
Thank you in advance for your response.
Mark
|
|
|
|
|
Jethro63 wrote: Can anybody shed some light on this issue? Why do certain programs that run on the PDA APPEAR to close but remain running to some extent? How can I write MY simple application so that when it is closed, it actually CLOSES?
The little 'X' in the topright corner does not close the program, it only minimizes it.
Dialog-based programs generally have a small 'ok' button up there, which maps to OnOK -> AppExit.
You should be able to add the 'ok' button to your SDI based app with
SHDoneButton(GetSafeHwnd(), SHDB_SHOW);
when creating the CMainFrame class (or handle it via menus, etc).
---
"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
|
|
|
|
|
Hi Jonas:
Thanks for your response.
Its funny but barely minutes ago, I read a technical article on the MSDN web site entitled:
"Differences in Microsoft .NET Compact Framework Development between the Pocket PC and Windows CE .NET"
In this article, I found that your solution will work, OR, you can go to the property sheet for the main form and change "Minimize" from True to False. This will REPLACE the 'X' with an 'Ok', which closes the application. This will suit my purposes as I do not need to be able to minimize my application.
Thanks again,
Mark
|
|
|
|
|
Hi all! I have a problem on WM 5.0. Anyone can help me.
I have a project on Pocket PC 2003 and I use CCeSocket class to connect to the NET. Now, I want to convert this project to Window Mobile 5.0. I use Visual Studio 2005 IDE to convert it but VS 2005 not supports CCeSocket class.
On the msdn documents, they say that CCeSocket encapsulates CAsyncSocket. I've replated CCeSocket by CAsyncSocket but the application still can not connect to the Net. I debug step by step and when I use connect function of CAsyncSocket, it is not successful. I get the error with the function GetLastError() and the return is WSAEWOULDBLOCK error "The socket is marked as nonblocking and the connection cannot be completed immediately.".
Please tell me solve this problem.
Thank you very much.
Namdn
-- modified at 4:56 Wednesday 15th February, 2006
|
|
|
|
|
how to create help in mobile aplication ?
|
|
|
|
|
|
I have learned lots through the following site:
www.devbuzz.com
Thanks,
TS
www.pcknowledgevault.com
-- modified at 23:39 Sunday 19th February, 2006
|
|
|
|
|
|
|
Hi. I'm using a toolbar created with winForms on my Pocket PC 2002 app. The icons I assign to the toolbar buttons are 16x16 .png icons. I've 2 related problems: I'm actually seeing the "transparent" part of the icon (the toolbar background is gray, but I see the icon surrounded by a white square) and, in consequence, when I disable a toolbar button I don't see the shadow of the icon shape: I see the shadow of the square, so all the icons seem the same disabled. If I edit the icon and paint the "transparent" part with the toolbar background color I solve the first part of the problem, but when the icon is disabled I will still see an square.
I would really appreciate if anybody could tell me how to solve this problem or give me any clue.
Thanks,
Federico
|
|
|
|
|
Hi,
How can I insert in DB SQL CE all date from XML in C#?
Thanks
Alessandro Graps
|
|
|
|
|
please help me, how can i view HTML, thanks
kevil
|
|
|
|
|
This depends on how you are accessing the site, etc.
For example in IE you can go to View --> Source
Thanks,
TS
www.pcknowledgevault.com
|
|
|
|
|
Anoyone know how to make a progress bar using VB in the compact framework? I tried using the standard control...but its not working very well. Sometimes it doesnt even come to the foreground. Thanks for any help.
Pablo
|
|
|
|