|
You'll have to check the connectivity on the machine that don't work. Perhaps it a firewall issue that is preventing connecting to the database server
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
One, you responded to the wrong post
Two, the code is irrelevant
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi
Im having a problem getting the code below to work.
compressorHnd = Avi.ICOpen(Avi.FOURCC.ICTYPE_VIDEO, Avi.FOURCC.DIVX, Avi.ICMODE.ICMODE_COMPRESS);
pCV = new Avi.COMPVARS();
pCV.cbSize = Marshal.SizeOf(pCV);
pCV.hic = compressorHnd;
pCV.dwFlags = 1;
pCV.fccHandler = Avi.FOURCC.DIVX;
pCV.fccType = Avi.FOURCC.ICTYPE_VIDEO;
outbi = new Avi.BITMAPINFOHEADER();
outbi.biSize = Marshal.SizeOf(outbi);
outbi.biWidth = 640;
outbi.biHeight = 480;
outbi.biPlanes = 1;
outbi.biBitCount = 24;
outbi.biCompression = 0;
Avi.ICSeqCompressFrameStart(pCV, ref outbi);
bool key = false; long size = 0;
IntPtr r = (IntPtr)Avi.ICSeqCompressFrame(pCV, 0, image.ToArray(), ref key, ref size);
The code causes an "System.AccessViolationException: Attempted to read or write protected memory" exception on the last line.
ICSeqCompressFrame is imported using the code,
[DllImport("MSVFW32.dll")]
public static extern int ICSeqCompressFrame(
COMPVARS pc,
int uiFlags,
byte[] lpBits,
ref bool pfKey,
ref long plSize
);
Can anyone help me out?
|
|
|
|
|
Hi,
AFAIK you can't pass arrays like that, you need to offer some help. Here[^] is a little article explaining some ways that do work.
|
|
|
|
|
|
Hello,
is there any thumbnail control that supports the sorting of thumbnail images by drag & drop?
The reason is that I need a thumbnail control that displays images (similar as e. g. Adobe reader displays the pages on the left side (screenshot), but the user should be able to sort these images by drag & drop.
Thanks in advance for any tips
Andreas
|
|
|
|
|
ab-tools wrote: is there any thumbnail control that supports the sorting of thumbnail images by drag & drop?
Yes and no. It's not a "thumbnail"-control, but the standard PictureBox does provide all the functionality you're after;
- Set the size and width of the desired thumbnail-image
- Set the SizeMode[^] to
StretchImage - Support for Drag and Drop[^]
--edit;
Sounds logical to have multiple of those in a Panel
I are Troll
|
|
|
|
|
Hello Eddy,
first thank you for your fast answer.
Yes, I already thought about doing that with PictureBoxes.
But it's not just the drag & drop of the PictureBoxes themselves, but also an additional label (e. g. for a file name or a page number) for each PictureBox and, of course, it also should look good: so the user can see which PictureBox is selected at the moment and also sees where he has to drop it for changing the sorting.
So I just hoped there exists already a control that does such things. Of course, I would also pay some money for it if I save the time implementing it by myself.
Best regards and thanks for any futher ideas on that topic
Andreas
|
|
|
|
|
ab-tools wrote: also an additional label (e. g. for a file name or a page number) for each PictureBox
Still thinking along the lines of the PictureBox, that would be done by overriding the Paint-handler, drawing the text onto the picture yourself.
ab-tools wrote: it also should look good: so the user can see which PictureBox is selected
"Pretty" is an opinion, I can't help there
The selection would be done by drawing a square around the box, in the current "selection" color as defined by the users' configuration.
ab-tools wrote: So I just hoped there exists already a control that does such things.
There's probably a lot that comes close, like the Tiles control from Infragistics[^].
I are Troll
|
|
|
|
|
Hello Eddy,
thanks again.
Then I'll do it on my own - just thought there would be a control that I can use out of the box...
Best regards
Andreas
|
|
|
|
|
Hi,
I am trying to make an application which tries to read the website ip's currentely visited. I have found an example of packet sniffer in c# (http://www.codeproject.com/KB/IP/CSNetworkSniffer.aspx).
My problem is that i dont want to run the call conitnuously. So i kept the call in a timer. All works fine, but when i plugged in my wifi internet connection( in addtion to my current lan connection), i was not able to view webpage. So i modified the code such a way to montior the ip through all the port. Then i am getting
System.Net.Sockets.SocketException: An invalid argument was supplied
at System.Net.Sockets.Socket.IOControl(Int32 ioControlCode, Byte[] optionInValue, Byte[] optionOutValue)
at System.Net.Sockets.Socket.IOControl(IOControlCode ioControlCode, Byte[] optionInValue, Byte[] optionOutValue) Here is my code
private void checkIP()
{
mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
mainSocket.Bind(new IPEndPoint(IPAddress.Any,0));
mainSocket.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.HeaderIncluded,
true);
byte[] byTrue = new byte[4] { 1, 0, 0, 0 };
byte[] byOut = new byte[4] { 1, 0, 0, 0 };
mainSocket.IOControl(IOControlCode.ReceiveAll,
byTrue,
byOut);
mainSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnReceive), null);
timer1Sec.Enabled = true;
}
private void OnReceive(IAsyncResult ar)
{
try
{
int nReceived = mainSocket.EndReceive(ar);
ParseData(byteData, nReceived);
}
catch (Exception ex)
{
}
} checkIP is called from a timer. I am getting exception in mainSocket.IOControl
|
|
|
|
|
hi guys.
Any one has idea about how can we give enum member like A+,B+...
public enum Color
{
Any,
D+,
D,
D-,
E+
};
I tried creating above enum but bad luck its giving error saying } expected.
dipak
|
|
|
|
|
You can't.
Enum members follow the normal rules for names - same as methods, properties, fields and namespaces.
All you can do is use the word "Plus" or "Minus" instead.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Does it mean that ther is no way to make such member in enum?
dipak
|
|
|
|
|
Yes.
In C#, all identfiers (methods, properties, fields, and namespaces) must adhere to the following rules:
The name can contain letters, digits, and the underscore character (_).
The first character of the name must be a letter. The underscore is also a legal first character, but its use is not recommended at the beginning of a name. An underscore is often used with special commands, and it's sometimes hard to read.
Case matters (that is, upper- and lowercase letters). C# is case-sensitive; thus, the names count and Count refer to two different variables.
C# keywords can't be used as variable names. Recall that a keyword is a word that is part of the C# language.
The characters '+', '-', '(' ')', '=', ',', ';' and many others cannot be used in the name of any identifier.
So, no. You can't do it. At all. Ever.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
You can only use underscores and alphnumeric characters in enum ordinal names. You also can't start the name with a digit.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Add a Description attribute, and use reflection to extract the description from that e.g
[Description("D+")]
DPlus There are numerous samples showing how to do this.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
thankyou so much ....all guys..
dipak
|
|
|
|
|
That's what I would have said too.
|
|
|
|
|
As Pete said, use a System.ComponentModel.DescriptionAttribute .
See also my Enum Utilities[^] for ways to work with them more easily.
|
|
|
|
|
Hi;
i am working on a mobile application with csharp.
I want to know how can i use a parameter related to a form in another form.
what can i do.
thank you for your help.
|
|
|
|
|
If it is web application
Use Query String
Ex Reponse.Redirect("SecondPage.aspx?Param="+Param);
If it is windows application
add module and declare a varible in it assign a value and retrieve it in another page
I hope it ll help u
|
|
|
|
|
thank you for your help,
But i am working on a mobile application and it is not a web application.
I found finallay the solution for the problem.
It was very simple: add a parameter to the constructor of the form and call it with this parameter.
|
|
|
|
|
Hello
I am a beginner in programming in c #, I am trying to program a windows service that has as role of a PC scanner and collect information from WMI such as (disk space, machine name ...), and store these data in a SQLite database that I already create.I've managed to make the WMI connection and SQLite database but I wanted to know how do I do to store the results I get from WMI directly into my SQLite database.
Does anybody have an idea?
Thank you.
////////////connexion Wmi///////////////////
ConnectionOptions conop = new ConnectionOptions();
ObjectQuery query = new ObjectQuery("SELECT Name,Manufacturer,SerialNumber
from Win32_BaseBoard");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
ManagementObjectCollection queryCollection = searcher.Get();
///////////connexion sqlite////////////////////
using (DbConnection cnn = new SQLiteConnection("Data Source=import.db3"))
using (DbCommand cmd = cnn.CreateCommand())
{
cnn.Open();
cmd.CommandText = "CREATE TABLE carte_mére (Name VARCHAR(50),Manufacturer
VARCHAR(50),SerialNumber VARCHAR(50))";
cmd.ExecuteNonQuery();
foreach (ManagementObject m in queryCollection)
{
try
{
SQLiteDataAdapter adapter = new SQLiteDataAdapter(req,cnn);
adapter.InsertCommand = new SQLiteCommand("insert into carte_mére
Name,Manufacturer,SerialNumber values
(@Name,@Manufacturer,@SerialNumber)");
adapter.InsertCommand.Parameters.AddWithValue("@Name", d);
adapter.InsertCommand.Parameters.AddWithValue("@Manufacturer",
m.Properties["Manufacturer"].Value.ToString());
adapter.InsertCommand.Parameters.AddWithValue("@SerialNumber",
m.Properties["SerialNumber"].Value.ToString());
adapter.InsertCommand.ExecuteNonQuery();
} //Console.ReadLine();
catch (Exception)
{
Console.WriteLine("error");
}
|
|
|
|
|
Good Morning,
I work with Visual Studio2008.I create a listview.When running,the items appear in the same ligne and very near to each other.How can arrange their disposition to see them everyone in a ligne?
I do that but change nothing in my disposition:
.
.
.
if (dat.Tables["SQL Temp Table"].Rows.Count > 0)
foreach (DataRow dataRow in dat.Tables[0].Rows)
{
ListViewItem item = new ListViewItem();
item.Text = dataRow[0].ToString() + "- " + dataRow[1].ToString();
listView1.Items.Add(item);
listView1.View = View.Details;
listView1.LabelEdit = true;
listView1.AllowColumnReorder = true;
listView1.CheckBoxes = true;
listView1.FullRowSelect = true;
listView1.GridLines = true;
listView1.Sorting = SortOrder.Ascending;
.
.
. }
This is the link of my image show of my problem http://yfrog.com/b6captureugwj
[^]
I wanna informe u that I work with Csharp smart device
Thanks
modified on Thursday, April 22, 2010 7:03 AM
|
|
|
|
|