|
Thanks for the quick respone. I guess I will be coming up with a different idea, rather than the system tray. I tell you, I love this site!
Bowlermonk
|
|
|
|
|
Quite possibly the best System Tray Clock replacement on the planet -> http://www.drive-software.com/[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello all,
I am trying to create a video capture app using the windows media encoder9 sdk in visual studio 2003 .net a windows form project. using c++
and don't understand why this function call
CoCreateInstance(CLSID_WMEncoder,NULL,CLSCTX_INPROC_SERVER,IID_IWMEncoder2,(void**)&g_pEncoder);
will work perfectly fine in button1_click function (ie the g_pEncoder gets a value) but if I call the same function in the thread "mainloop" g_pEncoder comes back as not defined.
I have illiminated a lot of code ie: defines, includes etc. to save space.
Thanks for your time.
IWMEncoder2* g_pEncoder; //Global Variable
namespace TestingMyService
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private:
System::ComponentModel::Container * components;
void InitializeComponent(void)
{
}
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
CoCreateInstance(CLSID_WMEncoder,NULL,CLSCTX_INPROC_SERVER,IID_IWMEncoder2,(void**)&g_pEncoder);
Threading::ThreadStart* threadstart = new Threading::ThreadStart(this,mainloop);
servicethread = new Threading::Thread(threadstart);
servicethread->Start();
}
public: static void mainloop(void)
{
CoCreateInstance(CLSID_WMEncoder,NULL,CLSCTX_INPROC_SERVER,IID_IWMEncoder2,(void**)&g_pEncoder);
}
|
|
|
|
|
Heyas all,
Is it possible, using the .NET framework, to programmatically determine if there is text in a textbox control or not. Say just a simple Bool value or something similiar. Basically I'm trying to build a query string dependant on what textboxes have text in them, if a textbox has text then include that text in the query if not, ignore completely. Is this possible or should I be going a completely different route?
Thanks,
John
|
|
|
|
|
Whatever textbox control you are talking about (web, windows or mobile), it has a Text property that you can use to get the text in the textbox. Simply check if the length of the string is zero or not.
---
b { font-weight: normal; }
|
|
|
|
|
That would work perfectly, thanks a lot guffa
Thanks,
John
|
|
|
|
|
Or simply check that the TextLength property is greater than zero.
--
I've killed again, haven't I?
|
|
|
|
|
TextBox1.Text.Equals("") may solve it
or use TextBox1.Text.Length
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hello,
I am developing an application controlling various devices using a COM, dll or library.
The application is unique and must support any type of device. It is therefore built with all the dlls, COMs / interops that may be used.
However, only the dll, COM, library corresponding to the available device is installed when the product is deployed.
How can I prevent getting an error when the application starts because the unused dlls, (COMs + interops) or assemblies are missing, and then make sure I do not call them later on?
Thanks in advance for your help.
Michel
|
|
|
|
|
hi,
i have just downloaded sql ce from the microsoft website..but after installing it isn't working..nothing happens on my desktop let alone ppc. so is it required to have sql server for desktop b4 using sql ce? ..is there any tutorial on how to install or code that?
thanks..
|
|
|
|
|
SQL Server CE is an in-process database engine more like Microsoft Access than a standalone database server like the desktop SQL Server. Nothing much happens on your device until you deploy or debug your application, when Visual Studio will copy the device runtime components to the device.
I don't recall having to download anything separately from Microsoft before using SQL Server CE with VS.NET 2003. From what I recall the appropriate bits are installed when you install Smart Device support.
To create a new database, create a new instance of the SqlCeEngine class and call the CreateDatabase method. Don't forget to Dispose the SqlCeEngine object when you're done. You'll generally create your tables using SQL DDL statements; for this you'll need a SqlCeConnection , a SqlCeCommand , and use the ExecuteNonQuery method. Again, these objects need to be Disposed when you're finished using them. A using block (in C# and VB 2005) is very useful in ensuring you clean up properly since it automatically calls Dispose for you.
Programming for data access with SQL Server CE is very much like programming for the desktop - you simply use SqlCeConnection where you would use SqlConnection , etc. The SqlConnection class in Compact Framework is used for remote access to a SQL Server 2000 server, if you want to do that.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
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
|
|
|
|
|