Serial Port programming with OpenNetCF Question
To all,
I've used the OpenNetCF classes to build a demo program to test serial
port communication, but somehow I don't really know how to send data
since the example I've got is only how to receive data.
Questions:
1) can I really write such a demo program using the VS.Net Emulator ??
Since I've read quite a no. of forums complaining Serial Port is not
working on Emulators
2) if I want to send data, I should use "Port.Output = new byte[]{11,
12.....}" and it will invoke the delegate /event for data receiving
???
3) as from the example program, I should use "Port.Input" to receive
the byte[] sent by the Tx side ???
4) How can I know the communication is in half or full duplex ??
(actually can I set 1/2 or full duplex ??)
Thanks!
From Jason (Kusanagihk) Tag: Turn off / on flight mode Tag: 33442
listview columnwidth to largest subitem?
Hi,
I have a datareader filling a listview, after that I want to set my listview
column width to the largest subitem in the column. You could do that by
setting width to -1.
I already found out about a bug that you could not set -1 by the columns.add
method
([url]http://support.microsoft.com/default.aspx?scid=kb;en-us;316572[/url])
But it won't work like they descripe there either.
CODE
private void Form1_Load(object sender, System.EventArgs e)
{ ListViewItem item = new ListViewItem();
listView1.View = View.Details;
item.Text = "This is Item 1";
item.SubItems.Add("This is subitem 1 for item 1");
item.SubItems.Add("This is subitem 2 for item 1");
listView1.Items.Add(item);
ListViewItem item1 = new ListViewItem();
item1.Text = "This is Item 2";
item1.SubItems.Add("This is subitem 1 for item 2");
item1.SubItems.Add("This is subitem 2 for item 2");
listView1.Items.Add(item1);
listView1.Columns.Add("Column 1",-1, HorizontalAlignment.Left);
listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 3", -1, HorizontalAlignment.Left);
listView1.Columns[0].Width = -1;
}
So in the add method it will not work but
listView1.Columns[0].Width = -1;
should set column[0].width to the largest subitem in the column ... but it
doesn't...
Can anyone tell me how I can solve this?
(it works fine on the .NET framework, not on the .NET compact framework) Tag: Turn off / on flight mode Tag: 33440
Country of user
Hi,
Is that possible to understand which country is the user from his or her GSM
operator in smartphones with .NET Compact Framework?
Any help would be appriciated,
--
Sarp Arda Coskun
--
Sarp Arda Coskun Tag: Turn off / on flight mode Tag: 33437
XML as database
Hello
i want to use xml as a database (anybody an other idea )?
But in visual studio everything on the data tab is disabled. Is there
anybody who can give me an example
Thanks,
Frank Beerens Tag: Turn off / on flight mode Tag: 33429
Charts
Hello,
I need to so some charting stuff, so i am wondering if there is an open
source charting library or something like that to get some extra time (with
no extra cost) in my plans ... does anyone knows one??
Thanks in advance,
Maurice. Tag: Turn off / on flight mode Tag: 33427
XMLInclude Problem in CF.NET
Hi!
I have a WebService, that returns an array of some messages. Each
message type is a class, derived from base class MESSAGE. XMLInclude
is present.
If I use my WebService with namespace "http://tempuri.org", everything
works fine on both regular and Compact Framework.
Since I'm going to use "http://mycompany.com" it gives me an
InvalidOperationException "Cannot find type for
http://tempuri.org/:FOO" on CF.NET. (FOO ist a message type, derived
from MESSAGE). But it works properly on the Big .NET Framework.
Is it a BUG or a feature? Is there a workaround for it.
A lot of thanks.
I'm sorry for my English. Tag: Turn off / on flight mode Tag: 33425
Send SMS on Pocket PC 2000 with .NET Compact Framework
Hi,
I am building a basic SMS application for Pocket PC 2000 with Mobile
support. This version does not support the "SMS.DLL"! I did find some help
in MSDN but not a sample source code.
Could any one provide me with useful links, sample code or any thing?
Adam Tibi Tag: Turn off / on flight mode Tag: 33424
Sql Query on a datatable
Hi,
I have a datatable filled with data, and I need to fill another datatable
from it by using a sql query. is this possible? if not was is the best (
fastest ) way to do this. In the select query I need to use the 'group by'.
Thanks, Tomer! Tag: Turn off / on flight mode Tag: 33422
Multiple CF cards
I have an application (plus a huge amount of data) I'd like to put on 50
Compact Flash cards, this takes about 20 minutes per card. Does anyone know
of a way of writing to multiple cards at once?
Thanks,
Steven Tag: Turn off / on flight mode Tag: 33421
date time picker
Sorry to repeat this as I KNOW it's been up here dozens of times, but can
anyone point me to the free date/time picker VB.net code that is published
on the Microsoft site. I cannot find it anywhwre, but I know it's there
<embarrassed>
Glyn Meek Tag: Turn off / on flight mode Tag: 33416
UREGENT: Transparent background labels
hi all i am wirting an application, that has a picture box as a back ground,
and i want to add a Text Label on top of the picture box but it always shows
that background type even if i set label1.backcolor =
SystemColors.Transparent in the page_load function
thanks
mustafa Tag: Turn off / on flight mode Tag: 33411
Starting an .exe from within an application in C#
I wan't to start a new application from within an application. The first
application shall be closed and the new application (.exe) shall start. I
can't find any help in visual studio about this. I would like some sample
code about this in C#. The most simple way to do this is what i wan't
/Beginner Tag: Turn off / on flight mode Tag: 33408
Binding!
Alright
I am just about to start development on a new app and could do with a
bit of help :) I've got two ideas and just wondering which people
think is the best or quickest.
1:
I have a table (2 columns), it is used as a "lookup" table i.e.
Item Code
crisps 1
coke 2
etc...
My main table which stores my data has a field called "ItemCode" which
holds the code. I want to have a combobox that shows the "Item" field
from the lookup table but is bound to Item in my other table.
2:
combo box shows fields but isnt bound and then when the save button is
pressed an sql statement is executed which updates the row with the
new value. I think this method maybe slower when moving records
because ill have to set the values of all controls where as with
method 1 they will be bound.
Thanks
Chris Tag: Turn off / on flight mode Tag: 33407
Thread not starting
I've got a problem starting a thread in c#.
Two scenarios.
1) got a form, which creates an instance of a class. in the
constructor of the class is a call to a method which starts a thread.
public void StartThread ()
{
new Thread (new ThreadStart (this.WaitExecute)).start();
Console.WriteLine ("thread started")
}
private void WaitExecute()
{
Console.WriteLine ("thread sleep");
Thread.Sleep (30000);
SignOn();
this.Invoke (new EventHandler (this.Restart));
Console.WriteLine ("thread done");
}
this works.
scenario 2
send 2 msmq messages (send 1 and its fine) and the thread doesnt start
ie all i get on the console is the "thread started" message and not
the "thread sleep"
the msmq call was originally in the same class as the thread above,
but i've since move it ot its own class.
i have also now moved the call to the startThread onto a button on the
main form
i can send one message and the click on the button and it starts fine
send two messages and the thread wont start.
any ideas would be appreciated
Andy Tag: Turn off / on flight mode Tag: 33404
what is WCE420X86 cab file?
Anyone know WCE420X86 cab file for what purpose? is that for eVC, eVB emulator?
Thanks Tag: Turn off / on flight mode Tag: 33396
Flash in Smart device Appln
Hi,
How can I call Flash file in smartdevice application? I found one controll
"Shockwave Flash Object" for windows application. Is there any similar
controll for SmartDevice application?
Thanks,
Anwar Tag: Turn off / on flight mode Tag: 33395
SQL Install Problem.
Hi,
I created an install application for Microsoft SQL Server CE 2.0 English
Version CAB Files, but some user have reported that if they use a PocketPC
version that has a language different of English, SQL didn't install, does
anyone know where can I get the cab files for other languages?
Thank You
Eduardo Castro - MCSA/MCP Tag: Turn off / on flight mode Tag: 33374
MDC 2004 DVD?
I did not attend MDC 2004, but I still would still like to buy the
conference DVD. Does anyone know where I can buy it?
Thore Berntsen Tag: Turn off / on flight mode Tag: 33373
ListView control
I'm using a ListView control in a Pocket PC app. I need to know what row a
user clicked on. In VB can anyone help? I also want to update data in a
specific row/column.
Thanks
Rick Lederman Tag: Turn off / on flight mode Tag: 33367
How to P/Invoke the RasGetEntryDialParams method??
Hello,
Can anybody provide a code snippet of how to P/Invoke RasGetEntryDialParams?
Anytime we try it the function returns with an errorcode 87 (invalid
parameters).
I guess the problem lies in the LPRASDIALPARAMS struct members which
probably aren't set correctly.
Many thanks in advance.
Roberto Rocco. Tag: Turn off / on flight mode Tag: 33366
Calculate difference between two datetime values
Hello all,
I'm new in CF and C#.
How can I calculate the diffence between two datetime values, lets say :
Date1 "8/21/2004 03:20:00"
Date2 "8/20/2004 23:40:00"
and then compare this
if (Date1 - Date2) >= 15 minutes then
do something
else
do otherwise
thanks
Peter. Tag: Turn off / on flight mode Tag: 33361
Public Folders
I'm looking to write a Pocket PC app to access public folders on an
exchange server. Would MAPI be used to do this?
Craig Tag: Turn off / on flight mode Tag: 33353
Calling scanner fundi's...
[Environment]
Symbol MC9000k scanner running Windows Mobile 2003.
C# .Net (.Net CF) with OpenNetCf 1.2 installed.
Latest Symbol SDK driving the scan engine stuff.
[Application]
I've extracted the barcode scanner handling stuff from one of the Symbol SDK
examples, and using their .Net classes, drive the scanning engine in my
application.
Basically the program has a main screen which allows you to perform
differing actions, all of which involved the scanner. Tapping a button
launches a new form, which initialises the scanner and asks the user for a
type of barcode to scan...
There are eight forms in all, each creating their own instance of the scan
engine on load and destroying it on closing. Each has an event handler that
is unique in handling the data that is scanned.
[Problem]
Every now and again, at completely random intervals, the scanner will just
stop working. Pressing the trigger button doesn't scan anything. If you exit
the form you're on and go into another one (reinitialising a new scanner
object instance) nothing happens. I've put debug log trace statements
everywhere that log the details to a file to make sure that only one scanner
object is in existence at anyone time, and that any errors are reported.
When the scanner goes wrong, the log file tells me the application was still
merrily destroying and creating the scanner object with no exceptions, and
all the reader object correctly created.
The work around I have is a restart button that quits the program, and
relaunches itself. The scanner will now work when going to a dialog.
Although it works, but it's not solving the problem.
Does anyone have any ideas, or has anyone come across this sort of thing
before?
Any help in how to debug this, or direction as to what the problem is would
be greatly appreciated! Tag: Turn off / on flight mode Tag: 33346
How to change the string "My company <app>"
Hi,
In the "Remove programs" list, I have noticed that the name of my
application is shown with "My Company" before the name of the app. The
question is: How can i remove / change this text??
I have heard about changing it in the assembly file, but i've done this, and
i get exactly the same result... Is a bug out there? Maybe i'm doing
something wrong??
Thanks in advance,
Maurice. Tag: Turn off / on flight mode Tag: 33342
Change the backcolor of certain rows in a datagrid
Hi Ng,
I'm looking around for a sample to change the backcolor of certain rows in a
datagrid. On http://www.dotnet247.com/247reference/msgs/43/218277.aspx I
found a link to "Alex Feinman's DataGridEvenOdd sample", but the link is
still broken.
It would be great if anyone did download this sample before and could post
it here in the newsgroup or send it to me via email.
Thanks - Stefan Tag: Turn off / on flight mode Tag: 33340
German special character and string.Replace() method
Hi,
I've noticed a problem with the string.Replace() and the
StringBuilder.Replace() methods.
I try to replace the german special character "ß" (sharp spoken "ss") in
order to mask the character with "ß" for showing it in the OpenNETCF's
HTMLViewer control. The problem is, that the Replace() method finds the "ß"
in each string containing "ss". When calling Replace("ß", "ß") the
first "s" of an "ss" sequence is replaced by "ß" resulting in
"ßs"! That behaviour is bad, because "ß" isn't the same as "ss".
Is there a way to influence this behaviour? Is there another way than to
scan the string manually?
Btw, other string and StringBuilder methods (like IndexOf()) also treat "ss"
as "ß" ...
Greetings, Christian Tag: Turn off / on flight mode Tag: 33339
How to handle SIP in PDA
Problem 1: I am getting some error "Error Message: Exception" while disable
the input panel in one form and opening another form.
In case if i enable Controlbox=true then i am not getting this error.
Problem 2: I navigate from one form to second form with key board enabled in
form one. In case i don't have the menu in form two second page input panel
is still getting visible and there is no way of closing it by the user.
problem: I have menu and want to disable input panel rather than
enabling/disable. How can i acheive this.
Thanks for any help on this. Tag: Turn off / on flight mode Tag: 33338
OpenNetCF files instalation
Greetings
I'm new to OpenNetCF and recently downoad it. I've downloaded the source
package and the binary package. Now, in your oppinion, what is the
package I should use? I know that the bin package is an msi, so the
installation is simple, but how do I install the source package? Where
must I place it? Any directory in particular or it can be place where I
want?
Hope anyone can help :)
Thanks
Lum Tag: Turn off / on flight mode Tag: 33337
Treeview bug : Select top visible item but itself?
Hi all,
I am struggling with an annoying problem. It's a little difficult to
describe, but I will try as simply as I can.
The issue is with a Treeview control, which has a two level structure, in my
cases, category and product. This issue is only visible when the tree is
expanded so that a vertical scroll bar is displayed, and the topmost visible
item is a product. I will try to draw this in text..
(top of treeview)
-Category 1
Product 1
Product 2
------------ (top of visible in screen)
Product 3 << Selects this when you expand/contract Category 2 (or 3)
Product 4
+Category 2
+Category 3
.. etc
------------ (bottom of visible in screen)
Note that Category 1 is exanded (off screen), but Category 2 (on screen), is
not. Also note that the Tree.SelectedNode has been set to Nothing in code.
Now, the bug happens when you expand Category 2. When you do this, it does
expands category 2 correctly, but then SELECTS Product 3! It also does this
when you contract Category 2 as well.
My theory is that a treeview likes having something selected. When the
category is exanded, it seems to re-select the screens topmost visible item.
This is strange to me, at the very least I would expect it to select the
thing you were expanding/contacting? I set the selection back to nothing so
that you can easily re-select the same product.
Has anyone else hit this problem? Found a work around?
Any and all help appreciated!!
Regards,
Saul
ps. If I have not explained this situation well, please ask for any
clarification. Tag: Turn off / on flight mode Tag: 33334
String Parsing Query
Hi,
A client is providing me with a CSV and one of the fields is
contactenated. It contains Suburb, State and Postcode in the one
field, but I need it separated. E.g. I'm being sent
Calamvale Qld 4116
To get the post code, I can just grab the right 4 digits but I'm not
sure how I can separate state and post code. I can't use spaces as if
I'm given the following
Mt Gravatt Qld 4122
then I'd end up with suburb of Mt, state of Gravatt. Is there any easy
way that I can parse this string that I'm being sent?
Thanks in advance for any assistance.
Kind Regards,
David. Tag: Turn off / on flight mode Tag: 33330
BreakPoints ignored
I am working with Visual Studio and the Pocket PC 2003 emulator and trying
to set a breakpoint in a class. But the breakpoint never stops the
execution. The build is set to debug.
I press F5 to debug - the application is built and deployed with no
problem - the app starts automatically on the emulator. I run the app but
the breakpoint never hits. If an exception occurs, the immediates window
and stack are available as they should be.
I set the breakpoint by clicking in the left margin and the red dot shows up
with the line highlighted. I can look at the properties of the breakpoint
and it looks fine - the hit count is 'break always' and the condition is
'none'. I have tried setting breakpoints all over the application in
various classes but none work. I have a message box on the line before the
breakpoint so I know the code is getting called.
Anything that would cause this? I've read through the docs and searched the
ng, but can't find anything.
-Dave Tag: Turn off / on flight mode Tag: 33323
Multiple threads in an app - HowTo
Hi!
In our current app we display a splash screen form(running on a separate
thread) while some data access operations take place. Once the operations are
finished, we display the main app form. This is working just fine.
Now, we are adding a functionality to see if a configurationsettings file on
the device has all the values we need before the app loads(even before the
splash screen). If a value doesn't exist, we display a form, get the
user-input, update the configuration file and then WANT to continue loading
the app.
This new form will only be displayed if some settings are missing. I am not
able to close this new form or kill the thread and continue loading the app.
How should I be resolving this issue? Any ideas/suggestions will help a lot.
Thanks and regards,
Kumar Tag: Turn off / on flight mode Tag: 33318
SQLCE Exception
I am using a sqlceCommandBuilder to update my
dataset back to my sqlce DB.
The dataset is updating correctly, but when I
issue the
da.update(ds)
command I get an exception that says:
A duplicate value cannnot be inserted into a unique index[,,,,,]
My select statement is
"SELECT dID, dName, rowguid FROM tblDepartment ORDER BY dName ASC"
These are all of the fields.
My command builder and update code is:
Dim myDepartmentCB As New SqlCeCommandBuilder(myDADept)
myDADept.Update(myDS.Tables("Department"))
My datatable is constructed as follows:
CREATE TABLE [tblDepartment] (
[dID] [int] IDENTITY (1, 1) NOT NULL ,
[dName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL ,
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT
[DF__tblDepart__rowgu__5812160E] DEFAULT (newid()),
CONSTRAINT [PK_tblDepartment] PRIMARY KEY CLUSTERED
(
[dID]
) ON [PRIMARY]
) ON [PRIMARY]
Does anyone have any ideas. Should I use my own generated insert,
update and delete commands? I appear to get nullreference exceptions
when I do that!
Many thanks,
Jason. Tag: Turn off / on flight mode Tag: 33311
Tab control...
Ok, I've taken my 10 breaths, but still ... on the tab control... I found
that you can't change the backcolor, bummer. But stuck with it anyway for
v1 of this project.
But now, can anyone explain why the tab order keeps changing on me? I've
gone into the tab collection property box, moved the tabs into the proper
order of my liking -- it appears to take - but the next thing I notice that
the tabs are back out of whack... in an odd order again.
What am "I" doing wrong - or is it another control not ready for prime time?
Thanks,
Mike Tag: Turn off / on flight mode Tag: 33309
View Designer ??
This new ide is killing me. Maybe its just the CF side of it, as I've not
used any non-cf components of vs.net yet....
First, is it just me, or is the Designer view a killer of system resources?
Sometimes I wait a full minute before the designer of my form refreshes
itself (that is, when coming back from Code View).
But to my main question ... I just installed VS.net onto a new machine
hoping to get better performance. But now, when I load the same project,
under the solution explorer, it shows all my project forms - but only one
has the icon noting that its actually a form!
Only on that one form can I actually go into the Designer View. The others,
I am only allowed to go into Code View.
Huh??????
Any suggestions would be appreciated
-Mike Tag: Turn off / on flight mode Tag: 33306
SQL server for CE 3.0
I saw the SQL Server for CE 3.0 at the PDC in LA, but haven't seen it since.
Does anyone know if there is a beta available soon, or when it will be
available?
Thore Berntsen Tag: Turn off / on flight mode Tag: 33304
Upcase'ing textbox input
What is the best way to upcase text box input?
I'm currently using the textchanged event as below - but there must be a
better way - especially since I have to do this for each text box on the
form. Could do it in code, on the database - but that could tick a user
off if they think they are entering something in Proper case, and the
backend changes it to all upcase without them knowing it. I'd like them to
'see' all caps getting entered into the system - and the system requiring
it. Is there a better way?
Private Sub txtIssueEmpl_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtIssueEmpl.TextChanged
Me.txtIssueEmpl.Text = UCase(Me.txtIssueEmpl.Text)
End Sub Tag: Turn off / on flight mode Tag: 33298
Application Icon - Displaying in tray, Changing in code
I am able to display a 16x16 icon in the tray as long as it is the
application icon.
I am coding in VB.NET for a Win CE 4.10 device.
1. Is there a way to change the application icon through code?
2. Is there an easier way than using OpenNetCF.Windows.Forms.NotifyIcon?
Thanks for any information Tag: Turn off / on flight mode Tag: 33293
ANN: WE-DIG Inaugral Meeting 9/1
Visit www.we-dig.org to register.
==========================================
WE-DIG / Seattle
Windows Embedded Developers Interest Group
September Meeting Agenda
Date: September 1, 2004
Location: Quinalt Room, Building 34, Microsoft Main Campus, Redmond, WA
Our Mission:
The Windows Embedded Developers' Interest Group is dedicated to the
exchange of ideas around Microsoft Windows embedded and mobile software
development.
========= MEETING AGENDA =========
6:30 Pre-Meeting Event: Author Book Signing
7:00 Meeting Starts
7:10 Panel: Windows CE 5.0 Team Members
8:00 Break
8:10 Whats News
8:25 Tool Time: Entrek Tools
8:30 Open Problem Solving Session
9:00 Drawing / Meeting Concludes
========= Pre-Meeting =========
We set aside a half-hour prior to the start of each meeting to provide
an opportunity for first-time attendees to register with WE-DIG, to talk
to the WE-DIG board, and for special events. The special event this
month is an author book signing. Refreshments served.
This is also the time to enter the drawing, which is held at the end of
the WE-DIG meeting. We have a lot of goodies that you can win. The
featured item is an iPaq H2210 Pocket PC, courtesy of the Microsoft
Mobile Device Division.
========= Author Book Signing =========
Before the formal meeting starts, we are going to have an author book
signing featuring the authors of two recently released .NET Compact
Framework books, Paul Yao & David Durant. They will be available to
answer your questions and sign your copies of their books (copies of
which are going to be on hand for sale).
========= Meeting Starts =========
The meeting starts at 7:00pm. At this inaugural WE-DIG meeting, you are
going to meet the members of the WE-DIG board, and learn about its
mission.
The MC is Paul Yao, a member of the WE-DIG board, and president of The
Paul Yao Company.
========= Panel Featuring Windows CE 5.0 Team Members=========
The latest version of Windows CE, version 5.0, shipped on July 9. Three
members of the Microsoft Windows CE 5.0 team have graciously agreed to
join us in a panel discussion:
o Jeana Jorgensen, Windows CE Product Manager
o Chip Schnarel, Group Program Manager, Windows CE
o Mark Miller, Architect, Windows CE
Audience participation is welcome, so come prepared to gain insights and
to ask your own questions about this latest version of Microsoft's
operating system for embedded and mobile software development.
The panel is to be moderated by Chris Muench, Strategic Relations
Manager at Siemens Automation, and a member of the WE-DIG board.
========= Whats News =========
During Whats News, you will hear late-breaking news about developments
in the world of research, technology, and business which promise to have
an impact on developers in the world of Microsoft Windows embedded and
mobile systems.
The Whats News segment is to be presented by Nick White, Microsoft
Corporation.
========= Tool Time =========
Building great embedded and mobile solutions requires great tools, and
so we dedicate a brief portion of each meeting to discuss tools - what
we call "Tool Time" (with apologies to Tim Allen). Tool Time provides a
chance for users to present reviews of development tools. Some Tool Time
segments may feature tool developers announcing new products, or
providing tips on using currently shipping products.
This month features Michael Salamone of Entrek (http://www.entrek.com),
to present insights into the various Windows CE-oriented development
tools from his company. Michal is a member of the WE-DIG board.
========= Open Problem Solving Session =========
A key benefit of community events like the WE-DIG meetings is the
opportunity to network with common interests. In addition to the
informal networking that inevitably takes place at this type of meeting,
the Open Problem Solving Session provides every attendee with the change
to describe real-world development problems or issues that they have,
and to get the perspective of ofther members. This is also the time of
the meeting when any attendee can announce job openings, or when anyone
looking for a job can let the group know that. Almost any public
announcement is allowed, subject only to the limitations of good taste,
the interests of the group, and the patience of the moderator.
The Open Problem Solving Session is moderated by Jon Fincher, Program
Manager for Windows XP Embedded, and member of the WE-DIG board.
========= Drawing =========
Just before the end of the meeting, we are going to have a drawing for
lots of valuable prizes, including:
* HP iPaq H2210 Pocket PC, courtesy of the Microsoft Mobile Device
Division
* Copies of books from the Addison Wesley .NET Developers Series
* And lots more...
--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com Tag: Turn off / on flight mode Tag: 33290
Add EventHandler at Runtime
I have a class library that is called from a form that adds controls to the
form at runtime. I am currently working on creating a PictureBox control at
runtime and am having problems trying to hook up code to the click event of
the PictureBox. The form will contain the code for the click event and I
need to add this event to the PictureBox control at runtime from the class
library.
myPictureBox.Click += new EventHandler(event_name);
I know I need to use Reflection; but there are many methods that have been
removed from the compactframework that I just can't figure out how to
accomplish what I need to do. Has anyone done this before?
Thanks,
Lisa Tag: Turn off / on flight mode Tag: 33286
SocketFlag.OutOfBand usage
Is the out-of-band socket option (urgent TCP packets) supported in
.NET CF?
Sending a message with the SocketFlag.OutOfBand Flag set results in a
SocketException (WSAEOPNOTSUPP #10045).
It works neither on the CE .NET Emulator (VS 2003) nor on my .NET 4.2
device.
I used the following code fragment:
IPHostEntry hostEntry=Dns.Resolve("host");
IPEndPoint endPoint=new IPEndPoint(hostEntry.AddressList[0], 5555);
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
s.Connect(endPoint);
s.Send(System.Text.Encoding.ASCII.GetBytes("socket stream
interrupted by "));
s.Send(new byte[] {0x01}, SocketFlags.OutOfBand);
s.Send(System.Text.Encoding.ASCII.GetBytes("urgent data"));
Did i miss anything? Any special SocketOptions or TCP settings?
My desktop version is working :-(
Thanks in advance & kind Regards,
Volker Tag: Turn off / on flight mode Tag: 33285
Writing to a text file formatted as XML
Hi!
In our app(C#) we have to make some configuration settings and for that I
have a text file that looks like this:
<configuration>
<appSettings>
<add key="db_server" value="someserver" />
<add key="db_database" value="somedatabase" />
</appSettings>
</configuration>
Now, I want to check if value for db_server is empty and if it is, I want to
write the value. I am trying to use XmlTextWriter and XmlTextReader but being
new to XML processing I don't know exactly how to do it.
I got a response from the xml group to use this:
//Asad Jawahar
/***********************
XmlDocument doc = new XmlDocument();
doc.Load("old.xml");
XmlNodeList list =
doc.SelectNodes("/configuration/appSettings/add[@value='']/@value");
foreach(XmlAttribute attr in list)
{
attr.Value = "test";
}
doc.Save("new.xml");
/************************
But compact framework doesnot seem to support doc.SelectNodes. Instead we
can use GetElementsByTagName but then I don't know what should go in there. I
tried:
node_list = xmlDoc.GetElementsByTagName("/configuration/appSettings/add
[@key='db_server'] [@value='']");
This did not help much.Can anyone help please?
Regards,
Kumar Tag: Turn off / on flight mode Tag: 33279
Application Idle
Hello All, I am trying to create a timer using the OpenNetCf to find out
when the application is on idle and have been having some problems. I have
found some example code using VB
(http://wiki.opennetcf.org/ow.asp?AppIdleTimer) however I am using C#. Here
is what my code looks like. Does anyone see what I am doing wrong?
using IMessageFilter = MyApp.AppIdleTimer;
CLASS:
public class AppIdleTimer
{
public delegate void TimeoutDelegate();
public event TimeoutDelegate AppTimeOut;
private System.Windows.Forms.Timer m_timer = new
System.Windows.Forms.Timer();
public void New(int TimeoutInterval)
{
m_timer.Tick +=new EventHandler(m_timer_Tick);
m_timer.Interval = TimeoutInterval;
m_timer.Enabled = true;
}
private void m_timer_Tick(object sender,EventArgs e)
{
AppTimeOut();
Application.DoEvents();
}
private void Dispose()
{
m_timer.Enabled = false;
}
OpenNETCF.Windows.Forms.IMessageFilter.PreFilterMessage
public void PreFilterMessage(ref Microsoft.WindowsCE.Forms.Message m)
{
switch(m.Msg.ToString())
{
case "&H200":
case "&H201":
case "&H202":
case "&H203":
case "&H204":
case "&H205":
case "&H206":
case "&H207":
case "&H208":
case "&H209":
case "&H100":
case "&H101":
case "&H102":
case "&H103":
case "&H104":
case "&H105":
case "&H106":
case "&H107":
case "&H108":
{
m_timer.Enabled = false;
m_timer.Enabled = true;
break;
}
}
}
}
INSIDE THE MAIN
AppIdleTimer appIdle = new AppIdleTimer();
appIdle.New(10000);
appIdle.AppTimeOut += new
MyApp.AppIdleTimer.TimeoutDelegate(appIdle_AppTimeOut);
*** Getting This Error
***The best overloaded method match for
'OpenNETCF.Windows.Forms.ApplicationEx.AddMessageFilter(OpenNETCF.Windows.Fo
rms.IMessageFilter)' has some invalid arguments
***Here
ApplicationEx.AddMessageFilter(appIdle);
ApplicationEx.Run();
private void appIdle_AppTimeOut()
{
MessageBox.Show("TimeOut");
} Tag: Turn off / on flight mode Tag: 33278
GPRS connection
I have a symbol device that has an inbuilt GPRS modem. I want to connect to
a webservice from the compact framework.
I dont want to have the connection settings entered on the device because it
will allow people to use this connection for things like explorer.
My current routes of exploration have been:
1. Use OpenNETCF.Net.ConnectionManager
But this I believe needs to have an entry in the connections to connect so
thats not valid for my design limitations.
2. Use OpenNETCF.IO.Serial
I believe that if i send the correct strings eg (AT+cddcont=1,"IP","blah"
then ATD*99#) down the modem then this will give me an IP address once it
connects. But i never seem to get any response but am I barking up the wrong
tree.
Any help would be appreciated.
James Tag: Turn off / on flight mode Tag: 33277
CF and dynamic properties
Hi,
Can I use dinamic properties for webservice in compact framework ?
I would like to use System.Configuration.AppSettingsReader class for
dynamic location of webserver with webservices, but I can't insert it in my
application for handheld.
Thanks.
Best regards ,
Amateur Tag: Turn off / on flight mode Tag: 33272
Button text problem.
Does anybody know how to make the text of a command button in a Pocket PC
VB.net app (.net compact framework) span multiple lines like what can be done
in a windows forms app command button?
Thanks. Tag: Turn off / on flight mode Tag: 33271
Anyone know how to turn flight mode off and on with Pocket PC 2003 Phone Edition?
I'm developing on an XDA-II / i-mate and prefer to use C#.