|
You could use Windows Management Instrumentation. You also have to have rights to the target machine to get a connection to it.
RageInTheMachine9532
|
|
|
|
|
please tell me how to add checkbox or radio button to a specific column of listview.if it is possible for any one then please give me small sample code to implement it using vb.net.
tbhattacharjee
|
|
|
|
|
i got .htc file along with asp.net project and i found there is instruction written in vbscript.so please tell me what kind of file it is and what the use of this file and tell is it client side or server side file.
tbhattacharjee
|
|
|
|
|
please tell me in detail.
tbhattacharjee
|
|
|
|
|
For COM, see here[^].
For COM+, see here[^].
RageInTheMachine9532
|
|
|
|
|
please tell me how to sort the datagrid when i will click on any column header.if it is possible for any one then please give me small sample code to implement it using vb.net.
tbhattacharjee
|
|
|
|
|
When the "AllowSorting" property is set to true, a triangle appears in each column header indicating the direction of the sort. The user can click on any column header to sort the grid by that column. Clicking the column a second time changes the direction of the sort.
make sure "Allowproperty" is set true
shihab
|
|
|
|
|
Doubt on Multilingual: We are developing a software which has facility of mulilingual support.We are using the Language and Localizable properties for this option.In this every time if we had some user defined captions ,i have to change in the certain Resx file of a form.so that if i compile this the changes will take effect.But now i need to compile it automatically.
ie)I have to acess the resource file which will be as same like as the form's resx file.
i will be thankful if anyone can help on this.
Shabu
|
|
|
|
|
I have written a class which has:
Sub New: Set Property "Disposed = false"
Sub Dispose: Cleans up and sets property "Disposed=True"
sub Finalize: If Property Disposed = False throws expection
Property Disposed
The class basically stops you from letting object go out of scope without first Disposing them. So in all my uses of the above class I do this....
Sub MySub ()
Dim lObject as MyClass()
....
lObject.Dispose
End Sub
Its impossible for this object to descope without me having called the Dispose method. YET!...In my live code, which is obviously a little more complex, I have put some message boxes in so I can do a simple trace. First of all, my live code draws buttons, and I get loads of mesage boxes coming up, where I thought they would come up one at a time, this suggests to me that every button is being drawn on a different thread, am I right?
Next, how the heck can I find out why my class is being destructed before my sub dispose is called. The thing is when I look at the call stack it only has the current method on it and no parent calls. That's doing my head in.
I started to get lots of problems on my project when I began using the DefaultValue attribute. This is a great feature, I love it, but am I taking the right approach? You see, when .NET starts my app in design mode it fires off lots of property sets. Each time a property changes, in my property handlers, I call a sub called PropertyChanged. That is responsible for invalidating my control area and redrawing. Should I be doing it that way? I instinctively feel I should not, because I want all the properties to be set, THEN, I want to draw. I dont want to redraw each time because the location changes, then again when the forecolor changes then the shape of the button changes. I feel SuspendLayout and ResumeLayout will be used, but I don't know how, because when the user changes properties like color I dont think OnLayout is called, so if my control is only redrawn in OnLayout it wont be redrawn to reflect new values when non-layout type properties change.
Guys, I am sorry this message is such a mish mash, and thank you for your patience. You can see my frame of mind is somewhat dazed!
Chris.
Nursey
|
|
|
|
|
OK...Well, as far as I can tell, your method of "preventing an object from going out of scope" won't work. Scope isn't controlled by how long an object lives, it's the other way around. As an example:
Public Class MyObject
Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
Dim strText As String
strText = RichTextBox1.SelectedText.Replace(ControlChars.Lf, ControlChars.CrLf)
Clipboard.SetDataObject(strText, True)
End Sub
End Class The object 'strText' goes out of scope when you get to End Sub because strText was declared inside the sub and is not visible outside this sub.
But if you change when the object is declared, you also change its scope:
Public Class MyObject
Dim strText As String
Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
strText = RichTextBox1.SelectedText.Replace(ControlChars.Lf, ControlChars.CrLf)
Clipboard.SetDataObject(strText, True)
End Sub
End Class Now, strText won't go out of scope until the class it's in is destroyed. It is now visible to all the subs/functions in the class.
Are you trying to keep an object from being destroyed before your finished with it? We need to see a little sample code to figure out whats going on.
Buttons: Buttons (and just about all controls) are created on the thread the form is on, not seperate ones. We need a couple more details about what your ultimately trying to do.
RageInTheMachine9532
|
|
|
|
|
Hey Rage,
I think we are about to run up each other's backside here 8-)
I understand all about scope so I am not sure what you're trying to explain. I also understand that I am typing questions like a shell shocked idiot 9-)
My object get's finalized apparently without ever seeing a call to Dispose. So this is a sequence issue. My sub Finalize was called without me ever having called Dispose, that's impossible when I look at my example sub routine. The odd thing is the only call on the stack was Finalize, so who the hell called it? If the CLR called it then why did it? I haven't let the object go, if I had I would have called finalize first.
Look, I think this problem has strangely gone away...but the very strange thing is that when I put my MsgBox trace in a ton of them came up, they didn't come up one at a time and wait for one to be dismissed before the next one came up. That's what made me think loads of threads had been created to draw each of my controls.
If that was true I would have layed an egg! 8-)
I think for somereason, which is most likely attributable to me hitting a problem then moving to a different part of my project whilst a I think about it, I just seem to get strange behavior, which when my code stablises again, things all seem to come out shiney and new again!
Still, I have a problem of having toolbox bitmaps assigned to my controls in the control library and only two of the four controls display their bitmaps.
At design time, the enabled property of my control seems to stay at true, even when the property grid says false. These are all things that when I return to sanity, I am sure will get worked out, but sometimes its very hard to believe things are as stable in .NET as they should be when at times my Property window won't open, until I exit and restart, or I start to see call stacks with only a destructor on them. All these little "sometimes" bugs just unnerve me.
Thanks anyway.
Nursey
|
|
|
|
|
Your right about the CLR. The garbage collector will call Finalize (never calls Dispose) when your object falls out of scope. You can't really hold it open without it actually being referenced. I haven't seen the code so I don't know exactly what your doing. I don't mean to make anyone out to be stupid, and, frankly, I wrote the entire message and posted it before I figured out it was you. (Just look at the name - Duh! ) Sorry!
RageInTheMachine9532
|
|
|
|
|
s'ok mortal, I forgive yah! 8-)
The whole point is that I was calling Dispose before the CLR could finalize it. It's horrible when problems like this just go away though, coz you wonder what the hell your code could be doing that would cause this. It's like returning to the bad old days of C/C++ and corrupting memory or the krapping on the stack! Ah, them were the days.
Perhaps I need to get my hands on a decent trace tool. Do you know of any good free trace tools out there?
Nursey.
Nursey
|
|
|
|
|
I remember those days! Oh what fun!
Try overriding the Finalize event and move the Displose code to it?
Can't say I know of any good trace tools that don't cost an arm and a leg!
RageInTheMachine9532
|
|
|
|
|
I was making a custom drop-down list in a property grid by using a StringConverter and overriding the GetStandardValuesSupported , GetStandardValues and GetStandardValuesExclusive methods ... it worked fine in a normal VB.net Windows application and gave me the drop down list .... but when I tried using it in a add-in for FrontPage, the same code did not give a drop-down menu but just a text box ....
anyone has any idea why???
Thanks in advance....
|
|
|
|
|
I am a new programmer with VB. I need some help. This is what I ultimately want to do. I want to write a .exe which will copy a program to a specific folder, and then launch that program inside the folder. That program causes a pop up screen to emerge with a button on it that says execute. I want the.exe file to automatically click on the execute button without having to prompt the user and then close that program it opened.
If someone could help me out I would greatly appreciate it. Thank you very much for your time.
|
|
|
|
|
I have a need to access the properties of controls in a VB6 executable from VC++. I've tried various MFC/Windows calls to do this, and know the classnames of the windows that correspond to the controls, but haven't managed to find a procedure that works as of yet.
If anyone has a clue on how to do this, I'd appreciate suggestions... thanks.
Bob
|
|
|
|
|
This question is better off in the C++ forum. But are you trying to get at the controls of a VB app you've written, or something you don't have the source code to?
RageInTheMachine9532
|
|
|
|
|
RageInTheMachine9532 wrote:
This question is better off in the C++ forum. But are you trying to get at the controls of a VB app you've written, or something you don't have the source code to?
I can understand why you think this is more of a C++ question; the truth is, it is at its core a "VB internals" question, and with some info on that I might end up in the C++ forum or the ATL forum...
I'm trying to get at properties of objects within a VB executable, and though in my "pilot project" I have access to the source, I need to be able to do this in programs where I do not have source. The base question I have is where this info is stored and/or (more importantly) what structured access, if any, is provided to it.
I'm hoping that VB windows and controls are, from the MFC perspective, COM/ATL objects that are wrapped in CWindow objects, and that I can get an IUnknown interface pointer from them and from there explore whatever info they expose. I haven't found any info on how VB implements their objects from a C++/MFC perspective, though, so I'm speculating based on what I can deduce using Spy++ and other similar tools.
Any clues?
Thanks-
Bob
|
|
|
|
|
BobAshforth wrote:
I'm hoping that VB windows and controls are, from the MFC perspective, COM/ATL objects that are wrapped in CWindow objects,
I think your on the right track, but I remember seeing soemthing a few years back that said that with VB5 and 6, the standard controls all use vtable COM interfaces. I also remember seeing something about using IDispatch to get to an already running instance but I can't find the article anymore. I haven't found any examples of this on the web either.
From what I know about what your doing, you're in for ALOT of work if you have to use IDispatch to "generically" get to the controls. Either way, it's not going to be an easy to solve.
RageInTheMachine9532
|
|
|
|
|
|
If you are using Managed C++ to access VB.NET control it would definitely easier.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
... Great- now all I have to do is demand that the creators of the apps I need to interact with rewrite them in .NET, and I'll be all set! LOL...
Unfortunately, I need to do this with non-.NET apps, so my quest continues...
|
|
|
|
|
I am working on trying to get a specific part out of an array element and making a descision based on what number is presented. The number is 10 decimal digits long before conversion to hex. Once it is converted to hex the upper four numbers are the key to what get done next. How do you get the four upper bits out of a string and then determine what they are in a case statement? The following is what I have for the function so far
Function manipdata() As Integer
'Look at the 3rd and 4th values from each array and determine what type of data it is and display it
'to the user in some format.
Dim i As Integer = 1
Dim a As Boolean
Dim b As String
Do While i < icount
b = Hex(son(i).data)
a = b.StartsWith("1708")
If a = True Then
MessageBox.Show("You found a fwd one")
End If
'MessageBox.Show("You found an aft one")
'Case "0812"
' MessageBox.Show("Go home")
'end case
i = i + 1
Loop
End Function
Thanks and any help would be appreciated.
|
|
|
|
|
Your description seems be a little vague and the code sample doesn't make much sense either, but we'll try this. What I think your doing is looking at the first four hex characters, or 3rd and 4th characters only (?) and doing some processing base on what you find. I THINK(!) your looking for something like this: (This example will look at the 3rd and 4th characters only!: ie. 1708)
Dim i As Integer = 1
Dim b As String
Do While i < icount
' Grab the 3rd and 4th characters of the Hex code.
' This assumes that the Hex code is ALWAYS 4 digits long!
b = Hex(son(i).data).ToString().SubString(3, 2)
Select b
Case "08"
MessageBox.Show("You found a fwd one")
Case "12"
MessageBox.Show("Go Home")
Case Else
MessageBox.Show("Unknown code found: " & b)
End Select
Remember that Hex will NOT return a value padded with 0's on the left. An integer (15) converted to hex will return F, not 000F. So this method will NOT work in all cases. There may be a better method for making this determination, but it depends ENTIRELY on the data that you have in son().data.
RageInTheMachine9532
|
|
|
|