|
Whenever I have had problems like this it is either because
a) I have a debugger outside of VS that is running.
b) I had run FXCop and that is still open.
Something, somewhere, has that PDB file open which prevents VS from doing a File.Open with replace.
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
More info. This happens with code behind a Windows Form. When this problem arises, close all of the Windows Forms documents in the IDE and the file is released by whatever is holding it. Seems like a bug...
Thanks for the reply, but I don't have FXCop and the above seems to negate 'a'. I'm puzzled.
E
|
|
|
|
|
i have a windows application that currently takes screen shots and copies the image to a directory.
the program takes a screen shot of either the active window, or the whole screen based on the keystroke.
well obviously the 'active window' screen shot will always take a screen shot of itself, so i want to convert this so it runs in the background somehow.
i hope i'm making sense. basically i want to be able to press a couple buttons and no matter what program i'm in, have the computer take a screen shot.
do i need to make a windows service?
any insight would be greatly appreciated.
|
|
|
|
|
|
One of the Best Software Consulting Company in New Jersey looking for IT Professionals to join the company on H1B and sponsor Green card immediately with labor is 3-4 months timeframe, and we have Offices in different locations.
We offer Best Billing rates to the consultants, if you have project in your hand you will get maximum portion of the Billing Rate completely negotiable. You will get Bonus when you refer a friend or associate to the company.
No Rejection/Query in the entire company history for H1/Greencard sponsorship.
We are direct vendors to IBM, Pearson Education, and Verizon etc.
We are also looking for consultants who have skilled in Data Warehousing, .NET & J2EE Technologies, SAP and Oracle Apps etc. We are ready to sponsor H1s and Green Cards.
YOU CAN CONTACT ME AT keith_002@hotmail.com.
|
|
|
|
|
I am working on a Windows application in C#. I have to develop a component which can display the text in multiple languages like Sapnish,Russian,French. I just started looking into it and one way I found is using the resource file somehow. But I create my component runtime by reading a XML, and all the contents are shown in grid. So I think I cant use the resource file way.
Another way is by using the unicode, but I couldnt figure out how to use it. Any help will be highly appreciated.
Amit Kumar
|
|
|
|
|
You don't reall use Unicode, per se. Strings are either ASCII or Unicode. In .NET and Java, all strings are natively Unicode. You really only have to worry about this when marshaling strings to native calls or with stream encodings.
If you're creating your component at runtime using an XML file, when you read the values of properties use the TypeDescriptor to get the PropertyDescriptor or use reflection to see if the property is attributed with the LocalizableAttribute and the value is true . If so, use an instance of a ResourceManager that specifies a Type (this doesn't have to be the Type of the component you're essentially deserializing) and use GetObject to read the information from the resources file.
There are several good articles both on CodeProject and MSDN about localization using the ResourceManager and ResX files (compiled to binary .resources files and embedded into the primary assembly as the neutral language resources, or into satellite assemblies). See Localized Property Grid[^] (good because it deals with dynamically reading resource names) and the introduction to localization in .NET on MSDN at http://msdn.microsoft.com/library/en-us/vbcon/html/vxoriglobalizationlocalizationnamespaces.asp[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I know this is probably really stupid, but I am looking for a way to reference a control from a class. If I change the control from 'private' to 'public static', I have no problem using the control. Except that I have to change all the reference from this.myControl to myForm.myControl.
When I switch back and forth between code and design view, the IDE will remove all of my changes.
Can anyone lend a quick helping hand. Thanx In Advance
**DAN**
|
|
|
|
|
If this is an instance of a control, you shouldn't access it from a static. Just have an public instance property that returns the control from the instance of that class. It would be much better, though, if you only expose what you need from that class. This is known as data-hiding - you don't want to expose too much information or allow unverified code to change the behavior of your class. If you want the property to only be visible in your assembly, use the internal access modifier instead of public .
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi friends,
This time I have a very strange need, I recognize
! In my application, there is three custom UserControls that represent "windows":
MyFakeWindow UserControl1
MyFakeWindow UserControl2
MyFakeWindow UserControl3
There is also, a "FakeWindowManager" that controls which window is the current, which the windows order and things like this. Two methods stand out:
void FakeWindowManager.Load(MyFakeWindow window)
DialogResult FakeWindowManagerAsModal.Load(MyFakeWindow window)
The problem is in the second method. How to do to simulate a MODAL window? Does anybody have an idea? Any suggestion, road, shines, am accepting everything...
Thank´s in advance,
Marcelo Palladino
Brazil
|
|
|
|
|
ShowDialog() show the form as modal window. Is that what you want?
Mazy
No sig. available now.
|
|
|
|
|
A control and a window are distinct window classes with different window styles. Instead of having to modify window styles and going to the work of implementing a pump, simply host the control in a borderless form and return the dialog result from the form:
public static DialogResult Load(MyFakeWindow window)
{
Form f = new Form();
f.FormBorderStyle = FormBorderStyle.None;
f.Controls.Add(window);
window.Dock = DockStyle.Fill;
DialogResult result = f.ShowDialog();
f.Dispose();
return result;
}
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi all,
I was wonder if anyone ran into this problem before, if so could help me. I am trying to insert data into a database from a textbox. Once the user enters the data and presses the add button the database sould be updated and move to the next record. My problem is when the user presses add,I get the following error:
An unhandled exception of the type 'System.Data.SqlClient.SqlException occurred in system.data.dll
The code is as follows.........Thanks in advance!!!!!!!
private void Form1_Load(object sender, System.EventArgs e)
{
this.sqlDataAdapter1.Fill(this.dataSet11,0,0,"Protype_Type");
}
private void addBtn_Click(object sender, System.EventArgs e)
{
SqlConnection con = new SqlConnection(this.sqlConnection1.ConnectionString);
con.Open();
//this.sqlInsertCommand1.CommandText = "INSERT INTO Prototype_Table (Project_Title) VALUES(@Project_Title)
string InsertThis = this.sqlInsertCommand1.CommandText;
SqlCommand cmd = new DqlCommand(InsertThis, con);
//Note:Here is were the compiler points to the error
cmdExecuteNonQuery();
con.Close();
}
}
}
|
|
|
|
|
Missed a dot...
cmd.ExecuteNonQuery();
Free your mind...
|
|
|
|
|
Put your codes inside try/catch block so you can tell us what is error message.
Mazy
No sig. available now.
|
|
|
|
|
If you're filling a DataSet with a SqlDataAdapter , may I also assume that you're binding it to your controls? In this case, just call SqlDataAdapter.Update passing the changed DataSet (the adapter will get the changes and execute the appropriate SqlCommand for the type of change, then will accept the changes on the DataSet ). This very easy. To move to the next record, get the CurrencyManager for the bindings (see Control.BindingContext for more information) and increment or decrement CurrencyManager.Position to move forward or back respectively (check the curren position for 0 or Count - 1 before setting it, though, or an exception will be thrown for extending beyond the range of data).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
missed dot must have caused compile time error so sth different occured.. I think you din't use right order to get access data in db. I mean you may not define sth properly such as a dataset.. We could not see the whole code. Good luck.
GM
|
|
|
|
|
Is there any way to handle tcp syn packets without setting SIO_RCVALL socket options ?
The following works with icmp and udp msg but not with tcp connection requests.
System.Net.Sockets.Socket srv_socket=new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork,System.Net.Sockets.SocketType.Raw, System.Net.Sockets.ProtocolType.IP);
srv_socket.Bind(
new System.Net.IPEndPoint(System.Net.IPAddress.Parse("127.0.0.1"), 2000)//whatever you want
);
srv_socket.Receive(ReceiveBuffer);// handles udp and icmp message but no tcp syn
|
|
|
|
|
This function:
private void BuildMenuStructure(SqlDataReader dr)
{
ArrayList arrNodes = new ArrayList();
while(dr.Read())
{
object[] values = new object[dr.FieldCount];
dr.GetValues(values);
arrNodes.Add(values);
}
}
Places data from a datareader into a 2-dimensional arraylist.
How can i index into the data (arraylist).
I need to do something like this:
int mmenuid = arrNodes[1][1].ToInt32();
|
|
|
|
|
An ArrayList stores Object s and, as such, will return them. In order to access your object[] array you'll have to cast the return value of ArrayList.Item (the indexer):
int mmenuid = (int)((object[])arrNodes[i])[1];
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Just about everybody will have seen or used this functionality I am trying to replicate, most likely in Acrobat viewer - or a variant which is [CTRL + Cursor] in most scrollable windows.
I am working on a simple image viewer, that overrides the onPaint for the form and renders a given image directly onto it (i.e. no picture boxes etc). Image display is working as it should but I am now looking for a way to scroll the form using mouse events. For example, the user clicks and holds on the form, when they move the mouse pointer the form is scrolled in the direction of mouse travel.
The mouse events to do this are relatively simple :
private int mouseDownX;
private int mouseDownY;
private bool mouseDown = false;
private void ImageViewer_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
mouseDown = true;
mouseDownX = e.X;
mouseDownY = e.Y;
}
private void ImageViewer_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
mouseDown = false;
}
private void ImageViewer_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (mouseDown)
{
if (e.X > mouseDownX)
{
}
if (e.X < mouseDownX)
{
}
if (e.Y > mouseDownY)
{
}
if (e.Y < mouseDownY)
{
}
}
The problem is that I cant find any way of scrolling the form (this), does anybody know of a solution?
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
I think you should repaint the form when the mouse move, not scroll it. Thats the thing really happend there but of course it could be slow.
Mazy
No sig. available now.
|
|
|
|
|
Actually, Mazdak, the current position of the document is changed which cause repainting on the view of the document at that position.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Sorry Heat,I can't understand you. Is that mean its a wrong solution that I gave ? In his paint he should calculate the moving of mouse and show new image , isn't it?
Mazy
No sig. available now.
|
|
|
|
|
In a document/view architecture, the position of the document (or even an image in this case) must be tracked so that you know what view (the visible portion of a document or image to draw) to draw. Painting will happen regardless but you need to be able to track the position of where you were in order to know where to move (or rather, how to adjust the view).
He could do it this way but he would have to do all the view calculations himself and it's just not necessary. Even in games development with, say, DirectX you have a world view that you control and the painting of that world within that view is - for the purposes of this discussion - painted by DirectX (it just has to know how to paint).
See my reply to the original thread. Controlling the scroll bars is actually quite easy (though it could be easier if exposed by ScrollableControl or other non-derivative controls that can scroll like the ListView ).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|