|
Hi all,
I'd like to make it possible to store and retrieve the bounds of all of the windows in my mdi window so that the program "remembers" where the user opened a certain window when the program ran last.
To do this, I created a base class which stores the bounds of each window. My problem is this: How can I hook up the right windows to this data? Since some windows are created dynamically and can be instantiated multiple time I need some kind of unique ID for each instance (the window name will not do since this is constructed dynamically). Can I use the window handle for this? Do any of you have a suggestion that might help in this?
All help is greatly appreciated, thanks in advance...
|
|
|
|
|
You can't use the window handle because this is allocated a new one each time you open a window. You could always use the Tag property to store a unique name.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How about the name of the class deriving from <code>Form</code>. Combined with the namespace name, surely it should be unique within your application?
|
|
|
|
|
Actually it wouldn't, since multiple instances of the same class can be opened at once. Thanks for the suggestion though.
|
|
|
|
|
Hi together,
first of all I'm sorry to post this question here but I wasn't sure where else to post it.
I'm trying to write a programm in order to track people walking past a webcam. What I actually need is their position infront of the camera.
I have tried several things until now. Using different software. MAX/MSP, Java, and OpenCV/C++ which seems to be the best thing. I'm also working on EyesWeb which also uses OpenCV. I need to transfer the data I get to Flash. EyesWeb does that via OSC.
But I'm still not sure which language to use or which language will have the best performance.
Now I found some articles about tracking in C#. Does that work good?
Sorry I'm new with programming in C/C++/C# I'm used to programming in Java.
So I'm still not sure if OpenCV and C++ is the best thing.
In EyesWeb I tried to use Background Subtraction in order to get silhouettes of the people walking by. The problem is that the webcam has too much noise and the programm analyzes motion in parts where there is none.
Afterwards I wanted to use blob extraction to get the position of the people. The second problem was that sometimes a color has the same gray value as the background and then there's no differnce in that part
Then I heard about block matching which might be better, but I'm not sure. Is this the right algorithms for my project?
Does anyone have experience with this kind of tracking?
Hope you can help or have some hints
-- modified at 9:46 Monday 30th October, 2006
|
|
|
|
|
Don't know if you have seen this in CP?
Motion Detection[^]
The author has a couple of articles dealing with motion tracking etc.
I still remember having to write your own code in FORTRAN rather than be a cut and paste merchant being pampered by colour coded Intellisense - ahh proper programming - those were the days
|
|
|
|
|
Yes thank you,
I have already seen this article and it's very interesting.
That's what got me to think about using C#.
But I'm still not sure what to use.
I heard that using C++ runs a lot faster then C#
|
|
|
|
|
|
Hello everyone,
I have a problem with my Settings
I want to save my connection string in the Settings.
I initialize a form and fill the textbox:
<br />
Settings.settings = Settings.Default;<br />
tb_ConnectionString.Text = settings.ConnectionString;<br />
I can change the string in the gui:
<br />
settings.ConnectionString = tb_ConnectionString.Text;<br />
Now, everything is fine. For testing I changed the connection string in the gui and this changed string appears in the settings.
I changed the connection string in Visual Studio back to the correct string.
This string appears in the settings, in the Settings.Designer.cs as the default value and of cause in the App.config
Now I start the project again an while initializing:
<br />
Settings.settings = Settings.Default;<br />
tb_ConnectionString.Text = settings.ConnectionString;<br />
setting.ConnectionString is wrong. It is the old/changed string
I removed the setting key, recompiled, added again the connection key to the settings but again the old connection string.
I searched for old string in my project but found nothing.
Restart of Visual Studio...again th old connection string.
How does VS get the old connection string and how can I avoid that?
Thanks for help.
KCT
|
|
|
|
|
I believe the config file is in your application settings folder, not your build folder.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I found the problem...the feature
It is a user config and there was an old one in the application directory of the user profile.
Thank you for your help
|
|
|
|
|
Can I get my C# code to recognise that the user has UNSELECTED an item in a list box so I can the do something with the Index.
My code is handling the SELECTING of an item correctly and adding the selection to a database table.
If they then unselected the same item how could I detect this and delete the selection off the database.
Is there an UNSELECTION_INDEX_CHANGED type event handler?
Thanks in advance
|
|
|
|
|
Hi,
there isn't such an event. As the SelectedIndexChanged event is also fired when something is getting unselected (as far as I know) you could always compare which indices are newly selected or unselected.
Robert
|
|
|
|
|
there is nothing to check for 'unselected'. you will have to use 'selectedindexchanged' and will have to keep track of the previous indices. you can do so by temporarily storing their values in variables.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
i want to implement cache mechanism in C#
as i have to access data from the database each time i would like to implement cachememory to store all the data into it once after that i want to access from it.
But i don't know how that can be implemnted in C#
please help...
|
|
|
|
|
|
Hi,
I have made a setup project in VS2005. It has some pre-requisites. When i compile it in Release mode, it generates a folder for each of its pre-requisite. What i want to do is to package all the files,folders and other things in a single file which the user could click to start installation. Is there any way to do it in VS2005? If not, can you suggest some third party software for this purpose?
Sorry, A little piece is left that is how to pass command line options to the EXEs of the pre-requisites those are generated when the setup project is build in the release mode.
Accept my advance thanks for your help, suggestion or even just comments...
Wasif Ehsan.
-- modified at 7:32 Monday 30th October, 2006
|
|
|
|
|
|
Hello everyone,
I am working in C#.NET environment.
In project some swf files has been displayed to only logged in users , and this swf files displayed by the coding.
But in testing face my testing team informed me that they are able to access those swf files without logged in. When I asked them about the process. Then they told me that First they read my source code from the browsers view source page. After reading the source they got the full path of swf files.
They simply copy that path and past on to the browser. And really I follow this step and able to see that swf files.
For protect this swf files I gone through all the settings of my site. And remove the read permission to swf files folder. And tested I got success now without logged in users are not able to view those swf files but when user logged into the site and request to view those swf files then that users is not able to view the swf files.
Now please tell me that I can denied those users to see my swf files who are not logged in.
Thanks.
Kunal Sagwaria
|
|
|
|
|
Hello everyone,
I am working in C#.NET environment.
In project some swf files has been displayed to only logged in users , and this swf files displayed by the coding.
But in testing face my testing team informed me that they are able to access those swf files without logged in. When I asked them about the process. Then they told me that First they read my source code from the browsers view source page. After reading the source they got the full path of swf files.
They simply copy that path and past on to the browser. And really I follow this step and able to see that swf files.
For protect this swf files I gone through all the settings of my site. And remove the read permission to swf files folder. And tested I got success now without logged in users are not able to view those swf files but when user logged into the site and request to view those swf files then that users is not able to view the swf files.
Now please tell me that I can denied those users to see my swf files who are not logged in.
Thanks.
Kunal Sagwaria
|
|
|
|
|
Hi,
I have a user control containing a toolstrip. I then want to derive this control. Is it possible to set the toolstrip so that I can modify it's buttons in design time in the derived user control?
Thank you
|
|
|
|
|
Hi,
The whole code works fine.
Except, when i decalared the instance of type ns1 within mystruct, the error "cannot have instance field initializers in structs" is produced. What is the reason benind this? Why we can not create instance fields in structs? while we can do that in classes.
And also, i didn't understand the term "instance field initializers".
public struct mystruct
{
public void display()
{
System.Console.WriteLine("My main Sturct");
}
public struct ns1
{
public void show(int n)
{
System.Console.WriteLine("nested struct 1: Call# " + n);
}
}
<code>
}
its used as follows:
mystruct ms = new mystruct();
ms.display();
mystruct.ns1 a = new mystruct.ns1();
a.show(1);
mystruct.ns1[] b = new mystruct.ns1[2];
b[0].show(2);
b[1].show(3);
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
First of all, the field initializer is the bit that states "= new ns1[2];". This is not allowed because structs are value types.
You could use a constructor though (but not a parameterless constructor - structs don't support them):
public struct mystruct { <br />
public mystruct(int amount)<br />
{<br />
stary = new ns1[amount];<br />
}<br />
public void display() <br />
{<br />
System.Console.WriteLine("My main Sturct"); <br />
} <br />
public struct ns1
{ <br />
public void show(int n) <br />
{ <br />
System.Console.WriteLine("nested struct 1: Call# " + n); <br />
} <br />
}
public ns1[] stary;<br />
}
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Millions of Thanks
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
its all good the only thing that i did not get is the parameter amount from where it gets the value as the declaration
public ns1[] stray
does not sending any value.
|
|
|
|