|
The Process[^] class has everything you need. Note the events that the class exposes too.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks RageInTheMachine953,
This works quite nice. How can you test to see when the process is completed?
|
|
|
|
|
You don't test. The Process class has an Exited event. ALl you do is create the event handler, wire it up with AddHandler , then set EnableRaisingEvents on the Process object that you're using to launch this tool of yours. Then you call .Start on that object.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Here's a tricky one - I have a standard datagrid class derived from the DataGrid object. I'm then using that in a user control and placing that user control on one of my forms 4 times to give 4 datagrids. Of the 4 datagrids only one is editable and so I want to handle the editing event in the form rather than in the user control or my custom datagrid class as I need to use data current in the form.
Specifcally what I want to handle is the CurrentCellChanged event so I can validate what the user typed in the text box columns in the editable datagrid. So, how can I add a handler in the form that corresponds to the CurrentCellChanged event in the custom datagrid which is inside my user control?
I guess maybe I need to bubble the event up or something but I'm not sure how to do this - any pointers would be very helpful.
TIA...
Mike
|
|
|
|
|
If it was just a class that inherited the datagrid you could do it easly (the same way you normally would).
But being a usercontrol the datagrid is a part of the control and you cant access the events ferrom it directly.But you cpould do a cheesy workaround, In the user control you can define a public event and pass it trhe information that the CurrentCellChanged event gets.
At the top of the program...
Public Event CurrentCellChanged(sender as object, ........)
Then create an event sub in your usercontrol and in it put this line:
Raise Event CurrentCellChanged(sender, .........)
Now you can add this event to the main form...
Matthew Hazlett
|
|
|
|
|
Thanks Matthew - I'll give that a go!
Mike
|
|
|
|
|
Hello,
I have a TCP connection in which the following is sent to me:
typedef struct<br />
{<br />
int msgLength;<br />
int msgType;<br />
int seqNumber;<br />
int version;<br />
char data[1024];<br />
} XXXXXXXXXXXXXX;
The msg length: the toal msg length, i.e, sizeof (msgLength)+ sizeof(msgType)+sizeof(seqNumber)+sizeof(version)+realDataLength(276).
msgType: 1
seqNumber: squentially increased from 1.
version: 0
data: store the real content.
All the above variables except data[1024] are Big Endian. My problem is that I need to convert the big endian vars to little endian so that the windows service I have (written in VB.NET) can use them.
Here is a sample of what I thought would work:
.....
i = stream.Read(bytes, 0, bytes.Length)
Try
data = System.Text.Encoding.BigEndianUnicode.GetString(bytes, 0, 15)
........
I thought this would convert the first 16 bytes (the four integer vars from the C structure) to little endian..but nope. Then I tried the first four bytes, etc. No luck. Does anyone know how this can be accomplished in VB.NET?
Thanks.
"Half this game is ninety percent mental."
- Yogi Berra
If you can read thank a teacher, if you can read in English, thank a Marine.
|
|
|
|
|
Use the IPAddress.NetworkToHostOrder method. Not the best place for it to live, IMO, it would have been better as a member of the Convert class.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
|
how can i let my program know that the PC is currently not in use by the user?
for Xample "like how Screen saver works"....
Militiaware
Faris Madi
|
|
|
|
|
A screensaver would be triggered via a timer attached to a systemwide hook on the mouse and keyboard.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi, i made a custom control for data access, someone else is gonna use it, but i dont want them to see the code nor how its implemented, i created a new project and added a reference to that control, when i was running the program, i put a breakpoint in a call to a method of my control and it loaded the source code of the control and by pressing F8 i could see how it is implemented, i could even modify it directly from this other project.
Whats the right way to release a custom control and not letting anyone who uses see the code??
I want my control to be used just the way we use the combobox that comes with .NET
Thank you
|
|
|
|
|
there's some steps you should follow to protect your control..
like Using strong name and signing assembly because a strong name prevent of name spoofing - if you have developed your own Windows control, it is easy for as outsider to create a version of your control in order to fool people into believing it was yours. in order to prevent name spoofing, the assembly must be aware of the publisher.
Militiaware
Faris Madi
|
|
|
|
|
On someone elses machine, the source code will NOT be available in the debugger. They won't see your source or your implementation or anything else.
Though, you can still open up the assembly and view the code using .NET Reflector.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need some help pulling XML data into data grid. I have been working with vb.net for awhile but do not have any experance with XML. Please assist. I am using VS 2005 express for VB, so the ADO is verry limited.
Thanks
George
|
|
|
|
|
I'm using the following code to add a record to a SQL database.
When the record is inserted how can I get the primary key value the database assigns to a field in that record when it is inserted.
Thanks
Dim DBCommand1 As SqlCommand
NonQueryText = "insert into mytable(field1)values(@field1)
DBCommand1 = New SqlCommand(NonQueryText, Connection1)
DBCommand1.Parameters.Add("@field1", SqlDbType.Char,10, "field1").Value = "abc"
Connection1.Open()
DBCommand1.ExecuteNonQuery()
|
|
|
|
|
Use the query "select @@identity" to get it.
@@identity contains the last identity created with the same connection.
---
b { font-weight: normal; }
|
|
|
|
|
I believe @@IDENTITY is for Access DB, if you are using SQL 2000 use SCOPE_IDENTITY()
|
|
|
|
|
The @@identity property works in Access also.
You can use scope_identity() or @@identity in SQL Server. They work very similar, the only time there is any difference between them is if you are using triggers that also insert records.
---
b { font-weight: normal; }
|
|
|
|
|
Using the following sql throws an error
"select @@contactdataid from contactdata"
What else must I do? Thanks.
|
|
|
|
|
Just use the query "select @@identity", as I said.
---
b { font-weight: normal; }
|
|
|
|
|
Sorry to ask elementary questions here but @@identity does not have any value. After I execute the query "select @@identity" how can I get this value into a varable? How does it know which field in the table to use?
|
|
|
|
|
The query only returns one field in one record. Use ExecuteScalar to run the query and get the single value.
---
b { font-weight: normal; }
|
|
|
|
|
I am doing a project that requires me to send the users and alert message to their cellphone as soon as any new changes made to the service.. I am presently using vb.net to develop this online application.. how do i go about sending alert message to the person's cell phone. if anyone have the coding for it.. please help..
Nab
|
|
|
|
|
Not sure if cellphones have this, but when we wanted to send system outage messages to our pagers we would send an email to the email gateway provided by the pager company with an address of the beeper number.
EX. 805551212@cellphone.com, you need to check with the cellp[hone provider to see if they support this.
Matthew Hazlett
|
|
|
|