|
Half-Wit, sorry Life got it right, use a datagridview. You will need to add the radiobuttons manually but the will article on CP to help.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I just cant figure out how to open an existing playlist using the WMPLib.WindowsMediaPlayer object.
I have an existing playlist i want to open, but i have to somehow get it into an IWMPlaylist type first, yet i cant seem to find a method that will do this.
Can anyone help?
|
|
|
|
|
I'm not sure, but if it comes to it, it shouldn't be that difficult to read in the file yourself.
WPL files look kinda like this:
<?wpl version="1.0"?>
<smil>
<head>
<meta name="Generator" content="Microsoft Windows Media Player -- 10.0.0.4058"/>
<author/>
<title>Kaiser Chiefs</title>
</head>
<body>
<seq>
<media src="..\..\Kaiser Chiefs - Employment\Kaiser Chiefs - Everyday I Love You Less & Less.mp3"/>
<media src="..\..\Kaiser Chiefs - Employment\Kaiser Chiefs - I Predict A Riot.mp3"/>
<media src="..\..\Kaiser Chiefs - Employment\Kaiser Chiefs - Modern Way.mp3"/>
<media src="..\..\Kaiser Chiefs - Employment\Kaiser Chiefs - Na Na Na Na Naa.mp3"/>
</seq>
</body>
</smil>
So you should just be able to use XmlReader and reconstruct the playlist to a IWMPlaylist
My current favourite word is: Nipple!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I can read them with an XmlReader no problem, but i cant get a .wpl file to a IWMPlaylist format so i can use the mPlayer.playlistCollection.importPlaylist(IWMPlaylist playlist) method;
I could recreate the whole playlist, by reading the xml and using the media src property to create new IWMPMedia items, then loading each of those into a new playlist, but i cant believe there isnt a simple way to import a playlist...
This is what i am doing at the moment:
<br />
playlist = mPlayer.newPlaylist(plName, openFileDialog.FileName);<br />
<br />
mPlayer.playlistCollection.importPlaylist(playlist);<br />
but this creates a copy of the playlist, so if i open playlist.wpl, i get a new file called playlist(2).wpl, appearing, then if i open it again later, i get playlist(2)(2).wpl.
I could delete the duplicate file every time i open a playlist, but im thinking there has to be a better way...
all i want is a method that lets me create a IWMPlaylist object from a path to a .wpl file.
MSDN has been absolutely no help...
|
|
|
|
|
I use Winforms RichTextBox control to edit scripts. Scripts are plain ascii texts.
When error occurs, script engine returns character position of error in code as integer.
How to position cursor to this character position ?
RichTextBox does not have current position property.
Andrus
|
|
|
|
|
Hi Andrus,
I got 2 options:
richTextBox1.SelectionStart = 50;
richTextBox1.SelectionLength = 0;
richTextBox1.Select(60, 0);
The second property/attribute that I´ve set 0 is the length of the selection, if you want to select some text, you can send the length of the selection, but if you don´t want to select, send 0 and then the cursor was positioned in the index.
-----
LeandroAB
|
|
|
|
|
Beat me to it. Nice one.
Simon
|
|
|
|
|
Set the selection start to the character position you want, and the selection length to 0
richTextBox1.SelectionStart = position;
richTextBox1.SelectionLength = 0;
Simon
|
|
|
|
|
Hello,
I am using multiple SqlBulkCopy objects within multiple threads to write data into one common database table. The data is obtained via a custom DataReader implemented to read from a common data source.
So now I´m starting 3, 4 or 5 threads almost at the same time to write into the same data table and most times this all works out perfectly. But sometimes a deadlock occurrs on the server and one of the .WriteToServer(Datareader)-calls breaks with an exception. No matter, if I do or don't use 'implicit transactions' option.
So I am wondering how this can happen ? I am referencing the same target table on the server - so in my opinion it may happen that one transaction block the others - but there should never be a deadlock because there is no cyclic dependency of used ressources.
Or am I wrong with my assumptions ?
Does anyone have an idea what happens in this case ? Or did anyone experience the same problem ?
Thanks in advance for any ideas,
Juergen
|
|
|
|
|
Reason for this could be lock escalation where you have a conflict when sessions try to escalate the lock to cover the same area.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hello Friends,
I'm developing an application that reads file properties and stores them in a MS-Access database. I need to know, what would be more efficient in terms of speed, the GetDetailsOf method or the FileInfo and DirectoryInfo classes.
|
|
|
|
|
Test them both and see.
Write the two methods of reading the file properties
Write a loop that repeats the file reading (say 1000) times. You need to do it lots of times because generally just doing it once will be so fast you can't time it accurately.
Use a System.Diagnostics.Stopwatch to time the loop. Repeat for both types of file read.
Simon
|
|
|
|
|
Like the other reply said, make two versions. But I'd suggest using a profiler to make the comparison, if possible.
|
|
|
|
|
HI,
I come from a dephi background and i am in the process of moving to c#.
In Delphi I can declare a file as being of a recordrtpe (or Struct in
c#).
i.e
FileName = File of TempRecType
where TempRecTypeis declared as
Record TempRecType
longint TempIntVal,
string[14] Shortstring,
shortint TempIntVal2
end;
To read from this file I would simply create a variable of TempRecType
and read the
file straight into the variable.
can anybody help me to do this in C#?
|
|
|
|
|
It should be possible to create a structure with a memory allocation that matches your file, using some attributes, but it's not trivial. Then it should be possible to read data into that structure.
I think that the simplest way is to just use a BinaryReader to read the file.
Note that a character in .NET is a 16 bit value, and the string in your file is probably encoded as 8 bit values. You need to specify an encoding that maps each character to an 8 bit value, like Encoding.ASCII or Encoding.Default (Ansi).
Also, you have to match the integer data types against the .NET integer types. How many bits are there in a longint and shortint? In .NET you have the specific Int16, Int32 and Int64 types (which maps against the aliases short, int and long in C#).
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
If the user then clicks on (Sub menu) on the menu then the Excel function wizard would come be launch showing the function and it's arguments with a link to the help files for the function.
|
|
|
|
|
Sorry, but just because you don't like the (correct) answer you were given the first time posting it again won't magic up a different one.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: because you don't like the (correct) answer you were given the first time posting it again won't magic up a different one
Maybe it works in some retarded parallel universe, but not here
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
dear all,
could anyone tell me how to use ErrorProvider to datagrid
|
|
|
|
|
|
Simon's answer will show the error icon next to the whole DataGridView . However, there is 2 properties for a DataGridViewRow and a DataGridViewCell called ErrorText which sets an error icon and an error message in a tooltip for a row and a cell respectively. Setting the property to an empty string removes the error icon and the message.
Eslam Afifi
|
|
|
|
|
Please try to refrain from using words like Urgent and Plz HELP in your subject line.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
smraj1503 wrote: project in vb.net using c# coding
|
|
|
|
|