|
Ok
but I couldn't find your public email
so try this one http://hjk.4shared.com/
and if did not work give me your Email address
best regards
|
|
|
|
|
I downloaded the source code for Paint.Net. In the History functions Rick Brewster commented that when saving the state of an object, you should store by value rather than reference. Here's a quote:
"...history actions should store large objects and their locations
'by value,' and not 'by reference.'
He advocates to store the index of the collection in which the object resides. Can somebody explain to me what the technical no-no is about storing the reference to an object? I thought an object reference was a int GUID. Kind of a pointer to the place in memory.
Thanks for the help!
may your code be error free
|
|
|
|
|
Hi,
when keeping a time line for an object it would not make any sense to store the
reference at each point in time, since that reference would be the same every
time; one really must store the value so one can undo/redo one or more times
to revert to the object's state at some earlier point in time.
Same is true when you back up a file: you have to copy the content of the file,
not just its name.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks for the reply. I may not have explained the scope of the problem. The Undo/Redo stack can contain multiple objects and if only the value is stored, then there is no link by which to apply the value. I guess a good follow up question would be: Is there a performance hit by storing the object reference and the property value?
|
|
|
|
|
Hi,
if undo/redo is required for several objects, one either needs several stacks (one
per object, may be impractical), or some means to identify to which object a value
belongs. A reference may take care of this, other schemes could be devised to.
Keeping a reference is much cheaper than keeping a value, so I would say there
is no performance hit in doing this.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello All!
I have an ActiveX control embeded into my application (made by Sony) that allows me to view a video stream from a IP/network camera. It all works perfectly and I can specify IP of camera, hit a button to start stream and in the ActiveX box that appeared when I installed and created instance of ActiveX control, I can see my streaming video. There is also a command with the control that allows me to save a single frame (JPEG image) to the hard drive.
The problem is that I want to write so code to work with the image and display an overlay on the image. Since it is an activeX control I am limited to what I can do to the streaming image (unlike if it were a picture box). Does anybody have any ideas?
I would like to either:
1. Capture the video stream from the control and populate it in a picturebox for editing and overlay.
2. Go ahead and tell the control to save the image every second and have the picturebox refresh the newest saved image in the monitored folder. (I only need 1fps for what I want to do so it doesn't have to be terribly fast).
3. Similar to number 2 but save images to memory instead of hard drive (to improve performance and since I really don't need to save them to hard disk).
The background is that I want to overlay text on the image to tell statistics about the image (such as width, height, amount of pixels, etc...) and I have all of that code working just fine if I load in a image that was captured using open file dialog but I want to show this overlay automatically and real time (at least once per second).
Is this possible?
Thanks,
Mike
|
|
|
|
|
Hi,
I have a Delphi VCL App with a COM Server that I need to consume in a c# exe. How do I add the Delphi exe/tlb to this c# app. At the moment when I try to add a reference to the Delphi exe or tlb, I receive a message that the file is not a valid assembly or COM component.
Regards
Andrew
|
|
|
|
|
Hey Guys
I have a remote control with its censor
(PIXEL-VIEW (TV-Tuner) card's remote and sensor)
the censor is connected with audio jack so i can easily connect the censor in any sound card pin
now i want to read this censors input in c#
i think i must connect this censor in my sound cards LINE-IN pin or in MIC pin
now i want to know how to reach the sound cards pin to detect input in c# 2.0
i tried to search but haven't ound any helpfull resource so plz help
Thanks in Advance
|
|
|
|
|
The tv tuner card probably uses an audio jack as a matter on convenience, not because the IR receiver outputs any form of audio.
Bear in mind that the IR receiver will need a power source, which is usually provided, through the audio style jack, by the TV tuner card. You may have trouble trying to get power through the sound card ports.
The TV tuner card will probably be using some of the (presumably stereo) audio style jack pins for powering the IR receiver, and some others (maybe just 1) for the data.
I have no blog...
|
|
|
|
|
Hi,
Can someone tell me how to convert a string of HTML to display on an aspx page?
Example:
string strHTTP="HTTP://www.yahoo.com";
TextArea1.Value = Server.HtmlEncode(strHTTP);
Why will the above not return as a link on a aspx page?
Thanks....
zxcvbnm
|
|
|
|
|
Why on earth would it ?
HTMLEncode converts strings to HTML valid strings. For example, if I type in a strong tag here : this is strong text , the input from the textbox to the CP site is not HTML encoded, so you see the result of the HTML tag. I need to type > in order to show a > in my text. Presumably the 'Ignore HTML tags in this message (good for code snippets)' checkbox calls Server.HTMLEncode, or something similar, to do this conversion for me automatically.
To render a link, use a linkbutton, or just an anchor tag.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am trying to convert Excel file to XML using C#. And the name of the Excel file is Contacts.xls and the SheetName is Contacts.
OleDbcmdSource.CommandText = "SELECT * FROM [" + Contacts + "$]";
The above code is where it gives me an error. I get an error that the name Contacts does not exist in the current context.
This is my Web.Config code: <connectionstrings>
<add name="ExcelConnectionString" connectionstring="Data Source=C:\Contacts.xls;Extended Properties=Excel 8.0;HDR=No;IMEX=1;Provider=Microsoft.Jet.OLEDB.4.0;">
|
|
|
|
|
Your code should read:
OleDbcmdSource.CommandText = "SELECT * FROM [Contacts$]";
'Contacts' is being used like a variable. If you have not declared a variable called 'Contacts' in your code, the compiler is going to throw an error.
Paul
|
|
|
|
|
Hi Paul,
Thank You so much for replying. Now the Contacts error does not show up but
I get an error on the following code:
OleDbadpSource.Fill(dsSource);//The error says OleDbException was unhandled by user code. Don't know what that means
My full code is as follows:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
BindData();
}
private void BindData()
{
DataSet dsLoginSourceGrid = GetLoginDataSet();
GridView1.DataSource = dsLoginSourceGrid.Tables[0];
GridView1.DataBind();
}
private string GetConnectionString()
{
string strConnectionString = ConfigurationManager.ConnectionStrings["ExcelConnectionString"].ToString();
return strConnectionString;
}
private DataSet GetLoginDataSet()
{
string ConnectionString = GetConnectionString();
OleDbConnection sqlconSource = new OleDbConnection(ConnectionString);
OleDbCommand OleDbcmdSource = new OleDbCommand();
OleDbcmdSource.Connection = sqlconSource;
OleDbcmdSource.CommandType = CommandType.Text;
OleDbcmdSource.CommandText = "SELECT * FROM [Contacts$]";
OleDbDataAdapter OleDbadpSource = new OleDbDataAdapter(OleDbcmdSource);
OleDbadpSource.SelectCommand = OleDbcmdSource;
DataSet dsSource = new DataSet();
OleDbadpSource.Fill(dsSource);
return dsSource;
}
}
|
|
|
|
|
An exception has been raised when you try to fill the DataSet.
What are the details of the error?
The error may be caused because you don't appear to be opening your connection. Add a line 'sqlconSource.Open();' after the line where you create an instance of your connection object. You may also want to consider wrapping your connection in a 'using' block so that it is closed and disposed automatically when it goes out of scope.
Paul
|
|
|
|
|
It tells me "Could not find installable ISAM" Further "OleDbException was unhandled by user code"
View Detail tells me System.Data.OleDb.OleDbException {"Could not find installable ISAM."}
|
|
|
|
|
What is the connection string you are using? I think the information in your original post got truncated...
Paul
|
|
|
|
|
<connectionstrings>
<add name="ExcelConnectionString" connectionstring="Data Source=C:\Contacts.xls;Extended Properties=Excel 8.0;HDR=No;IMEX=1;Provider=Microsoft.Jet.OLEDB.4.0;">
This is my Connection String from Web.Config file
|
|
|
|
|
This doesn't look right. Your connection string should look something like this:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";
Have a look at the following link to get more help with creating connection strings to Excel files:
http://www.connectionstrings.com/?carrier=excel
Paul
|
|
|
|
|
<connectionstrings>
<add name="ExcelConnectionString" connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Contacts.xls;Extended Properties=Excel 8.0;HDR=Yes;IMEX=2"
="">
I changed it as it shows above. But the error is still there.
|
|
|
|
|
There still must be something wrong with your connection string.
Have you definitely got the syntax right?
Paul
|
|
|
|
|
What is this thing called DSN. Do I need to enter the excel spreadsheet in a DSN to make this thing work?
|
|
|
|
|
I cannot find the syntax error though.
|
|
|
|
|
|
No, that link is related to Visual Studio 6.0 SP4.
If you are not sure whether you can create a connection to an Excel file, try creating a Univeral Data Link (UDL) file. You can do this by creating a new text file on your desktop and then changing its extension to .udl. If you then double-click the file, you will be able to configure the connection. When you have finished configuring the connection, you can get the connection string by opening the .udl file in a text editor.
Paul
|
|
|
|