|
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 have been having trouble publishing my assembly to a server on the network. Sometimes it says:
Failed to copy file 'filename\setup.exe' to 'servername\setup.exe'. Unable to add 'setup.exe' to the Web. The file 'setup.exe' already exists in this Web.
When I try go to the actual file on the server, it says that the file cannot be modified as somebody has it in use. But nobody on the network is using it, and it only says it after I try to republish the build. Sometimes it doesn't complain at all, anybody know how to fix this?
|
|
|
|
|
So I want to write a .NET application to show and save video streams frmo an ip camera. But I'm having some troubles getting started. Should I look for an Axis camera so I'd be able to use their api (http://www.axis.com/techsup/cam_servers/dev/index.htm)
or will I be fine accessing the video stream using directshow or whatnot using any other camera :-s ?
|
|
|
|
|
I have a camera hooked up to an Axis 241Q. Axis has an SDK that is killer - can supply MJPEG, MPG4... There is also code to record the video coming from the IP camera. I have tweaked the code so my camera's IP is always in the textbox. I launch my program and get the viewer, then press a button I added to launch the recorder minimized.
Now, if I could just get the video to the web......
xlthim
|
|
|
|
|
I have been thinking of making a C# program that would make an image of a small area of the screen (through BitBlt in gdi32.dll), apply a transformation on it (like maybe negative the colors, or tinting brighter or darker), and then putting it in a (TopMost=true) form over the original area. I plan on updating by periodically hiding the form, retaking the image, and re-showing the form again. Up to now not too complicated. Here's where I can't figure out what to do: I would like to still be able to interact with any windows underneath the form as if the form wasn't there, at least for mouse clicks if not also keystrokes.
So basically, how would one go about making a Form "transparent" to clicks and/or keystrokes?
(I know the whole idea might seem impractical, and I doubt the performance would be that great, but it's an interesting idea that i've been itching to try out for a while now.)
Also, any suggestions/ideas/constructive criticisms are more than welcome, since I am over-extending my technological comfort zone on this project.
|
|
|
|
|
Lucky you! I wrote an article on doing just that. You can find it here[^] on CP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Wow, exactly what I was wondering about!
Thanks a lot man!
Up till now the only thing I had found that was relevant were these short directions:
"Assuming there are no controls on the form,
override the WndProc of the form, respond to the WM_NCHITTEST message and
return HTTRANSPARENT."
Which needless to say was pretty much greek to me.
Your article on the other hand is neat, clear, and easy to understand.
Thanks again! ^_^
|
|
|
|
|
TheZeusJuice wrote: Your article on the other hand is neat, clear, and easy to understand.
Hey, Thanks!
TheZeusJuice wrote: Assuming there are no controls on the form,
override the WndProc of the form, respond to the WM_NCHITTEST message and
return HTTRANSPARENT."
This is just an alternate method of "punch a hole through your form", as far as the mouse is concerned.
What this means is that you're capturing the WM_MCHITTEST message comming from Windows. What it wants is for you to use the mouse coordinates, provided by Windows, and check those against your window to see if the mouse actually clicked on something in YOUR window. It's entirely up to you if the mouse did or, more importantly, didn't hit something on your form. If it did NOT hit something, you set a return code to the value of HTTRANSPARENT.
You can find the values of both of these constants somewhere in the *.H header files in the Platform SDK.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello!
Using VS.NET 2003, C++ .NET Form project. I'm beginner to .NET and Win
programming so even if my question is stupid please bear with it.
I'm having problems with starting a program minimized. In theory it's done
easily by setting the WindowState property of the main form to 'Minimized' in
the designer. But that's not all.
Take a very simple VS.NET 2003 C++ project of 1 Form and a few other
controls (say, 1 ContextMenu, 2 MenuItems, 1 NotifyIcon and 1 ICOn resource
file), NO manually added code. When run normally (not minimized), this takes
9-10M RAM (seen in Task Explorer, has ~8M working set in a more thorough
process explorer). A minimize reduces the RAM usage to ~1M. Another restore,
and it uses 2-3M again. Yet another minimize and a footprint of 0.8-0.9M is
reached. No, it doesn't go any further, unfortunately. And there's no
significant difference between a 'release' and a 'debug' build, both start
with huge footprints.
My problem is this: when starting the application minimized, it takes up
9-10M, until I restore/minimize it a few times. So starting it minimized
doesn't reduce the memory usage, but showing the window and minimizing it
afterwards does. Putting the 'WindowState=Minimized' command in the Load or
focus-related events in order to have it immediately minimized doesn't help
(application starts minimized, memory usage remains). Initiating garbage
collection is without effect.
Any ideas, how I could mimic the effects of a 'minimize' without having to
actually display the window? Is there any way to tell the framework
explicitly to drop unneeded memory regions?
|
|
|
|
|
|
Hi,
first of all: I don't have a direct answer to your question but:
What you see as memory consumption in the task manager shouldn't be too important for you. You are just seeing how much 'real' memory is currently consumed by your application. When minimizing windows normally just swaps memory away because it 'thinks' it won't be used anytime soon again. If your application keeps it memory on startup it doesn't make any difference because windows will do it the next time it needs physical memory. The performance difference shouldn't be noticable.
Also have a look at Task Manager/View/Select Columns and check Virtual Memory ( ihave a german windows thus the words might differ). You will see that this one doesn't change while minimzing/restoring.
|
|
|
|
|
Thank you both for your answers. They were really helpful, and I've learned yet again something new.
Although I completely undertand that trimming the working set leaves the virtual memory usage intact, I still think that forcing a trim is beneficial.
1. The application would run minimized nearly all the time so probably its working set is quite small compared to having all UI windows open.
2. Windows would do the same thing, if I minimized the application window manually, so where's the difference?
3. The working set can be increased if it has been trimmed too much, so the worst that can happen is some code would need to be reloaded from the page file. I can cope with that, this isn't a performance critical application.
There's one thing I cannot agree with in the article above: "Windows generally does a good job of memory management". This isn't what I see.
|
|
|
|
|
You're worrying about something that will actually have a negative effect on the performance of your app.
And YES, Windows and the .NET Framework does a great job at memory management.
What you're seeing is the CLR holding onto a chunk of memory so that future object allocations will be able to be serviced faster than if the CLR had to first go to Windows to get a block of memory, add it to the CLR's heap, then allocate for your object. Reducing the size of this managed pool will only make your app run a bit slower!
But, since according to you, performance is not an issue, why are you even worrying about this?? The CLR and Windows will make sure memory is available to whatever needs it, when it's needed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi everyone,
I'm trying to find some information and really just looking for a bit of direction on how to create a PPTP adapter through code, and how to invoke that adapter to connect to my PPTP server. I've found some information on doing this in Windows CE with C on MSDN, however I was more or less hoping to do this with Windows 2000/XP clients through .NET. Any information would be greatly appreciated.
Thanks
xibalba
|
|
|
|
|
Hi All,
I am a total novice in the field of .NET programming. With
.NET framework getting popular day by day and offering loads of new technologies, I want to start learning it.
But the problem is that I am confused regarding where to start from and what all to study to become comfortable in
.NET area.
Requesting you people to please guide me in this regards. Please let me know some good books or links about .NET fundamentals.
Thanks and Regards.
|
|
|
|
|
First of all, Id like to warn that I'm pretty biased in favor of C# over VB.Net. They both do the same things, but VB has always striken me as a way of keeping those with older skills happy if they don't want to move forward to a more modern Object-Oriented language (ie Java or C#). Anywho, religious affiliations aside, back to your question.
Maybe its because I already had a formal education in Java, which is very similar to C#, but I found that the best way to learn was to look at the source code for simple C# programs and try to understand them, modify them, etc. Also, just browsing around the Documentation that gets installed with the SDK helps alot too.
There's also a plethora of very useful links if you know [who to ask].
That said, I can't really recommend any one tutorial since I don't know what your previous programming experience has been. If you're starting from scratch, a pretty good beginners tutorial can be found [Here]. If you're already proficient in an Object-Oriented or other type of language, then [this might be more your speed]. Either way, you'd probably get the most benefit from looking over a couple of tutorials, since they would reinforce each other on the key points and make learning easier.
Also, I highly recommend getting an IDE. The main two free options for Windows are:
[Visual C# Express, one of Microsoft's free IDEs]
and
[SharpDevelop, an Open-Source IDE]
Which one to choose is also a religious debate. I've never used C# Express personally, but I've heard good things. I've used SharpDevelop, and been happy with it. Personally, I aquired a copy of Visual Studio.Net through my favorite P2P app and never looked back. Say what you want about Microsoft and Windows, but the developer tools team has my deepest respects.
Anywho, I wish you good luck on this endeavour. Keep in mind that you never actually learn how to program. What happens is that the amount of stuff you can do from memory increases as you read and write more and more code, and thus you find yourself looking up stuff online less and less. $Deity knows I still find myself looking up beginner tutorials every once in a while
|
|
|
|
|
Hi,
Thankyou for giving me pointers. I'll start with the resources you have pointed out. As far as my programming experience goes, I have a pretty good experience in C++ programming with bit of templates and STL and also quite comfortable with core java.
So I think learning C# should not be a problem. Just one more question
Where does managed C++ fits into DotNET environment. And like you I am also bit more biased towards C#
Regards.
|
|
|
|
|
well, [This] [Set of] [Articles] seem like a pretty good resource.
I actually don't have much personal experience with managed C++, but from what I've heard you basically just take C++ code and compile it with the .Net compiler. To me it mainly seems to be for performance critial stuff.
Personally I don't see much need for it since you could just import c++ dll's into .Net apps anyway.
However, using managed c++ does mean that your entire app would be in CIL (Common Intermediate Language, it's what .Net apps get compiled into), and thus it would be runnable in any .Net runtime (ie [Mono] on a macintosh).
|
|
|
|
|
This is a useful summary for C++ developers.
http://msdn.microsoft.com/msdnmag/issues/01/07/ctocsharp/[^]
Also Jesse Liberty's Programming C# book (now in 4th edition for C# 2.0) is excellent for quickly getting up to speed with the language and touching a bit on all the technologies. (He has a separate book specialising on ASP.NET.)
psychedelic_fur wrote: I have a pretty good experience in C++ programming with bit of templates and STL
You'll like .NET 2.0 generics and the STL-like PowerCollections library then.
psychedelic_fur wrote: Where does managed C++ fits into DotNET environment.
Good question! I've not used it but from what little I've read about it I think MS are positioning it as the "systems" language for .NET, analogously to the way that C/C++ is the systems language for Win 32. There are certain things you can do in MC++ (now C++/CLI) that you can't do in any other .NET language - rather like there are things you can do in C++ that you can't do in anything else. Whenever you have such scenarios I guess that's when you'll turn to C++/CLI
Kevin
|
|
|
|
|
|
hi,
i'm starting to learn .net framework to develop pocket pc based softwares...my ultimate goal is to code database softwares with sql ce. But i'm confused which program best for sql ce database? ......
shall i start with vb.net or c#.net? ....any idea's?
thanks..
Sunny
|
|
|
|
|
they are both as good.
Or any other .NET language is as good for that matter.
Choose the one you fancy the most...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Thanks a lot for your reply...well i heard from somewhere c#.net can't connect with sql ce.....not sure abt that...i researched on net and i found most of the tutorials are in vb.net........
Can any of you help me with some c#.net database tutorials? any links?
|
|
|
|
|
sunny747 wrote: well i heard from somewhere c#.net can't connect with sql ce
That's most definitely not true.
C# and VB.NET are almost interchangable. All you need to do is run whatever code sample you find through a VB.NET to C# translator to get a pretty good conversion of the code. You can use those few examples as a Rosetta Stone to figure out the language. You'll smack yourself when you see how easy it really is to convert between the two.
You can find a few online conversion utilities here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for the replies......one more question...
is microsoft windows mobile version 5 is refers as windows ce? ..i have seen many tutorials on windows CE so wondering whether it would work on my pocket pc or not....coz OS of my pocket pc is microsoft windows mobile version 5
thanks..
|
|
|
|
|