|
Hello, I am "new" if you will to C# (it was suggested to use it, however I am very familiar with C++ and .NET) and I was wondering if there is a way to play a video that is embedded as a resource. I searched the web and found DirectShow, however this requires a path name. I would like a video to be wrapped up inside the .exe. Is this possible?
Mike - I love to program!
|
|
|
|
|
You should be able to embed the video as a binary resource. VS2005 allows you to put any resource into the application from the IDE, which you should be able to get it out using as a stream of bytes from code.
Once you've got a stream, the Windows Media SDK or DirectShow, or ManagedDirectX, or similar should be able to play the stream.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
Unfortunately, I do not have VS2005, just 2003. Would it still apply?
Mike - I love to program!
|
|
|
|
|
Yeah, it can still work. As far as I remember, it was a little difficult getting this to work with 2003 and 2002. Try searching code project or the web for binary resource or embedded resource.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
I can get the file into a stream using reflection, however I can not find a function that will play a video from a stream, but rather from a path name. Is there something I need to download. Thank you very much for your help.
Mike - I love to program!
|
|
|
|
|
I really don't know, as of right now, the .NET framework doesn't provide any way to play video using native .NET, AFAIK. You need some 3rd party software like the ones I mentioned in the previous post. From there, it's a matter of finding the appropriate streaming methods.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
In the end of the day you can just save the stream to a file in a temp folder, play the file and then delete it.
|
|
|
|
|
Hi,
I have a problem. When I change the value in a NumericUpDown control and then leave the control using the tab key (without hitting enter), the change takes effect, but the ValueChanged event doesn't fire. Any way around this?
Thanks
|
|
|
|
|
IIRC there's a loose focus event, use that to do whatever you need done.
|
|
|
|
|
Hello All,
I have DataSet and i need to change the values of some rows in the dataset i used
DataSet.Table[0].Rows[0].ItemArray[0] = newValue;
DataSet.AcceptChange();
But it didnt work
Please help
Hay
|
|
|
|
|
try
DataSet.Table[0].Rows[0][0] = newValue
The ItemArray will be set internally
Live Life King Size
Alomgir Miah
|
|
|
|
|
Thanks Alomgir so much it is working now.
Best Regareds
Hay
|
|
|
|
|
Hi all,
Using the following code under Visual Studio 2005 with .NET beta 2, I am looking for a way for the connection to timeout (in say 5 seconds) if it can't contact the host specified. Any ideas?
---
public string m_GetProcessList(string v_host, string v_processname)
{
string sendback = "";
Process currentProcess = Process.GetCurrentProcess();
Process[] remoteAll = Process.GetProcesses(v_host);
int v_processcount = 0;
string v_processIDs = "";
foreach (Process v_process in remoteAll)
{
if (v_process.ProcessName.ToLower() == v_processname.ToLower())
{
v_processcount = v_processcount + 1;
v_processIDs = v_processIDs + v_process.Id.ToString() + v_process.StartInfo.Arguments.ToString() + ",";
}
}
sendback = v_host + " - " + v_processname + " - " + v_processcount.ToString() + " - " + v_processIDs;
return sendback;
}
---
Thanks all.
Colin Wheeler
Consultant
|
|
|
|
|
I want to bring up a second form to adjust variables on the first form. Any help appreciated! -mutty
|
|
|
|
|
First Is This Variable Public if Yes You Can Do Somthing Like That in Form1
Form2 form2=new Form2();
form2.variableName=value;
If this variable is not public which will be better
You can Write public function in the form and make it set the value of the variable you can code somthing like thar in Form2 which have the variable you wwant to access
public voide SetValue(int i)
{
myVariable=i;
}
and in Form1 You can Write
Form2 form=new Form2();
form2.SetValue(1);
MCAD
|
|
|
|
|
Sorry, I should have been clearer what I mean. I am trying to open a new form, (Form2), from my main form (form1)
On form2 are numerous controls which should change variables of form1.
|
|
|
|
|
Pass a reference to form1 in form2's constructor and store it inside form2:
in form 1:
Form2 form2 = new Form2(this);
form2.Show();
in form 2:
public Form2(Form1 refToForm)
{
this.form1 = refToForm;
}
private someMethod()
{
refToForm.SomeProperty = someValue;
}
|
|
|
|
|
Mutty wrote:
am trying to open a new form, (Form2), from my main form (form1)
In Form1
Form2 form2=new Form2();
form2.Show();
<small>Mutty wrote:</small>
On form2 are numerous controls which should change variables of form1
in form2 like in my other message
<pre><code>
Form1 form1=new Form1();
form1.var=value;
MCAD
|
|
|
|
|
Hi All,
I doing some research for NUnit testing. I had a question related to its use for database testing. Should we avoid writing the tests for databases?
Please let me know.
Any comment will be appreciated.
|
|
|
|
|
Anonymous wrote:
Should we avoid writing the tests for databases?
Why? Don't you care if the database functionality works?
You should test all the database functions against a test version of the DB (with know data inserted), verifying that every function in you data access layer works as expected, and handles errors in a graceful way. Unless you do, changes to stored procedures, or schema changes, or fixes to other bugs, or enhancements could break your application in unanticipated ways. Test everything, including verifying that all schema is as expected, then you have a way to run regression tests that you can rely on.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Thanks for your response. I was told that it takes a lot of time and may not be useful, not even the client side code. It's good to test the business logic.
I am still tryinin to learn to write the tests...it's not easy to write them for the entire scope of the application.
|
|
|
|
|
ANy comments on my previous comment would be appreciated.
Has anyone used NUnitASP for testing.
|
|
|
|
|
Only test your coded methods such as business objects and data access objects and their interaction with handling the data that will be extracted and manipuated from a database.
Don't test the database such as how it handles data; otherwise you are an Oracle, Microsoft, DB3, or FoxPro database tester, which will be a complete waste of time.
Lastly leave the data isssues and normalization to a DBA. That is why they are paid the medium size bucks....
IMHO
|
|
|
|
|
Hello gurus,
I'd like to know how can I programmatically set the focus on tree node freshly created?
I can programmatically select it but the focus still remain to the top node. I'd like to programmatically set the focus on any new created tree node.
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
you can set the focus on any node on the tree by using this syntax :
//TreeView object
System.Windows.Forms.TreeView treeview = new System.Windows.Forms.TreeView();
// Now you have to get the object to that node you want to focus
System.Windows.Forms.TreeNode node = //node rerefence of u want to focus
treeview.SelectedNode = node;
treeview.focus();
-
hope it will help you
Ankit Singhal
|
|
|
|