|
TabControl.SelectedTab = tabPage;
Ed
|
|
|
|
|
Hello all,
I am trying to create a Smart Mobile/GPS application using .Net 2003 framework. In addition for the GPS support I am using OpenNETCF SDK 1.4 library. I am having problems reading in data from the GPS . The following is my code snippet:
private void button1_Click(object sender, System.EventArgs e)
{
gps.BaudRate = OpenNETCF.IO.Serial.BaudRates.CBR_9600;
gps.ComPort = "COM1:";
textBox1.Text = gps.ToString() + "\n";
gps.GpsSentence += new OpenNETCF.IO.Serial.GPS.GPS.GpsSentenceEventHandler(gps_GpsSentence);
gps.GpsCommState += new OpenNETCF.IO.Serial.GPS.GPS.GpsCommStateEventHandler(gps_GpsCommState);
gps.Start();
}
private void gps_GpsSentence(object sender,GpsSentenceEventArgs e)
{
MessageBox.Show("calling");
textBox1.Text += "calling" ;
textBox1.Text += e.Sentence + " ";
}
private void gps_GpsCommState(object sender,GpsCommStateEventArgs e)
{
switch(e.State)
{
case OpenNETCF.IO.Serial.GPS.States.Running:
textBox1.Text += "GPS Started";
break;
case OpenNETCF.IO.Serial.GPS.States.Stopped:
textBox1.Text += "GPS Stop";
break;
}
}
When I run the code using a pocket PC emulator , the code fires gps_GpsCommState event (it always shows the message GPS started even when its not connected) , and more importantly it does not fire the gps_GpsSentence event ever. What is the problem?? Could anyone help me out with this. I would be greatly obliged. If you of any other way to read in data pls lemme know. Also let me know what is the problem with the code.
|
|
|
|
|
I was actually having the same problem a few days ago. I almost went with opennetcf, then found that vs 2005 has a 'serialport' control that will let you do this VERY easily. One thing I found was that on mine, the gps data is coming in through COM7 (an HP iPAQ). I'm not too familiar with that library, but another thing is that in all the examples I saw, you have to also set the stopbits to 1, paritybits to none, and databits(I think that's what it's called) to 8. Hope I've provided some help. If you get this up and working correctly please post back so that I can see what your solution is in case something screwy happens with vs2005 and I have to go back to using 2003 for this project.
My Music | My Pics | My Articles
BlackDice
|
|
|
|
|
Better also set Hardware Handshaking to false. Most every GPS serial port I've ever seen is a three wire interface and will not provide any CTS, RTS, DTR, DTS etc. handshaking to the com port.
Can't tell you how many times over the years hardware handshaking (which is often a default) has completely blocked my serial communications and put me in a tizzy.
Good luck on the rest of it
|
|
|
|
|
Hello!
In C++ we could declare a function like this:
BOOL CSomeClass::SomeFunction(BOOL bSomeParameter) const;
The 'const' meant that the function doesn't change any member variables in the class (CSomeClass). Is there an equivalent keyword in C#?
Thanks in advance and best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Nope - nothing on offer anything remotely like that, sorry.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I was thinking about the very same thing a few days back. Any idea *why* it was dropped in C# though?
Somebody told me it was dropped because C# doesn't separate the declaration (.h files) from the implementation (.cpp files), but it doesn't sound very convincing. After all, I might want an abstract class' subclasses to be able to use a parameter that is passed to a virtual method, but not modify it.
In fact, I found myself in that situation. I ended up re-designing the classes.
I'd be grateful if you can provide a convincing answer.
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|
|
C# contains very little const support, it's something I've been lobbying for, for some time. I think it's got to do with keeping things simple, something the C# team assure me they will continue to do, although I've presented the opinion that the language often times treats the programmer as an idiot.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Ahem, so it can't be done? No clever hacks? I'm starting to miss C++.
I want my class' subclasses to be unable to modify a parameter passed to a virtual method they derive from my class.
Will my subclasses be free to run amok?
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|
|
The problem is that in the C# treats const much more "seriously" than C++. In fact a problem common in C++ code is accidently casting away something const by shifting to a reference.
Look at the behavior of the keyword sealed. <code>sealed can protect a lot of things from having the inheritor from overriding, modifying, etc base class behavior.
|
|
|
|
|
Tom Larsen wrote: The problem is that in the C# treats const much more "seriously" than C++.
I'm still new to C#, but I don't understand the basis of your statement. Could you please explain in greater detail?
Tom Larsen wrote: sealed can protect a lot of things from having the inheritor from overriding, modifying, etc base class behavior.
Yes, but unfortunately my base method was abstract, so there's no question of sealing it.
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|
|
The C# compiler does not provide support for this construct which was dubious in C++ anyway.
|
|
|
|
|
Hello all. I have installed vs2005 (on a different machine) and opened up a 2003 C# project (pocket pc app). it gave me the message about having to convert the project and said it did it with no problem. However, I still only have access to the 1.1 framework .net classes. Even when I go to add references, it shows the references for 1.1.4xxx or something like that. How can I point my project to look at the 2.0 framework? Specifically, I need to use the serialPort control, and it's not available before 2.0. If I start a brand-new smartdevice app, the control is listed in there with no problem.
My Music | My Pics | My Articles
BlackDice
|
|
|
|
|
Hi.
I'm developing a small aplication that runs in the startbar (using band bars). The problem is that it wont render the background as the XP themed startbar background (when I ise clasic style, it shows fine, but when I use Luna or anything else, it shows as it did on the classic style). So basicly it is an ugly gray rectangel in the middle of my statbar.
My theory is that I need to get the bitmap of the taskbar from the current .msstyle theme, and use it as the background for the aplication. I've seen some superficial tutorials in how to do this, bu they are in C++ and VB, and, I'm embarased to say, I can't understand what they are doing.
Any help would be apreciated.
|
|
|
|
|
Basically, you will need to interop the themes calls in C#, www.pinvoke.net will show you how. Then, you actually ask the themes API to draw the background, it does the drawing, it does not return a bitmap.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I'm sorry if this is too easy
I want to format a double value in the format of 0.##########E##.
I need that the value start with a 0, with the exponent properly adjusted.
For example, the value 405 should be formatted as 0.405000000000000000E+03 .
If I use {0:0.000000000000000000E00} the value shows up as 4.050000000000000000E+02 .
Any way to do this?
Thanks
|
|
|
|
|
I have a database app, i don't use multiple threads in the application; i just use one database connection open for the app life time and close it at the end. One thing i notice is then longer the app is active executing i see Threads exiting in the out put window, i dispose every SqlCommand & SqlDataAdapter after using. I wonder from where these threads are comin from ???
|
|
|
|
|
Hi,
How do do I animate the movement of a simple shape (a ball) across the
client area? --thanks
|
|
|
|
|
Easiest way - an animated gif. Drawing it yourself, set a timer, and draw the frames in WM_PAINT.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am facing problem with my custom control. Please help urgently.
My control inherits a Windows.Forms.Panel control. I have set the AutoScroll property of the base control (panel) to true. I added a PictureBox in the at location (Left = 0, Top = 0) in the panel control. Size of the PictureBox is large enough to show the ScrollBars for the base control (panel).
In the Paint Event handler of the picture Box I am drawing a rectangle.
To scroll (make it visible completely in the Client area) to the drawn rectangle, I added a transparent Label control and set its bounds(location, size) as of drawn rectangle in runtime after drawing the rectangle and called the Panel's ScrollControlIntoView method.
Scrolling works, but when I change the location and size of the rectangle to draw it to another location, the rectangle intersects the client rectangle of my control (i.e. not visible completely in the client rectangle).
How can I avoid it?
How do I know if my rectangle is intersecting the client rectangle?
Or
How do I position my transparent label such that it is completely visible in the client rectangle?
Or
Suggest me any other way
Thank You,
Gulfraz Khan
|
|
|
|
|
how can i implement the zoom over a picturebox?
And over custom controls?
|
|
|
|
|
|
Hi I have a web application where a user downloads a file(eg word doc) from a db, makes changes on the file. My question is, how do I get the edited file reuploaded into the db. Filename left intact.
|
|
|
|
|
You need to provide a file browser control ( they need to browse to the file and select it, then click on a button to upload ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian. Thanks for your response. I'm talking about files that have previously been uploaded.
To clarify myself, the file is retrieved from the db, and written using the ffg line of code:
Response.Clear();
Response.ContentType = FILE_TYPE;
Response.OutputStream.Write(FILE_IMAGE,0,FILE_IMAGE.Length);
Response.AddHeader("Content-Disposition", "attachment;filename=" + FILE_NAME);
Response.End();
My question is, once the user makes changes to the displayed file, how do you reload the edited file into the db?
|
|
|
|