|
The reality is, no software manufacturer has a good record of backward compatibility
|
|
|
|
|
i am making text to sign language converter software & want to play continious videos(pre recorded hand movment animations) . the videos are short and many. i used the windows mediaplayer refernce file to play the video files. but the videos dont look continious( gap between 2 videos is no acceptable). so is there any other method to play the files rapidly
tnx in advance
|
|
|
|
|
I think Media player stops a certain second before staring another file. This is just because of buffering.
I think you need to create your own player in Flash and use them to avoid this situation...
|
|
|
|
|
plz can you be more specific . . .
|
|
|
|
|
No, he can't. He's told you exactly what he thinks you need to do. Another solution would be to create playlists in WMP, and if that still gives you a gap, then perhaps you can create two WMP controls and jump between them.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
tnx i like the idea of jumping b/n 2 WMPs
|
|
|
|
|
The player can play from streams, so it must be possible to assemble what to WMP would be one clip dynamically from the parts on the fly. I don't know how difficult this would be to do though.
|
|
|
|
|
Hi,
I use the windows apis a lot and often I have to to give a parameter with the DWORD type. From my understanding the equivalent in c# is int... So when I have a parameter like "DWM_TNP_RECTDESTINATION" it's int value is 0x1.
But I only know that since I found an example where they used the code. But now I have another parameter (DWMWA_EXTENDED_FRAME_BOUNDS) from the dwmapi.dll and I don't know how to get the int value since I can't find an example where it is used :S
Isn't there an easier way to get the value instead of finding someone who knows? :P
$?
|
|
|
|
|
TheDudeJuan wrote: Isn't there an easier way to get the value instead of finding someone who knows?
These values are generally stored in the C/C++ header files associated with the API. So you need to look up the tag in the MSDN documentation and at the bottom of the page there is usually a reference to the associated C++ header file (see this link[^]). Open this file (stored in the SDK directory) to fnd the values. This may mean that you will need to download the Windows SDK from Microsoft.
|
|
|
|
|
Google says its 9. Just type the symbol in the search box and read the first 20 excerpts.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
hi
how to open program through C# program and give this program focus ?
thank's in advance
|
|
|
|
|
E_Gold wrote: how to open program through C# program and give this program focus ?
You mean, you want to run one application. You can easily do it using Process.Start[^]Process.Start
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
Hope this part of code can help you.
Process AgentIDEProcess = new Process();
AgentIDEProcess.StartInfo.FileName = "AgentIDE.exe";
string AgentIDEArgument = DirPath + " " + lwSpecFileName + " " + inputFileName + " " + outputFileName;
// CurDir + "
// + sourceId.ToString() + ".xml " + sourceId.ToString() + "input.xml " + sourceId.ToString() + "output.xml";
//AgentIDEArgument = AgentIDEArgument + " " + sourceId.ToString() + "eoptions.xml";
//AgentIDEArgument += " " + sourceId.ToString() + LWFile;
Console.WriteLine("Arguments: " + AgentIDEArgument);
AgentIDEProcess.StartInfo.Arguments = AgentIDEArgument;
AgentIDEProcess.Start();
AgentIDEProcess.WaitForExit();
|
|
|
|
|
Hi,
I'm trying to add line index cell to my DataGridView by iterating over the rows.
However, when the list has many rows (hundreds), this loop takes very long time due to CPU consuming.
The "heavy" part is converting the "int" to "String".
The code:
for (int iRowIter = 0; iRowIter < this.Rows.Count; iRowIter++)
this.Rows[iRowIter].Cells[0].Value = iRowIter + 1;
Any suggestions?
Thanks!
|
|
|
|
|
eyalbi007 wrote: for (int iRowIter = 0; iRowIter < this.Rows.Count; iRowIter++)
this.Rows[iRowIter].Cells[0].Value = iRowIter + 1;
IMO, Iterating and putting line number will not be the best option. Try handling RowPostPaint[^] or RowPrePaint event. You will get index of the current row. Using that get the row object and add line number (RowIndex + 1). This will avoid unnecessary iterations on the gridview.
Best wishes,
Navaneeth
|
|
|
|
|
Hi,
First of all, thanks. Your solution saves the iterating part.
However, the problem with using these events is that it's called every time the row is painted (for example, when scrolling). This slows down the response time since every time a row becomes visible (due to scrolling) the value of the index cell is set all over again.
Even if I add "if" statement (in order to update the index cell only when required), scrolling after sorting becomes very slow since the index cell of the hidden rows wasn't updated yet.
Any suggestions?
Eyal.
|
|
|
|
|
First of all, I don't actually see any code here that converts an int to a string. Second, I doubt your analysis is correct - doing this over a few hundred rows should *not* take long.
|
|
|
|
|
1. Since the relevant DataGridView cells display Strings, there is an automatic conversion from (iRowIter + 1), which is int, to Cells[0].Value which is String Object in this case. It's the same as
Cells[0].Value = Convert.ToString(iRowIter + 1)
2. My analysis is correct. I tried the following code:
Cells[0].Value = "1" and it worked amazingly fast.
|
|
|
|
|
First of all, C# doesn't allow implicit conversion from int to string, as demonstrated by this snippet:
void foo()
{
string s;
s = 5;
}
Cannot implicitly convert type 'int' to 'string'.
So that's not what's going on and your "equivalent statement" isn't equivalent at all.
Second, DataGridViewCell.Value is not of type string - it's of type object. That means that if you assign a value type to it (such as int) there is a boxing operation, but a few hundred boxing operations (which is what you get with a few hundred rows) does NOT take long.
Try it for yourself:
public object obj;
string test()
{
int count = 10000;
var w = Stopwatch.StartNew();
for (int i = 0; i < count; i++)
{
obj = i;
}
w.Stop();
return string.Format("{0} boxing operations took {1}.", count, w.Elapsed);
}
Show it in a messagebox or just set a breakpoint (after w.Stop(), obviously!) and see what you get. On my lameass workstation 10,000 boxing operations took 0.0001546 seconds. In a debug build. With the debugger attached. In short, the boxing is not going to make any noticeable difference.
Something else is clearly going on here. That said, if assigning the string literal was so fast, why don't you try
Cells[0].Value = (iRowIter + 1).ToString();
instead? Calling ToString() on an int is not expensive either, so if there really is some oddity in the DataGridView that makes it freak out if it has to work with ints this should work around it. I find it difficult to believe such a major flaw in the component would have gone unnoticed though.
|
|
|
|
|
Thanks a lot, you are totally right!
I found the problem: The column's AutoSizeMode property was set to DataGridViewAutoSizeColumnMode.AllCells, which dragged heavy calculations every time one of the column's cells value was changed.
I changed it to DataGridViewAutoSizeColumnMode.None and now everything works smooth.
In order to have the auto-size functionality, I've set the column's Resizable property to DataGridViewTriState.False, and added calls of AutoResizeColumn(ColumnIndex) where it's needed.
Again, thanks a lot.
Eyal.
|
|
|
|
|
You're welcome!
And thanks for posting the explanation. I knew it wasn't conversion from int to string that took the time, but I had no idea what it really was and your findings may be of use to someone else (including myself) some day.
However, I think the way we're intended to avoid this is to call BeginEdit() and EndEdit() - this pattern is used with many controls to suppress expensive side-effects until EndEdit is called. For some reason I just didn't think about that.
DataGridView v;
v.BeginEdit();
try
{
}
finally
{
v.EndEdit();
}
(The BeginEdit is not part of the try block because we should only call EndEdit if BeginEdit has actually succeeded - though this is of course academic if the call to BeginEdit() always succeeds.)
|
|
|
|
|
Hey! I have a problem with a project I'm working on. It references a .NET wrapper of a native dll (libtcod[^] if it matters) The problem is, I work on it in several places, and commit it to a googlecode SVN between sessions. Everything worked like a charm on the first computer I worked on it on, but that has since died. On the new comp I can't seem to run the project because it throws a DLLNotFoundException.
Now, I did have to fix this for another computer I used, so I can work around it but it seems like there should be a 'right' way to do it that keeps referenced DLLs and resources working. The fix is pretty complicated, too.
Long post made short: Is there a standard, working, way of having Referenced Assemblies/native assemblies in your projects that doesn't break when the project is moved over SVN?
|
|
|
|
|
Create a references directory and keep all the external DLLs that are referred there. When building the project, VS will copy it to the output directory.
Best wishes,
Navaneeth
|
|
|
|
|
Yes, I do that, and whats more, the 'build action' of both dlls are set to 'content' and 'Copy to output directory' is set to 'copy always'.
Also, I was wrong. This is not the same problem I've had before...Crap.
|
|
|
|