|
I'm sorry, I don't understand the question at all. A stack or queue is probably implimented as a list, but you can think of it as an array which limits which items you can access at any time. There is tons of info around on container types, I have an O'Reilly book called Algorithms in C ( or something like that ) which is great for learning about this stuff.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Try this link: An Extensive Examination of Data Structures (including stacks and queues)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/datastructures_guide.asp
Osama E. Adly
|
|
|
|
|
Thanks , a very good one
BiGjOe
Passez Ce Qu'il Passe
|
|
|
|
|
Hi,
To be able to playback Wav MemoryStreams from a console I have to call this function
ApplicationDevice = new Device();
ApplicationDevice.SetCooperativeLevel(NEED_POINTER_TO_CONSOLE, CooperativeLevel.Normal);
I have tried calling
[DllImport("kernel32")]
static extern IntPtr GetConsoleWindow();
to get the a pointer to the console, but it doesn't work.
The CTOR takes either a Control like a Form or a IntPtr. Please help me.
TIA
------------------
I'm naked under my clothes...
-- modified at 19:10 Saturday 20th May, 2006
|
|
|
|
|
I have TreeList. This TreeList have TLNode(TreeListNode).
To set value i use public override void SetValue(object columnID, object val).
But it don't call. How to set this value?
public class TLNode : TreeListNode
{
String Title;
String Url;
public TLNode(int id, TreeListNodes owner, String title, String url) : base(id, owner)
{
Title = title;
Url = url;
}
public override string GetDisplayText(object columnID)
{
return Title;
}
public override void SetValue(object columnID, object val)
{
DevExpress.XtraTreeList.Columns.TreeListColumn id = (DevExpress.XtraTreeList.Columns.TreeListColumn)columnID;
switch (id.AbsoluteIndex)
{
case 0:
val = Title;
break;
}
}
public override object GetValue(object columnID)
{
DevExpress.XtraTreeList.Columns.TreeListColumn id = (DevExpress.XtraTreeList.Columns.TreeListColumn)columnID;
switch (id.AbsoluteIndex)
{
case 0:
return Title;
default:
return "";
}
}
}
SetValue have stop point and debuger don't go in this metod after end edit string in TreeList.
|
|
|
|
|
Hi,
I want to write "Hello World" using Notepad and then create the HelloWorld.exe using
the >csc HelloWorld.cs (from the command prompt). "Inside C# -- Chapter 1".
1. How should I save the file with Notepad? *.txt? *.cs? "all files"?
2. I'm almost certain that I have set the environment variables for the Framework SDK
correctly.
3. I have installed on my machine VS.NET 2003.
4. The file is located on the desktop. I can use the command prompt to open any file on the desktop. HelloWorld.txt will open. HelloWorld.cs will not open (although it will create a file as a ".cs" icon) and any "csc" command will not be recognized.
Any help would be greatly appreciated. Go easy on me -- I'm just trying to learn the basics -- thanks
|
|
|
|
|
Hi!
1. It doesn't matter. You just have to look at the filename your source file gets - when you save it with "*.txt" as filter, Notepad automatically adds ".txt" to the filename. So if you save your source file as "HelloWorld.cs", you'll end up with a file "HelloWorld.cs.txt".
But for compiling the final filename really doesn't matter.
2. If you did, "csc.exe" will be found. If you didn't, it won't be found. Simple as that.
3. Then you'll have a VS.NET 2003 command prompt in your start menu. Use this to get the console window, then the correct paths will be set.
4. Putting source files on the desktop usually isn't such a good idea. Create yourself a dedicated source directory (C:\Sources, for example). This is far easier to reach, especially if you're using a command prompt.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi! I'm pretty new to C#, but, i wanna learn...
I have a question... i have a datagridview binded to a database, but i wanted to add also a delete column to erase that row. The problem is i can't find an event to trigger when i push the delete button. this would be the first part of the problem. the second problem is how do i know which row to delete when the button of one raw is pressed?(i would be regardful if u gave me some code examples, too).
|
|
|
|
|
Hi,
First of all, are you using asp.net or windows? If it is windows you can use the code below:
private void dataGrid1_Click(object sender, System.EventArgs e)
{
DataTable dt = dataGrid1.DataSource as DataTable;
if(dt!=null)
{
string firstField = (dt.Rows[dataGrid1.CurrentRowIndex][0].ToString());
}
}
As you can see, what I'm doing is casting the datasource datagrid's property to a datatable object. Then using the CurrentRowIndex property I can obtain any field's values from the datatable.
If it is an asp.net application, then you can use the code below:
private void DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if(e.CommandName=="Select")
{
string id = e.Item.Cells[1].Text;
Response.Write(id);
}
}
In this case, I'm assuming the ID of the row is presented in the second column (since the first one is the SELECT link).
I created a tutorial about GridView control (asp.net 2.0) at www.KYNOU.com. I'm always in this website's chat room. If you want to chat with me live logon to it.
I hope I helped
|
|
|
|
|
I feel really dumb asking this question, but I have spent about 5 hours searching for the answer to this, and have had little to no luck.
I am a completely newb coder to anything other than perl, so please take pity
Basically I want to have a form with 2 text boxes and a button. (Got that part down :P)
Text box 1 is for the user to enter an IP address (Got that part too)
User clicks the button, and I need to run a "system"/"cmd"/"dos" command like so "nbtstat -A " + textbox1.text
then I need to read the results, parse out the MAC address make it show as textbox2.text
Any help would be awsome! Thanks!
|
|
|
|
|
If you want to wait for the process to stop before continuing the thread or forward stdio:
System.Diagnostics.Process p = new Process();
p.StartInfo = new System.Diagnostics.ProcessStartInfo("command", "arguments");
p.Start();
p.WaitForExit();
If you want to just start the process and move on:
System.Diagnostics.Process.Start("command", "arguments");
|
|
|
|
|
Process.Start() and its overloads are the way to create a new process. Which is exactly what you're doing with nbtstat -A. You can do something like:
Process.Start("nbtstat -A " + textBox1.Text);
The problem is, of course, getting the output from that. You won't be able to do it. So what you want to do instead is create a process like so:
Process proc = new Process(); proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.FileName = "nbtstat"; proc.StartInfo.Arguments = "-A " + textBox1.Text;
That tells the Process class that you want to redirect stdout so that it doesn't go to the console. After you do that, you can do this:
string output = proc.StandardOutput.ReadToEnd(); proc.WaitForExit(); textBox2.Text = output;
The docs mention that you have to call ReadToEnd() on the output stream before you call WaitForExit() because a deadlock condition could occur the other way 'round.And finally, put the output in textBox2. Just make sure textBox2 is a multiline textbox.
Once you wanted revolution
Now you're the institution
How's it feel to be the man?
|
|
|
|
|
THANK YOU!!!!
|
|
|
|
|
Ok I finally Got this to work
Here is the code I used:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Process p = new Process();
StreamWriter sw;
StreamReader sr;
StreamReader err;
ProcessStartInfo psI = new ProcessStartInfo("cmd");
psI.UseShellExecute = false;
psI.RedirectStandardInput = true;
psI.RedirectStandardOutput = true;
psI.RedirectStandardError = true;
psI.CreateNoWindow = true;
p.StartInfo = psI;
p.Start();
sw = p.StandardInput;
sr = p.StandardOutput;
err = p.StandardError;
sw.AutoFlush = true;
sw.WriteLine("nbtstat -A " +textBox1.Text);
sw.Close();
textBox2.Text = sr.ReadToEnd();
textBox2.Text += err.ReadToEnd();
|
|
|
|
|
|
Click the view details button, and show us some of that
|
|
|
|
|
Maybe the query didn't return anything.
Or try using a DataTable instead of a DataSet.
|
|
|
|
|
|
Hi
How can i get the dimensions (height/width) of a dc from PaintEventArgs.Graphics?
cheers
|
|
|
|
|
Graphics.ClipBounds or PaintEventArgs.ClipRectangle
|
|
|
|
|
does anyone know how to use a scanner with a adf using twain or isis? i also woundering if i could scan using my software not the software that came with the scanner because right now when i use twain from my program it opens the software that came with the scanner to control the scanning process i want to be able to do that with my program
Thanks,
Chad Aiena
|
|
|
|
|
Hi,
Use interop to access the twain com object for this purpose:
[DllImport("twain_32.dll", EntryPoint="#1")]
If you want me to create a tutorial walking you through the process of using this technique, please send me a note through the website: www.KYNOU.com
I hoped I helped
|
|
|
|
|
Does anyone know if there exists a decent API that allows wrapping of the most common GUI APIs?
I'm not very comfortable with WinForms, but I can't switch to WPF yet. I'm considering writing my own widget system, or using wx.NET, but either way I'd like to keep as much of my code as possible - regardless of the underlying API.
The wrapper should have functionality for analyzing a WinForms designer.cs file and creating a common format XML file from it (preferrably XAML-oriented).
|
|
|
|
|
|
You mean as an intermediate description format? Yes, MyXAML would probably work. But I hope to find a wrapper that can act as a proxy API for (the most common features of) any GUI system.
I.e., when I create a ProxyAPI.Button, a button from the selected provider API will be created (be it WinForms, wx.NET, CEGUI, WPF or whatever).
|
|
|
|