|
Just because it's unused today doesn't mean it will be unused tomorrow.
|
|
|
|
|
ROTFL !! well said
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
No. It would be impossible to tell for sure - the member might be used in a different solution.
Things you make public/protected are generally things you have to support. I'd be mighty annoyed if MS started dropping public members from stuff I use because they don't use it in house
|
|
|
|
|
I am attempting to create an application which hooks input and output of a console application (usually cmd.exe) running in a Process object, and render the output in a custom fashion. So far it works great (Check out http://tom.net.nz/consolewrapper/ if you're curious ) but difficulties are arising with passing through commonly used console keystrokes, such as TAB or Ctrl-C. The streams happily handle basic strings of course, but don't like advanced keys so much.
The Process is started as such:
<br />
_process = new Process();<br />
_process.StartInfo.FileName = appName;<br />
_process.StartInfo.UseShellExecute = false;<br />
_process.StartInfo.RedirectStandardError = true;<br />
_process.StartInfo.RedirectStandardInput = true;<br />
_process.StartInfo.RedirectStandardOutput = true;<br />
_process.StartInfo.CreateNoWindow = true;<br />
<br />
_process.Start();<br />
<br />
_stderr = _process.StandardError;<br />
_stdout = _process.StandardOutput;<br />
_stdin = _process.StandardInput;
I have tried using SendKeys, but since the process has no window, it seems to send the keys directly back to my interface, causing a rather nasty feedback loop. There also seems to be no dice on passing keystrokes to a Stream.
I would really hate to have to re-invent the wheel on TAB completion etc! Any help or ideas appreciated!
|
|
|
|
|
I have created a class file and added a boolean value that's accessible for ALL the methods. The boolean is set to "bool IsLoggedIn;" when I execute the login method everything is fine and the bool gets set to true. when I execute method 2 the boolean is back to false!!
How can i retain the value in the boolean and use it over more than one method in that class?
Thanks!
Illegal Operation
|
|
|
|
|
Unless your setting the thing back to false, then i don't know whats going on. You do have something like this right:
class MyClass
{
private bool IsLoggedIn = false;
void Login()
{
IsLoggedIn = true;
}
...
}
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Illegal Operation wrote: How can i retain the value in the boolean and use it over more than one method in that class?
As a test, try making the variable, IsLoggedIn static (static bool IsLoggedIn ).
If it retains the value now, you are somehow creating multiple instance of that class. Each time you re-create that class, the value of IsLoggedIn will be initialized as false .
Did that make a difference?
Robert C. Cartaino
|
|
|
|
|
it's often better to use delegates than globals. But, as others have said, static is your problem here.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
We'd probably need to see the code.
|
|
|
|
|
Is this an ASP.Net app by any chance?
If so you need to read about the page lifecycle, as your class instance is different for every request.
|
|
|
|
|
The object of my program is to play tones through the speakers. I've seen programs that can generate .wav files and then play those, but I need to be able to raise/lower the pitch of the tone while it plays. Something like the Beep() function, but able to play through the speakers, rather than the pc's built in speaker. Note also that I plan to play two different tones through the left and right speakers, so I'll need some way of controlling this as well.
|
|
|
|
|
|
Yes, and unless you see something I'm not, that talks about writing a wav file and then playing it, which isn't what I wanted
|
|
|
|
|
It can create it in memory, not save it to disk.
But apparently it still has to finish writing it before it can play.
A couple of weeks ago I was looking for a way to play a tone for as long as the user presses a key, but no joy.
|
|
|
|
|
This probably won't help, but when i was doing some stuff on Linux a while ago I played some raw audio files, you did it by sending the data directly to the hardware (through drivers or whatever), so you would be able to construct a sample and send it to be played each frame (rather than getting the data from the file). So, basically what i'm saying is, you might need to get down and dirty because i don't think the .Net framework is going to help you much with this.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
That's what I was afraid of. I suppose I'll take a look into it.
|
|
|
|
|
And if you can get it to work, write an article.
|
|
|
|
|
Hi,
I am currently developing a toolstrip extension which will provide a feature to switch between several different icon sizes. I cannot assume that a provided Icon object will contain the required size, and so in such circumstances the next available size down must be enlarged at runtime. My only issue is in determining whether or not the Icon object contains the requested size.
The following pseudo-code demonstrates what I am trying to achieve:
public bool IconContainsSize(Icon icon, Size size)
{
foreach (subicon in icon)
if (subicon.Size == size)
return true;
return false;
} Once I have finished my extension I plan to upload an article here at CodeProject so that others can benefit from having a toolstrip which provides a facility to switch between the multiple button sizes provided within the programmer specified icon resources.
This is literally the only part of my solution that I am struggling with! I am sure that there must be a .NET approach to this.
Thanks,
Lea Hayes
|
|
|
|
|
Hi
I need to extract files embedded in an RTF file. when I load the file in a rich textbox, it shows the embedded files and opens with thier respective applications. But I cannot access/extract them programatically. Please help.
Thank you.
RYB
|
|
|
|
|
.NET doesn't include support for processing RTF files. You either need to search for a 3rd party library, or do it manually by reading the spec[^]
Simon
|
|
|
|
|
hi
after loading data into my dataTable object, i add new Identity Column to my dataTable for display Row Number, by this method :
private void InitIdentityColumn()
{
if (this.dt.Columns.Contains("rowID"))
{
this.dt.Columns.Remove("rowID");
}
DataColumn dc = new DataColumn("rowID");
this.dt.Columns.Add(dc);
int i = 0;
foreach (DataRow row in this.dt.Rows)
{
i += 1;
row["rowID"] = i;
}
}
but when i want to add row by this code :
FrmCategory frm = new FrmCategory(false, false);
DsStack.CategoriesRow newRow = this.dt.NewCategoriesRow();
Session.SaveInSession("newCategory", newRow);
if (frm.ShowDialog() == DialogResult.OK)
{
newRow = Session.LoadFromSession("newCategory") as DsStack.CategoriesRow;
this.dt.Rows.Add(newRow);
this.adapter.Update(this.dt);
}
the following error has shown me :
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records
but when i don't use InitIdentityColumn method, it was works good, my problem is that how to use InitIdentityColumn and prevent to occure this error, or how to create Identity Column by another way ? (without Row_Number() in sql server)
thanks.
|
|
|
|
|
Can I get some information on connecting to a AS400 database, a sample code snippet would also do.
Thanks
|
|
|
|
|
If it has an ODBC data source, just use the standard ADO.NET classes. If it doesn't, you may not be able to.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks man.............I got the connection..........!!!
Thanks
|
|
|
|
|
Is there a way to display the current contents of a panel on a second panel? My hope is to have an image displaying on a small size panel and when clicked, it will also be displayed on a much larger panel.
|
|
|
|