|
Try this link.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hey guys
i have a c# project and ive added a project installer...
is there any way i can install some fonts to in the windows font directory as the application gets installed?
many thanks
Will
|
|
|
|
|
Checkout the help of the Visual Studios...
It is all in there ...
Don't you also love the code?
|
|
|
|
|
ive had a dig around and cant much :S
can u point me in the right direction?
|
|
|
|
|
When you have created a new setup project in vs2005, you go to the 'File System' right click on 'File System on Target Machine', 'Add Special Folder', 'Fonts Folder'.
And then you just add in the Fonts folder the right files...
Just of topic... I have helped you could you help me? I want to finish my work (General Discussion - Cards?).
Don't you also love the code?
|
|
|
|
|
thanks dude! spot on!!
|
|
|
|
|
hi every one,
well I have this little problem here. I'm getting a nullreferenceException when I try to access the value of a DataGridViewComboBox column. I have correctly bounded the column and its also showing the values of that table too. The name of the column is "AttendanceComboBoxColumn". now I just wanna know how to get the value selected in this comboBox.
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
//MessageBox.Show("att: " + dataGridView1["AttendanceComboBoxColumn", i].Value.ToString() + "\n empid: " + dataGridView1["empIDDataGridViewTextBoxColumn", i].Value.ToString()+"\nDate: "+selected_date.ToString());
//MessageBox.Show("att: " + dataGridView1["AttendanceComboBoxColumn", i].Value.ToString() + "\n empid: " + dataGridView1["empIDDataGridViewTextBoxColumn", i].Value.ToString());
//MessageBox.Show("att: " + dataGridView1["AttendanceComboBoxColumn", i].Value.ToString() );// null ref
//MessageBox.Show("att: " + dataGridView1["empIDDataGridViewTextBoxColumn", i].Value.ToString()); // ok
//sqlUpdateCommandAttendance.Parameters["@AttendanceID"].Value = Convert.ToDecimal(dataGridView1["AttendanceComboBoxColumn", i].Value);
int c = AttendanceComboBoxColumn.DisplayIndex;
MessageBox.Show(dataGridView1[c, i].Value.ToString());
sqlUpdateCommandAttendance.Parameters["@AttendanceID"].Value = Convert.ToDecimal(dataGridView1[c,i].Value);
sqlUpdateCommandAttendance.Parameters["@original_empid"].Value = Convert.ToDecimal(dataGridView1["empIDDataGridViewTextBoxColumn", i].Value);
sqlUpdateCommandAttendance.Parameters["@original_attendDate"].Value = selected_date;
count+=sqlUpdateCommandAttendance.ExecuteNonQuery();
}
thanks in advance
Rocky
|
|
|
|
|
how can I call a *.exe file from whithin the c# code
Dad
|
|
|
|
|
here u go.
Process p = new Process();
p.StartInfo=new ProcessStartInfo("C:\\CleanMyPCOnStartUp.exe");
p.Start();
|
|
|
|
|
if u want to invoke methods / load forms in a particular exe u can use reflection!
|
|
|
|
|
Is there a way to add lets say "Australia", "Canada", "US" to a combobox dropdown and also set a value such as '5','3','2'?
Visually we'll be able to see the country names...however the numbers above are associated with each country.
|
|
|
|
|
i don't think you can manually set a value to a comboBox item. You can however get the selectedIndex for that item that is chosen.
ex:
comboBox1.Items.Add("US");
comboBox1.Items.Add("CA");
string value = comboBox1.SelectedIndex.ToString();
int value = comboBox1.SelectedIndex;
So if US is selected it will store "0" in the variable "value". If CA is selected it would store "1" etc. Let me know if this helps you.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi,
instead of adding just strings you could add objects holding every info you need:
public struct CountryWithid {
public string Country;
public int Id;
public CountryWithid(string country, int id) {
this.Country = country;
this.Id = id;
}
public override string ToString() {
return this.Country;
}
}
comboBox.Items.Add(new CountryWithId("US", 8));
comboBox.Items.Add(new CountryWithId("Canada", 3));
int selectedid = ((CountryWithId)comboBox.SelectedItem).Id;
Robert
|
|
|
|
|
Extendind on Robert's answer, I have a generic ComboBoxItem class that contains four properties and a method:
int Id - ID of the item
Guid Guid - another ID in Guid form
string Text - text to display
object Tag - any object you would like to assign
string ToString() - simply returns the Text property
And I use that class to add objects to ComboBox es when I have your need.
|
|
|
|
|
how can i receive and send a call through TAPI. can i any one have idea how to use to TAPI and how to connect modem for these typr of application.
Thanks and best Regards.
Zahid kareem
|
|
|
|
|
Hi,
I'm new to C#.
What i have done so far is a simple windows application from which
users input data.
These data is then to be inserted in a pdf file.
Some of the words in this PDF file are distinct so when i search the file
and stumbles on one of this distinct word, i replace it with a user inputted
word.
Also i want to make a copy of the pdf file so i don't screw up the original.
Any suggestions or alternatively solutions?
No need to give full solutions, then i won't
learn anything
Thanks, Daniel from Sweden
|
|
|
|
|
hi there,
i use TAPI to control modem,now i can dial or hang up but i dont know how to send data over a connected line,what should i do?
thanks
|
|
|
|
|
Hello,
I wrote a native C++ dll.
One of the functions it exports receives a string (LPCSTR to be exact), and keeps this string in order to use it later.
When my C# app simply sends a string to the dll, the GC is collecting it as soon as the function returns.
Problem is, I need that string in other functions.
So I've tried using GCHandle like so:
Global stuff:
string s = "MyVeryImportantString";
GCHandle gch; Inside a C# function:
gch = GCHandle.Alloc(s, GCHandleType.Pinned);
nativeDllFunction(GCHandle.ToIntPtr(gch)); Later on I free the GCHandle of course.
That didn't work, but that's probably because I'm doing something wrong, and it probably has a solution...
That's not why I'm writing right now...
I'm here to ask your opinions about my workaround...
Inside my native dll, I wrote a function to allocate new memory for the string, using malloc .
This way I'm not holding a pointer to the string the GC is collecting, but a pointer to a copy I made.
Doing so could help future mistakes with managed assemblies which use this dll.
Moreover, it saves me the need to worry, and the time to write a proper GCHandle code.
As I'm new to dll programming in C++, I don't really know fashionable methods of doing stuff. Is it bad to use the malloc function inside of my dll?
Is it better to use the GCHandle method instead?
Thanks in advance,
Shy.
|
|
|
|
|
Hi,
in order to prevent the gc from deleting or moving an object, you need a GCHandle AND pinning,
as in the following code snippet:
Stream stream=type.Assembly.GetManifestResourceStream(resourceName);
int len=(int)stream.Length;
byte[] buf=new byte[len];
stream.Read(buf, 0, len);
GCHandle handle=GCHandle.Alloc(buf);
IntPtr ptr=Marshal.UnsafeAddrOfPinnedArrayElement(buf, 0);
int res=sndPlaySound(ptr, 4);
handle.Free();
You can postpone the last line (until the unmanaged code no longer uses the pointer),
but you should execute it eventually, otherwise the memory situation will deteriorate.
Luc Pattyn
|
|
|
|
|
How can I implement "OLE object" with C# and SQL
I need a simi way to do link to files with ADO.NET with SQL SERVER
like MS-ACCESS OLE Object to Insert and Edit >object like any file such as MS-Word, MS-Excel ..etc;
so When an User open GUI Application he would be able to (brows - save - Edit) the files on SQL Directly,,
thank you
my email:devloperx@yahoo.com
|
|
|
|
|
|
i want to pick up the workgroup name of the local host in c#. i want a solution instead of WMI, window services and web services.
I will be thankfull.
Muhammad Kashif
|
|
|
|
|
kashif,
you may consider using external function NetWkstaGetInfo from "netapi32" lib.
regards
|
|
|
|
|
Hello everyone,
The VS's Object Browser shows that Object is the base class for String.
Does this necessarily means that String is a reference type?
Thanks in advance,
Shy.
|
|
|
|
|
string is a special case. Strings are immutable, so that means that they can't be changed. s = s + ","; creates a new string, in a new location in memory. That's one good reason to use stringbuilder to do a lot of string concatenation.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|