|
Buy a phone with caller ID ????
A craft is an enemy if not well learned.
|
|
|
|
|
Hi,
Search the internet for TAPI is the API that will have to work with
Hope that helped
Nassos
|
|
|
|
|
When does memory get disposed of in .NET? I have a function that updates folding areas on a text editor and wanted to know when the text editor control will be deleted.
void UpdateFolding()<br />
{<br />
try<br />
{<br />
if ((m_oTabControl.TabCount > 0) && (m_oZipFile != null))<br />
{<br />
TabPage l_oTabPage;<br />
l_oTabPage = m_oTabControl.TabPages[m_oTabControl.SelectedIndex];<br />
<br />
<br />
<br />
<br />
if ((l_oTabPage.Controls.Count > 0) && (l_oTabPage.Controls[0] is TextEditorControl))<br />
{<br />
TextEditorControl l_oTextEditor = null;<br />
l_oTextEditor = (TextEditorControl)l_oTabPage.Controls[0];<br />
l_oTextEditor.Document.FoldingManager.UpdateFoldings(String.Empty, null);<br />
TextArea textArea = l_oTextEditor.ActiveTextAreaControl.TextArea;<br />
textArea.Refresh(textArea.FoldMargin);<br />
l_oTabPage.Controls.Add(l_oTextEditor);<br />
} <br />
}<br />
<br />
}
|
|
|
|
|
RussBus wrote: When does memory get disposed of in .NET?
Whenever the Microsoft .NET garbage collection developers feel like it. If your lucky they documented how .NET garbage collection works. If your even luckier you may be able to find the documentation. If you are insanely lucky you might be able to understand it.
Good luck
|
|
|
|
|
led mike wrote: Whenever the Microsoft .NET garbage collection developers feel like it.
I was just about to say that
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
The text editor control will be deleted when the form it belongs to is deleted.
As the code that you posted doesn't have anything to do with that, I assume that you are talking about the reference that you declare in the method.
A reference is not the object itself, it's only a pointer to the object. Assigning the text editor control to the variable doesn't create a copy of the control, it only make the reference point to it. When the reference goes away, the object itself still remains.
Local variables in a method are allocated on the stack when the method is called. When you return from the method, the stack is returned to it's previous state, and the local variables are gone.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi all
i have implemented a small application in which a button is placed named addRow when user clicks tht button a row is added in a grid view,whever user clicks it row will be added to the existing gridview i have done this with the following code now the problem is when i refresh the page the row is added or when i click any server control the row is also added bt i dont want this i just want the row shud be added when the button name addRow is clicked only.
any help will be greatly appreciated.thanks in advance
Code: ( cpp )
1.
protected void Page_Load(object sender, EventArgs e)
2.
{
3.
if (!Page.IsPostBack)
4.
Session["dt"] = null;
5.
6.
}
7.
protected override void OnPreInit(EventArgs e)
8.
{
9.
base.OnPreInit(e);
10.
if (Request.Form["hf"] == "true")
11.
addGVRow();
12.
hf.Value = string.Empty;
13.
}
14.
15.
16.
private void addGVRow()
17.
{
18.
DataTable dt = (DataTable)Session["dt"];
19.
int counter = 0;
20.
if (dt == null)
21.
{
22.
dt = new DataTable();
23.
dt.Columns.Add("seq");
24.
}
25.
else
26.
counter = dt.Rows.Count;
27.
DataRow dr = dt.NewRow();
28.
dr[0] = counter + 1;
29.
dt.Rows.Add(dr);
30.
gv.DataSource = dt;
31.
gv.DataBind();
32.
Session["dt"] = dt;
33.
}
and on aspx page for the button
<asp:button id="btn" runat="server" text="Add" onclientclick="javascript:document.getElementById('hf').value='tr ue';return true;">
|
|
|
|
|
It's considered rude.
If you want to find out how post back in ASP.NET works try reading the freaking documentation!
Sorry for the outburst everyone but it's like the 15th time today I have seen this type of lazy garbage and on top of it this jerk reposts his question.
|
|
|
|
|
The best way to avoid postbacks is to not develop Web applications.
|
|
|
|
|
Well, it is guaranteed to work
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
very funny well i did post the coding i just not want to execute the code on every post back
any help will be highly appreciated
|
|
|
|
|
Hello I have coding experience in C++ in Visual Studio but not in C# besides basic hello world and I want to create something like this
http://img521.imageshack.us/my.php?image=gogulexl4.jpg
basically it is a embeded browser window inside another window the main window I should be able to use goole normally or any other site and automatically extract some search queries when I click on a button or something(to be thought of later on).
Thank you in advance
hello
|
|
|
|
|
If I understand what you are looking for, you should be able to create a basic windows form application and then use the web browser control to embed Internet Explorer into the application.
|
|
|
|
|
WebBrowser Control[^] is what you want.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
How do you go about documenting the implementation of an interface? Do you just copy the interface comment to your implementation? Skip documenting the implementation? Create a new unique comment for the implementation?
public interface IMyInterface
{
int GetSomething (int param1);
}
public class MyClass : IMyInterface
{
public int GetSomething (int param1);
{
}
}
I'm currently leaning towards reusing the interface comment and figured out how to have it auto-magically included in the implementation with the following code. NOTE: you'll need to make a post-build copy of your XML files and reference those otherwise you'll get a file in use error.
public class MyClass : IMyInterface
{
int GetSomething (int param1);
{
}
}
p.s. is there an easy way to paste code with special characters (< > &) so it automatically converts them to their encoded form?
-- modified at 16:36 Thursday 29th November, 2007
Todd Smith
|
|
|
|
|
That may depend on what the thing does, but probably start by copying the comment and maybe add detail.
public interface IDataSource
{
int GetSomething (int param1);
}
class DataBase : IDataSource
{
int GetSomething (int param1) ...
}
class WebService : IDataSource
{
int GetSomething (int param1) ...
}
|
|
|
|
|
Ok this should be simple.
I made a form, added a combobox (for selecting items to edit, not for updating fields), several textboxes, a few checkboxes etc. On formshow it connects to my database, draws down the existing data, no problem. All the records in the datatable that were the result of a query, I could select from, and the other databound components would display the records contents, no problem..... however.... when i add a new row, the combobox updates, but if i select the NEW item in it, all the databound objects are still pointing to the record to which I had selected prior, and if i make changes to their contents, it updates the fields associated with the priorily selected record, I can still select the original records and edit their contents just fine... but the NEW record's contents never display, and the record to which the databound objects are pointing, never change either... can someone please help before all my hair turns white ? LOL
the setup code that establishes databindings and populates the data table is as follows.
mySqlDataAdapter1.SelectCommand =
new MySql.Data.MySqlClient.MySqlCommand(
"SELECT *,CONCAT(ENTRY_NO,\":\", TYPENAME) AS DISPLAYVAL FROM FILEINFO.FILETYPE ORDER BY TYPENAME",
mySqlConnection1);
mySqlDataAdapter1.Fill(dataSet1);
ComboList = new DataTable();
ComboList = dataSet1.Tables[0];
comboBox1.DataSource = ComboList;
comboBox1.DisplayMember = "DISPLAYVAL";
comboBox1.ValueMember = "ENTRY_NO";
FILENAME.DataBindings.Clear();
FILENAME.DataBindings.Add("TEXT", ComboList, "TYPENAME");
DESCRIPTION.DataBindings.Clear();
DESCRIPTION.DataBindings.Add("TEXT", ComboList, "DESCRIPTION");
FILEEXT.DataBindings.Clear();
FILEEXT.DataBindings.Add("TEXT", ComboList, "EXTENSION");
RECLENGTH.DataBindings.Clear();
RECLENGTH.DataBindings.Add("TEXT", ComboList, "RECORDLENGTH");
RECLENGTH.CausesValidation = true;
ISRECDELIM.DataBindings.Clear();
ISRECDELIM.DataBindings.Add("CHECKED", ComboList, "IS_RECORD_DELIM");
ISFIELDDELIM.DataBindings.Clear();
ISFIELDDELIM.DataBindings.Add("CHECKED", ComboList, "IS_FIELD_DELIM");
ISFLATFILE.DataBindings.Clear();
ISFLATFILE.DataBindings.Add("CHECKED", ComboList, "IS_FLAT");
RECDELIM.DataBindings.Clear();
RECDELIM.DataBindings.Add("TEXT", ComboList, "RECORD_DELIM");
FIELDDELIM.DataBindings.Clear();
FIELDDELIM.DataBindings.Add("TEXT", ComboList, "FIELD_DELIM");
I have a button which is labeled new record, its click event handlers is as follows:
private void button3_Click(object sender, EventArgs e)
{
DataRow r = ComboList.NewRow();
r["ENTRY_NO"] = DBNull.Value;
r["TYPENAME"] = "NEW FILE TYPE";
r["DISPLAYVAL"] = "X: " + r["TYPENAME"].ToString();
ComboList.Rows.Add(r);
}
Code mapped to the datatables.oncolumnchanged event is as follows....
private void UpdateDisplayVal ( Object sender,
DataColumnChangeEventArgs e)
{
if (e.Column.ColumnName == "TYPENAME")
{
e.Row["DISPLAYVAL"] = e.Row["ENTRY_NO"].ToString() + ": " + e.Row["TYPENAME"].ToString();
}
}
The combobox updates with a value "X: NEW FILE TYPE", when i select a new item in it
none of the other bound objects update with the new value, as they do when i selected
the old item.
|
|
|
|
|
Meaning, it won't turn on. Says missing files, when ever file is there.
|
|
|
|
|
Hi,
you should make an effort to be specific.
The exact error message (or number), any extra information (maybe a stack traceback),
other symptoms, all these may help us help you.
Also an exact error message can be typed into Google and point to a solution.
If you're the author of a program that fails without being very specific at it, you should
improve your program by adding:
- checks for success after each system call
- displaying what goes wrong with all available detail
(e.g. GetLastError function)
Without additional information, no one will be able to help you except maybe by wild guessing.
PS: see my second tip below.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I ran into a different way of exiting an application (via the escape key) the other day...
<br />
protected override void KeyPress(object sender, KeyPressEventArgs e)<br />
{<br />
if ((int)(byte)e.KeyCode == (int)System.Windows.Forms.Keys.Escape)<br />
{ <br />
Application.Exit();<br />
}<br />
}<br />
What i'm wondering is what does the (byte) do?
The code works with or without it...
I took this code from a DirectX tutorial within the SDK, so I assume whoever wrote it knows what their doing.
Cheers,
Mark.
|
|
|
|
|
Hi Mark,
I'm using .NET 2.0 and KeyPressEventArgs does not have a KeyCode, but the KeyDown and
KeyUp events would offer it.
AFAIK KeyCode returns a Keys value, so you can compare directly, without casting.
The (byte) casting looks like an attempt to mask modifier keys such as SHIFT, ALT, CTRL
but I don't like the way it is done, and I am not sure it is relevant here either.
So I would try a simple if (e.KeyCode==Keys.Escape)...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi
I'm very new to C# and although I have managed to work through creating a simple method for arrays which holds the results of a query with just one return field
I now want to store the results of a query with many records of 15 or more fields and I don't know whether this should be in some kind of array or in a collection, in either case I don't know where to begin. Can anyone help in as simple terms as possible please?
regards
kenwen
|
|
|
|
|
kenwen wrote: Can anyone help in as simple terms as possible please?
That might be difficult, wait.... here try this[^]
|
|
|
|
|
That looks to be the kind of thing I want thanks
|
|
|
|
|
Ummm... wouldn't that be a System.Data.Datatable ?
|
|
|
|