|
Hi All,
You can set an application icon in the "Application" page of the project properties in visual studio. This works.
I can use the same icon for my filetype, assigned through the following registry key and value:-
HKEY_CLASSES_ROOT\MyFile\DefaultIcon\[default value] = c:\mypath\myexe.exe,0
Which uses the 0th icon in my app for the file type icon. But how can I add another icon embedded to the exe to use instead? Back in the VC6 / c++ days this was easy. the icons would of course end up being c:\mypath\myexe.exe,1
Many windows binary images have multiple icons in. How to implement this in c#?
Thanks
Jon
|
|
|
|
|
I would use a PNL package [Probabilistic Network Library in http://sourceforge.net/projects/openpnl[^]], but this package was in .cpp an .hpp, please help me to introduce this package in my project,
i work with C# .net VS2005, i don't know if the Visual Studio 2005 introduce .cpp an .hpp
thank you.
-- modified at 11:02 Tuesday 13th February, 2007
|
|
|
|
|
You can't mix languages. You can write a dll in managed C++, which uses these files, and uses a managed class to expose their methods to C#.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I wonder how many times that answer has been given to a question in this forum.. Just the last few days I know I have read it several times, and then I haven't even read all threads.. Is it really so that people doesn't read the first post, search articles here, and do not use google like ever??
Internet - the worlds biggest dictionary
|
|
|
|
|
The function Socket.AcceptSocket() creates a new socket for a connection, I can get
the remote host IP address from Socket.RemoteEndPoint.
but I want to know the remote host name(computer name), can i resolve the name from
an IP address?
-- modified at 11:45 Tuesday 13th February, 2007
|
|
|
|
|
Hi,
i didn't test this but found it by searching for the local PC name.
System.Net.Dns.BeginResolve
or
System.Net.Dns.Resolve
if you also write the server app. you can send it yourself by using this at server site.
System.Windows.Forms.SystemInformation.ComputerName;
or
System.Net.Dns.GetHostName();
hope it helps.
Greetz
Kurt
Okay i did a small test for you .. and seems to work (but depreceated).
System.Net.IPHostEntry tmp = System.Net.Dns.Resolve(textBox1.Text);
textBox2.Text = tmp.HostName;
fill in IP address in textbox1..
greetz
-- modified at 10:57 Tuesday 13th February, 2007
|
|
|
|
|
I think you should use
System.Net.Dns.GetHostByAddress(String address)
Regards,
Wasif Ehsan.
|
|
|
|
|
Yep. Also seems to work.
VS2005 suggests System.Net.Dns.GetHostEntry() when compiling.
so there are several ways...
greetz
Kurt
|
|
|
|
|
I was trying to "upper" cast a class. I looked like this but I get a Exception. Is there anyway to have a extended class and cast to it?
public class FirstClass {
}
public class SecondClass : FirstClass {
}
public class Main {
public Main()
{
FirstClass iFirstC = new FirstClass();
SecondClass iSecondC = (SecondClass)iFirstC;
}
}
I get a error on the line.
SecondClass iSecondC = (SecondClass)iFirstC;
|
|
|
|
|
While syntactically correct, executing that statement will throw an exception, since an instance of iFirstC is not of type SecondClass . If you prefer not to handle exceptions, you should use the as operator and check for null .
SecondClass iSecondC = iFirstC as SecondClass;
if (iSecondC == null) {
}
/ravi
|
|
|
|
|
You can only cast SecondClass to FirstClass, but not FirstClass to SecondClass.
FirstClass is parent, SecondClass is child.
|
|
|
|
|
Matglas wrote: Is there anyway to have a extended class and cast to it?
Only if the object is of the "extended class" (aka derived class).
The following will work:
FirstClass iFirstC = new SecondClass();
SecondClass iSecondC = (SecondClass)iFirstC;
This is because the actual object is a SecondClass even although it is initially referenced as a FirstClass .
Does this help?
|
|
|
|
|
Thanks all for the great input. I start to understand it better now. So it does help.
|
|
|
|
|
Hey.
I was wondering if any one can point me towards some resources that outline/explain the dangers associated with allowing users to upload image files to a web server.
I shall be using the MIME type as one step of validation and maybe limit uploads to jpeg so i can read the file header and associated data as validation (not fool proof i know).
Any advice on validation and the dangers will be much appreciated.
Cheers
Dan
|
|
|
|
|
Can you write me an insert statement to insert an integer and a Date data types values in dBase dbf table?
|
|
|
|
|
hi, i'm trying to make a real time audio streaming application using directSound. but the problem is i do not know how to transfer the audio bytes received to directSound buffers and eventually play it while filling in the buffer with data...please, can anyone help me out with this very big dillema...my future depends on the completion of this project.. :c
mumwei :c
|
|
|
|
|
I am writing a Windows Mobile CE 5.0 c# application, and I want my form to be completely full screen, and not movable. I have been able to make the form unmovable and maximized. However, want it to cover the task bar as well on the PDA device (it's a symbol one).
I have done some PInvoke calls to hide the task bar. But still, when setting the form WindowState property to Maximized, it does not take up the blank space left by the task bar. Any help please?
Ashvin Gunga
|
|
|
|
|
Hi,
I already worked on the problem, and it's working fine. Cheers.
Ashvin Gunga
|
|
|
|
|
Hi there,
I'm trying to Parse the Value of an Excel Cell into its correct Data Type. (I read the excel sheet then add all cell values into an object array).
Trouble is, (DateTime.TryParse(value, out newDateTime) returns false, where the Excel Value (value ) is '01/01/2007', but is passed in as '39083' - an int.
Now, I can't just assume '39083' is a valid date, as is could be a valid int.
Any suggestions?
Thanks
Jon
|
|
|
|
|
I want to sort the dataview based on the column AVG_VALUE which is of type double, i have written the following code, but it is not sorting.
DataView dv = ds.Tables[0].DefaultView;
dv.Sort = "AVG_VALUE DESC";
table structure
AVG_VALUE VARIABLE_NAME
11.1 Var1
12.2 Var2
1.1 Var5
40.2 Var6
Output Required
AVG_VALUE VARIABLE_NAME
40.2 Var6
12.2 Var2
11.1 Var1
1.1 Var5
|
|
|
|
|
If you have Spaces in your field names or Reserved words then you have to put field name in [] to get it to work.I think it should work like this:
DataView dv = ds.Tables[0].DefaultView;
dv.Sort = "[AVG_VALUE]DESC";
|
|
|
|
|
Hello,
I want to do some windows API operation from C#.
and for that i want to import user32.dll please
give me specific syntax for importing dll from the
.cs page at runtime
Rahul Patel,
Software Engineer,
Gateway Technolabs
-- modified at 6:26 Tuesday 13th February, 2007
|
|
|
|
|
[DllImport("user32")]
private static extern UInt32 GetKeyboardLayoutList(int nBuff,ref int lpList);
|
|
|
|
|
thank a lot for giving me a solution....
|
|
|
|
|
You need to use something like this:
[DllImport("user32.dll")]
< Declaration of function in user32.dll to be used here preceded by static extern >
You have to declare each function you want to use in C# code in the above manner.Moreover you should write this code where you are declaring other variables of your class which is normally at the start of the class.
After that you can use those functions in your C# code. Keep in mind that all the types used while declaring function prototypes must be C# types and must not contains Win32 or other languages types.
Regards,
Wasif Ehsan.
|
|
|
|