|
Anonymous wrote:
What must I do ?
Check 'Do not treat <'s as HTML tags', then we can see the XML.
The two options you have are to use an XMLDocument to insert the XML you want, or to use an XMLWriter or just a string to build the XML 'by hand'.
If I could see the XML, I'd be able to help more.
And please delete your anonymous post below.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
File1.xml
<files>
<file>
<filename>Example1
<file>
Now I want to append File1.xml as follow
File1.xml
<files>
<file>
<filename>Example1
<file>
<files>
<file>
<filename>Example2
<file>
What must I do ?
|
|
|
|
|
Anonymous wrote:
What must I do ?
Check 'Do not treat <'s as HTML tags', then we can see the XML.
The two options you have are to use an XMLDocument to insert the XML you want, or to use an XMLWriter or just a string to build the XML 'by hand'.
If I could see the XML, I'd be able to help more.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How does one integrate html tags into vb.net similar to article cppTooltip? Want a hyperlink like in the article.
Mark Thibodeaux
|
|
|
|
|
Hello everybody. I'm trying to get the percentage of the CPU Usage. So far I have the following code:
Dim query1 As New ManagementObjectSearcher("SELECT * From Win32_Processor")
Dim moa1 As ManagementObject
Dim tempa1 As Long
For Each moa1 In query1.Get()
tempa1 = Long.Parse(moa1("LoadPercentage").ToString())
Label3.Text = tempa1
Next
When I debug with a break point and leave the mouse pointer over the label3.text I get the value of the percentange, but when i run the program without a break point the program seams for ever thinking without giving me the value. I have a timer that runs every second to update the query. What am I doing wrong? Thank you.
Still trying to find the way
|
|
|
|
|
You shouldn't be using WMI for this. Instead, you should be using the Performance Counters. Check out this[^] example on MSDN. It's doing exactly what you described.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I didn't say you couldn't get the perf data using WMI. I said, you SHOULDN'T use WMI for it. If you want Performance Counter data, use the PerformanceCounter classes. It's what they're there for and you don't have to wrap a bunch of WMI junk to get something that's already been wrapped for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i wanted know how make a program residentable in memory in vb6.0
thanks,
Try to make your life a good code!
|
|
|
|
|
You're using an old DOS term. The only equivilent in Windows is a Service, which VB6 can't directly build. You have to write your application carefully so you can use another application to HOST your app as a service.
Take a look at this[^] for more information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to get some basic Windows Services up and running, using barebones code from MSDN tutorials. I've downloaded the latest SDK, and used code straight from their site, but I'm getting an error message.
System.IO.FileLoadException: The located assembly's manifest definition with name 'interop_msxml' does not match the assembly reference.<br />
File name: "interop_msxml"
Does this mean I've got either an old dll or old code? Or am I oversimplifying?
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
Delete the contents in your Bin folder, Recompile your application and turn on your JIT Debugger if it's not on.
Where did you get the original source, I'd like to download it.
Thanks,
progload
|
|
|
|
|
You mean the SDK itself? Here:
http://www.microsoft.com/downloads/details.aspx?familyid=EBA0128F-A770-45F1-86F3-7AB010B398A3&displaylang=en
Or you mean the code snippet? Here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmsrvsdk/htm/configuringbrdcstpubpt.asp
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
Dave,
thanks for the links..
progoad
|
|
|
|
|
"Delete the contents in your Bin folder, "
Didn't have any effect.
"Recompile your application and turn on your JIT Debugger if it's not on."
OK, I did that, but all that does is put the error message in a prettier box to read. Now the error message is this:
"An unhandled exception of type 'System.IO.FileLoadException' occurred in system.windows.forms.dll
Additional information: The located assembly's manifest definition with name 'interop_msxml' does not match the assembly reference."
I have tried removing and then adding the two offending dlls (interop_msxml.dll, microsoft.windowsmediaservices.dll) into the reference, but I can't - they don't show up in the component list at all, even though I've managed to add them. (I can tell I added them because when I try to do it again, it tells me it couldn't, since there is already a reference to this component in the project.)
Oddly, the place where it's blowing up isn't near the start, it's at this line:
Playlist = BCPubPoint.SharedPlaylist
even though there's lost of references prior to this:
...<br />
Dim BCPubPoint As IWMSBroadcastPublishingPoint<br />
Dim Playlist As IWMSPlaylist<br />
...<br />
If BCPubPoint.BroadcastStatus = WMS_BROADCAST_PUBLISHING_POINT_STATUS.WMS_BROADCAST_PUBLISHING_POINT_STOPPED Then<br />
BCPubPoint.Start()<br />
Playlist = BCPubPoint.SharedPlaylist
If I comment that one line, it doesn't blow up.
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
Dave,
Sorry, I don't have an answer yet..
Looks like it has something to do with SP1 for server 2003..
Mine is also that way (???), I haven't used the PIA since I put in SP1, I checked the GAC and It has put two different assemblies and manifests in the GAC on mine when I installed SP1, and it seems to have broken a test program I wrote last year. Give me a little time and I'll see if I can track down the problem.
If anyone else knows what's going on here, please feel free to comment on this.
progload
|
|
|
|
|
While CP was Down for the count...
I did a little more investigating and came up with this:
There are (after W2k3 SP1 Install) "Two" different versions.
-interop_msxml.dll in sdk: 2.0.0.0
-interop_msxml.dll in SP1: 9.0.3693
-microsoft.windowsmediaservices.dll in sdk: 9.0.0.3665
-microsoft.windowsmediaservices.dll in SP1: 9.0.0.3693
I referenced the ones from the original SDk (v2.0.0.0 and v9.0.3665)
and it seems to go back to working on mine here.. and my old test code is working again.
What other problems it will have.. I have not checked out as of this time.
When I reference the ones from SP1(v9.0.3693 and v9.0.0.369) I get the error you describe.
I'll go ahead and download the New SDK for SP1 and see what happens but it may take a day or two.
I hope some of this Helps..
progload
|
|
|
|
|
It's a *huge* help just knowing that it isn't me and my lack of knowledge.
So, I don't know if I have versions from before but I'll go looking.
Thanks - and keep me posted.
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
Well, with a bit of fancy footwork, I seem to have gotten v2.0.0.0 in there and it is behaving thus far.
I can't really say how, since I don't really understand the interplay between adding a reference, including the dll in the folder and creating the runtime of the dll.
Note there is a diff in filenames between 2.0.0.0 and 9.0.0.*: interop_msxml.dll vs. interop_MSXML.dll. I don't know if that factors in or not. It did allow me to have both dlls in the folders simultaneously whikleI was busy configuring it.
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
Have you had any luck on tracking this discrepancy down? I continue to have this problem, despite a brief period where I seem to have gotten it working.
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
I am going through the exercises in a textbook to learn about exception handling. This is my code:
<br />
Dim n1, n2 As Integer<br />
Dim n3 As Single<br />
n1 = CInt(txtIn1.Text)<br />
n2 = CInt(txtIn2.Text)<br />
Try<br />
lblOut.Text = n1 / n2<br />
Catch ex As Exception<br />
lblWarn.Text = "Warning!"<br />
End Try<br />
1] The book says Catch e As Exception, but Visual Studio defaults to 'ex' instead of 'e'. If I deliberately put in 'e', I get a build error: "Variable 'e' hides a variable in an enclosing block." What is wrong here?
2] It seems to me that, if a zero is put into txtIn2, it should throw an error. It doesn't. It handles it gracefully, but unexpectedly, putting the text 'Infinity' into lblOut.
How am I suppsoed to learn exception handling if it won't act ... exceptional!
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
DaveC426913 wrote:
n1 = CInt(txtIn1.Text)
n2 = CInt(txtIn2.Text)
I don't think you're supposed to use CInt, you should use Convert.ToInt32. VB.NET contains a lot of VB6 crap, because the VB community complained when Microsoft initially ( and with good reason ) removed it.
DaveC426913 wrote:
The book says Catch e As Exception, but Visual Studio defaults to 'ex' instead of 'e'. If I deliberately put in 'e', I get a build error: "Variable 'e' hides a variable in an enclosing block." What is wrong here?
1/ it doesn't matter what you call your variable
2/ you have another variable called e that's visible to this one, so you can't do this, because one overrides the other
3/ you should catch DivideByZeroException, not just Exception. This will catch ANY error, including ones you have not anticipated and/or can't recover from.
DaveC426913 wrote:
2] It seems to me that, if a zero is put into txtIn2, it should throw an error. It doesn't. It handles it gracefully, but unexpectedly, putting the text 'Infinity' into lblOut.
Good question. VB sucks. Use C#. I tried this now, and even if I set n3 to be n1/n2, it still does the same. C# throws an exception, like all real programming languages.
I find it hilarious that your book doesn't know that this doesn't throw an exception, I wonder if the author bothered to try it.
*edit* I apologise if the above seemed harsh, but I have to tell you, the whole office is laughing about this VB 'feature' right now. I'm not wanting to give you a hard time, just VB.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
I don't think you're supposed to use CInt, you should use Convert.ToInt32.
Actually, you can still use CInt without any worries of it being on the chopping block in 2005. CInt is actually faster than using Convert.ToInt32 because CInt's conversion code is compiled in-line with the expression. There's no method call to setup and jump to.
His code is converting the DivideByZero exception to a string before it blows up. This results in the string "Infinity" being returned.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Isn't CInt one of the legacy methods that was going to be removed ? I wasn't sure on this.
Dave Kreskowiak wrote:
His code is converting the DivideByZero exception to a string before it blows up. This results in the string "Infinity" being returned.
Wrong. I converted into code which didn't use strings at all, and the Single variable gets the VALUE of positive Infinity. That's where the string value comes from, the Single, which does not blow up. Then I changed the code to set to an int, and it DOES blow up then, but it doesn't throw a DivideByZero exception, it throws an OverflowException. C# will blow up on a divide by zero, no matter what type it's being set to, and it throws the right exception.
Do you have an explanation for this that doesn't involve the VB.NET design team spending most of their time drunk ? Because we spent a Friday laughing about it here ( where we never use VB.NET ).
Christian Graus - Microsoft MVP - C++
|
|
|
|