|
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
|
|
|
|
|
Hi,
I am new to mobile development. mobile symbian os. i am intersted to develop program in C#.Net. any one help me out to use this program. it can directly use the program or any other tools need for this one. any one help in brief. thanks in advance.
Have A Nice Day!
Murali.M
|
|
|
|
|
Hi coders,
I am implementing smartdevice Application using .NET compact fw 2.0. I want to show the messages which are synchronised from the other database.
showing of these messages same like a mail box grid. one column is hyperlink column requrired.
plz tell me which control is suitable for this type(like mail box grid) for smart device application.
regards
GV Ramana
|
|
|
|
|
|
Is there a way to access the parameters of a CABWIZ INF file (Information
File) from the custom setup.dll specified in the CESetupDLL string in the
[DefaultInstall] section?
For example, if this section is in the INF file:
[Strings]
ShowMessages="Yep"
Can I access the ShowMessages string from inside my setup.dll written in eVC?
Thanks,
Steve
|
|
|
|
|
I suggest you storing the parameters in the registry and then read them from setup.dll
|
|
|
|
|
How can i login into a remote computer(connected to internet) through mobile phones?
Is there any way? please help me by giving suggestions and related links to wep pages that describe how it is done(the software & hardware part).
Thank you.
Revathi
|
|
|
|
|
Hi All,
Does someone know how to set by program the clock of the Pocket PC from my Desktop PC?
I searched in the windows RAPI fonctions that can manage a lot of mobile device settings and file actions, but I didn't find anything that can manage the clock (Time & Date) settings.
I know I can use activesync connexion settings, but I need to do that within my application, to be sure that, no matter the activesync configuration, date & time will be the same on both devices.
Does someone know some API that provide such function?
Ludo
|
|
|
|
|
Hi,
I am currently designing an application for a customer, whereby the attendant on a site can use a handheld device to book a customer in, and print off a receipt on a mobile printer, rather than the customer entering into the site office.
We are using Wireless to communicate with the base station, and I am wondering if anybody has any recommendations on what I should use to communicate with the printer. We have a spare PCMCIA slot in the device, and I am wondering on bluetooth or wireless. If the unit goes out of range, we would still want it to perform the basic functions, and synchronise when back in range.
Any ideas / input?
Many thanks
|
|
|
|
|
hi this rituparn,
mobile message/voice security has to be developed,coding message (text or voice ) at transmitters end decoding it @ receivers end can solve this security crises up to great extent and thats my project for embedded.
i need suggessions
rituparn
|
|
|
|