|
A window application. Here's the scenario, the application prints to the screen, but doesn't have the ability to scroll upwards so I dont have the ability to copy and paste. It's kind of like a console application running within a window I would like to capture all text that prints to the screen and save the text within a text file. Oh yeah, here's the link to the software that i'm talking about http://www.hssltd.com/ I hope that's specific enough.
|
|
|
|
|
There's no easy way to do this. You can't "intercept" the text as it goes to the window. It's not like a console app that has a stream that you can redirect. There's nothing to redirect in this case.
Your best shot is going to be something like sending the WM_GETTEXT message to the window handle that is show you the text. HOPEFULLY, it responds and actually sends you the text that it is displaying. There's a couple of problems with this though.
First, there is nothing that says a window that displays text has to respond to the WM_GETTEXT message. It's a crap shoot if it does or not. You just have to try it. Google for "VB.NET WM_GETTEXT" for some examples.
Second, If WM_GETTEXT works, it'll give you everything that is in its text buffer, regardless if it sent you that text before or not. You'll have to work out what data you already have versus what you don't. On top of that, you won't get any indication or event to catch when the text changes in that window. You'll have to poll for it, constantly.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i was wondering if any one know how i can detect a color ( like red color) in a bitmap file using C++ code???
Thanks Ricky
|
|
|
|
|
You've been told before to ask your C++ questions in the correct forum[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
can u tell me where would i ask this then
|
|
|
|
|
He's told you before, and he gave you a link. Are you sure C++ is the right language for you ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Can anyone tell me how to covert an array int[] into List<int>
I do not want to use a for loop to traverse through the array and add the elements to the list.
Is there something like toArray which converts list to array?
Srivatsan
|
|
|
|
|
I'm not sure if you're talking about an ArrayList or a List<int>. Both have AddRange methods which should take your array just fine. Both also have ToArray methods.
|
|
|
|
|
int[] items = { 5, 10, 15 };
List<int> list = new List<(items);
|
|
|
|
|
Hey thanks for the reply. I will try it out. I am already home. Thanks.
I will get reply back as soon as i try it out.
|
|
|
|
|
Hey thanks for the idea. The code which works is as below
int[] items = { 5, 10, 15 };
List<int> list = new List<int>(items);
Srivatsan
|
|
|
|
|
Hello everyone,
Martin was kind enough to point me to this article for sending Data from Child to parent. For some reason I am unble to get the code going for sending more than One data back to the parent form.
http://www.codeproject.com/dotnet/passingvaluesbetweenforms.asp[^]
Can someone be kind enough to tell what needs to be done to send more than One data back to the Parent form.
Thank you very much for your time and have a great day.
Khoramdin
|
|
|
|
|
If you are the application, and the application is both the main and child window, why do you have to send data from one to the other?
|
|
|
|
|
|
Does anyone know how in the world does it work in VS2005 to access/write/delete from an MSAccess DB. I can't seem to get it working. I have the connection and the following code:
public void newClientInfo(string firstName, string lastName, string midName,
string phoneNumber, string address, string city, string state, string zipCode)
{
OleDbCommand cmdStore = new OleDbCommand();
cmdStore.CommandText = "INSERT INTO `ClientInfo` (`First Name`, `Last Name`, `Middle Name`, `Home Phone`, `Address`, `City`, `State/Province`, `ZIP/Postal Code`) VALUES "+
"('"+firstName+"','"+lastName+"','"+midName+"','"+phoneNumber+"','"+address+
"','"+city+"','"+state+"','"+zipCode+"')";
cmdStore.Connection = conObj;
try
{
conObj.Open();
cmdStore.ExecuteNonQuery();
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show("Problems: " + ex.Message);
}
finally
{
conObj.Close();
}
}
It seems to be working fine, but for some reason, it does not appear on my DB file. Can anyone lend me a hand?
Thank you.
The Slowest component sits at the keyboard.
|
|
|
|
|
Have you verified that the code is executed at all?
How do you check if the database has changed or not?
---
single minded; short sighted; long gone;
|
|
|
|
|
Yes, I have checked that the code executes with the help of F10. I also check the access file, but there are no changes, all fields on the table say
NULL
The slowest component sits at the keyboard.
|
|
|
|
|
Well, if the code is executed then you have added a record somewhere. Are you sure that you check the correct database and the correct table?
---
single minded; short sighted; long gone;
|
|
|
|
|
ExecuteNonQuery returns an integer that represents the number of rows affected (inserted in this case). Add a variable to get that value and see what it says.
The one thing I noticed in your query was that there were apostrophes or single quotes around the table name. I don't think you should have those there. One other point is that you should use parameters in your command instead of concatenating them.
|
|
|
|
|
ExecuteNonQuery gives me the value of 1. Now about the single quotes, I tried taking them out, and it gives me a query error.
Now here is one interesting thing i've noticed. Everytime I run the program, I notice when going back into VS, the connection to the database kinda closes on the server explorer. Anyone know what could possibly be done to prevent that from happening?
The slowest component sits at the keyboard.
|
|
|
|
|
Try using square brackets [] around the table name and everywhere else you have the single quotes except in the Values section.
The value of 1 means it updated something.
|
|
|
|
|
Nope, nothing at all, does the same thing.
The slowest component sits at the keyboard.
|
|
|
|
|
I'm rephrasing this question because its original form was never answered.
I'm trying to define structs and/or controls as properties. Types are declared with the Serializable attribute, and property declarations are marked as Browsable. Both get and set accessors are provided, and runtime code has no problem addressing the properties. The root class descends from Control.
The expected and necessary design time behavior is that Properties view displays these properties under expandable nodes, with the properties/fields of each displayed within the node.
Instead, the property is displayed in gray/disabled text, and there is no expandable node.
What else do we have to do, or what might we have done wrong, which denies us this intended behavior?
TIA,
m
|
|
|
|
|
You need to define or create a ControlDesigner and assign it to the class using the DesignerAttribute .
|
|
|
|
|
Thanks to you.
Since we've tried that, I assume there must be something wrong with our designer, and that we need to revisit the documentation on that.
m
|
|
|
|