|
Thanx For both of your answers this does allow the code to compile.
Was just hoping i could declaire it and give it a value in the switch without it complaining. The flow was being forced through the switch so though it would work.
Thanx for your time
|
|
|
|
|
gwithey wrote: Was just hoping i could declaire it and give it a value in the switch without it complaining. The flow was being forced through the switch so though it would work.
No, it wouldn't work: that is the whole point.
To cut down your code a little:
byte[] rxData;
rxData[0] = rxMessage[4];
You would still get your compile error, since rxData is null, thus rxData[0] does not exist. This is why the compiler complains.
byte[] rxData = new byte[1024];
rxData[0] = rxMessage[4];
Is fine, since rxData is no longer null, and rxData[0] (through rxData[1023]) exists and can be assigned.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Yeah that makes sense thanx it is clearer now
|
|
|
|
|
please any one can tell me how can i show a preview of the webcam video in a panel or picturebox using WIA or WIAVideo Li or in any other way.....
thanks....
|
|
|
|
|
Here is exactly what you want: [^].
The provided source code uses avicap32.dll, so if you want a WIA solution check this article: [^].
I hope these links help you,
Nuri
|
|
|
|
|
thanks for help...but in that way have to use a commen dialog box. isn't it? but i want to show my webcam preview in a panal or picturebox without using commen dialog box...is there a way to do that....?
A S E L A
|
|
|
|
|
S K Y wrote: but i want to show my webcam preview in a panal or picturebox without using commen dialog box...
I don't understand that.
The source code from the second link uses exactly the PictureBox control to show the captured video (picture by picture using timer). Please check out the provided source code for the article. The are 2 versions of the code available (for C# and VB). You can use the provided technique and place the PictureBox wherever you want.
Best wishes!
Nuri
|
|
|
|
|
hi...i couldn't download the zip file bcz got server error. do you have that zip file with you...(first article)
A S E L A
|
|
|
|
|
I also have the server error for the first article.
But i have downloaded and tested the source from the second one. It uses exactly the WIA, the PictureBox control and it is working!
|
|
|
|
|
Bloody hell. You've been given explicit instructions, day after day. Perhaps you should just abandon this project ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi,
When i click on a button ,it will check which version of mediaplayer is installed in that system. I am stucked here.What is the code for this in c#.
Pls help
|
|
|
|
|
string wmpExe = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), @"\Windows Media Player\wmplayer.exe");
if(File.Exists(wmpExe))
{
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(wmpExe);
}
|
|
|
|
|
Thanks for the replay, stancrm.
|
|
|
|
|
Hi rakesh312,
#1. Add a reference to your project point to \windows\system32\wmp.dll
#2. add this one in top of code :
using WMPLib;
#3 to get media player version is something like this :
WindowsMediaPlayer wmp = new WindowsMediaPlayer();
MessageBox.Show( wmp.versionInfo.ToString());
Good luck
|
|
|
|
|
How can i convert a List to Dataset?
Regards,
Alim
|
|
|
|
|
|
I try to develop windows mobile application. Pro grammatically i create database but it does not crate password. so it show password mismatch.
Plz help me this is my first windows mobile application...
My code is given below:
DataTable dt = new DataTable("ServerSettings"); dt.ReadXmlSchema(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + ("\\ServerInformation.bin"));
dt.ReadXml(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + ("\\ServerInformation.bin"));
SqlCeReplication repl = new SqlCeReplication();
repl.InternetUrl = @"http://" + dt.Rows[0]["PCName"].ToString() + "/DBRestaurant/sqlcesa30.dll";
repl.Publisher = dt.Rows[0]["PCName"].ToString();
repl.PublisherDatabase = @"DBRestaurant";
repl.PublisherSecurityMode = SecurityType.DBAuthentication;
repl.PublisherLogin = @"sa";
repl.PublisherPassword = dt.Rows[0]["PublicatrionPassword"].ToString();
repl.Publication = @"DBRestaurant";
repl.Subscriber = @"DBRestaurant";
repl.SubscriberConnectionString = @"Data Source=""My documents\DBRestaurant.sdf"";Password=" + dt.Rows[0]["SubscriptionPassword"].ToString() + ";Max Database Size=128;Default Lock Escalation =100;";
try
{
if(!System.IO.File.Exists("My documents\\DBRestaurant.sdf"))
repl.AddSubscription(AddOption.CreateDatabase);
repl.Synchronize();
}
catch (SqlCeException e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
}
|
|
|
|
|
Ignore repost
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Create database in windows mobile but when i run doesn't create password so exception for password mismatch.If i Create database in windows mobile it works fine...
How solve it...
Plz Help me . this is my first project of windows mobile.
Code is given below:
DataTable dt = new DataTable("ServerSettings");
dt.ReadXmlSchema(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + ("\\ServerInformation.bin"));
dt.ReadXml(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + ("\\ServerInformation.bin"));
SqlCeReplication repl = new SqlCeReplication();
repl.InternetUrl = @"http://" + dt.Rows[0]["PCName"].ToString() +"/DBRestaurant/sqlcesa30.dll";
repl.Publisher = dt.Rows[0]["PCName"].ToString();
repl.PublisherDatabase = @"DBRestaurant";
repl.PublisherSecurityMode = SecurityType.DBAuthentication;
repl.PublisherLogin = @"sa";
repl.PublisherPassword = dt.Rows[0]["PublicatrionPassword"].ToString();
repl.Publication = @"DBRestaurant";
repl.Subscriber = @"DBRestaurant";
repl.SubscriberConnectionString = @"Data Source=""My documents\DBRestaurant.sdf"";Password=" + dt.Rows[0]["SubscriptionPassword"].ToString() + ";Max Database Size=128;Default Lock Escalation =100;";
try
{
if(!System.IO.File.Exists("My documents\\DBRestaurant.sdf"))
repl.AddSubscription(AddOption.CreateDatabase);
repl.Synchronize();
}
catch (SqlCeException e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
}
|
|
|
|
|
|
Is it possible to create a custom control with two buttons that is , one custom control has to have two buttons together with different events. Is it possible? If so please give me some kick-off points.
|
|
|
|
|
|
Looks like the possibilities are infinite.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: Looks like the possibilities are infinite.
No, only 1.4 million possibilities. (from that link)
|
|
|
|
|
Hello,
VS 2008 SP1
I am using the code below to test whether the user is connected using either a wireless or LAN connection. i.e. that the cable is plugged in, or the wireless is switch off. The code works fine for this. However, if you can spot any potential problems with this or you know of a better way I would be interested to learn more.
However, the client would like us to check if the user is connected using a modem as well. As you can see from my source code I am looking for connection that start with either "Local Area Connection" or "Wireless Network Connection". This is ok.
However, the problem is that the modem name could be anything, as when the user sets up their modem connection using the 'new connection wizard' they can call this anything. So if my switch statement I don't know what to look for.
Any suggestions would be most helpfull,
public bool IsNetworkConnected()
{
NetworkInterface[] networkCards = NetworkInterface.GetAllNetworkInterfaces();
bool connected = false;
foreach (NetworkInterface nc in networkCards)
{
if (nc.Name.StartsWith("Local Area Connection"))
{
if (nc.OperationalStatus == OperationalStatus.Up)
{
connected = true;
}
}
if (nc.Name.StartsWith("Wireless Network Connection"))
{
if (nc.OperationalStatus == OperationalStatus.Up)
{
connected = true;
}
}
}
return connected;
}
|
|
|
|