|
XP visual styles
If you are using NET Framework 1.0 you have to add a manifest file to your project and choose the build action of that file to content. The manifest file should follow the naming convention yourappname.exe.manifest and its content should include the following:
<?xml version="1.0" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>Insert Application Name/Description here</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="X86" />
</dependentAssembly>
</dependency>
</assembly>
If you are using .NET Framework 1.1 either follow the same method or use Application.EnableVisualStyles() method.
sql 2000 database
Your setup project has to check if SQL Server or MSDE is installed before it actually installs your program. This is done by creating a Launch Condition in the setup project. You also need to create the database on the user's computer. This is done by creating a Custom Action in your setup project.
Also, in case SQL Server or MSDE is not present, you might want to include a MSDE installation in your setup project. This can also be done creating a Custom Action in your setup project.
|
|
|
|
|
this sucks...
/\ |_ E X E GG
|
|
|
|
|
I forgot how to do it. How do I access a private/protected member of another class using system.reflection?
|
|
|
|
|
I didnt know that was possible.
To those who didn't make it, we will remember you. To those who did is back. - Megan Forbes in Black FridayAnother Post by NnamdiOnyeyiri
|
|
|
|
|
Never mind I figured it out
|
|
|
|
|
I'm creating a file in a dll with:
invoke CreateFile, addr logfile, GENERIC_READ or GENERIC_WRITE, FILE_SHARE_READ or FILE_SHARE_WRITE, 0, CREATE_ALWAYS, 0, 0
and then trying to open it for read access with:
fs = new FileStream("whlog.log", FileMode.Open, FileAccess.Read, FileShare.Read);
which always gives me:
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The process cannot access the file "C:\<path>\whlog.log" because it is being used by another process.
What gives?
|
|
|
|
|
grv575 wrote:
which always gives me:
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The process cannot access the file "C:\\whlog.log" because it is being used by another process.
What gives?
simply what it said either your program has already attached to it without a share or you have not released it yet in previous code. You might check the application tabs on task manager and see if your program did not shutdown correctly. Its happened to be during devlopment before
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Yes but I did give a fileshare flag. Would think that would allow me to open the file again as long as I still supply the same fileshare flag.
|
|
|
|
|
Weel another app has to be putting a lock on it or your not releasing a lock. try opening it in word and see if its being held.
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I am trying to get assembly info from the AssemblyInfo.cs file, but for some reason I get a null returned for attributes that I specified. Specifically, I provided values for the AssemblyTitle and AssemblyDescription field but both return empty. Any ideas on this ?
public ArrayList GetOmsList()
{
ArrayList drivers = new ArrayList();
DirectoryInfo driversFolder = new DirectoryInfo(dirPath); //direcotry path of drivers
if (driversFolder.Exists.Equals(false))
{
Console.WriteLine("Drivers Path Does Not Exist");
//break out of the following code
}
FileInfo[] allFiles = driversFolder.GetFiles("*.dll");
if (allFiles.Length == 0)
{
Console.WriteLine("No Dlls Found");
}
foreach (FileInfo f in allFiles)
{
string fileName = f.FullName;
try
{
Assembly a = Assembly.LoadFrom(fileName);
Type[] types = a.GetTypes();
foreach (Type t in types)
{
if (t.GetInterface("IDriver", true) != null)
{
object[] attributes = a.GetCustomAttributes(true);
foreach (object attribute in attributes)
{
if (attribute is AssemblyTitleAttribute)
{
drivers.Add("title"+((AssemblyTitleAttribute)attribute).Title);
}
else if (attribute is AssemblyDescriptionAttribute)
{
drivers.Add(attribute);
drivers.Add("descript"+((AssemblyDescriptionAttribute)attribute).Description);
}
}
drivers.Add(t.Name);
Console.WriteLine(t.FullName + " Implements Driver Interface");
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message.ToString());
}
}
return drivers;
}
|
|
|
|
|
I think those two attributes are converted into information in a version resource, and not retained as attributes. You should be able to access them via FileVersionInfo.GetVersionInfo() .
Burt Harris
|
|
|
|
|
What is the graceful way of moving your data to byte[]'s to be sent over the wire? In C++, I'd do something like this
struct SomeDataHeader
{
AnEnum SomeDescriptiveFlag
DWORD dwDataLength
}
void SendThis(SOCKET &rS, LPCTSTR szData)
{
SomeDataHeader h;
h.SomeDescriptiveFlag = SDH_RANDOMSTUFF;
h.dwDataLength = lstrlen(szData) + 1;
BYTE *pbData = new BYTE[sizeof(h) + h.dwDataLength];
memcpy(pbData, h, sizeof(h));
memcpy(&pbData[sizeof(h)], szData, h.dwDataLength);
Send(rS, pbData, sizeof(h) + h.dwDataLength);
}
(Note that this code is pretty sloppy/probably not right, but you get my idea)
What I'm trying to do is send arbitrary data over the line; What's the best way to do this?
|
|
|
|
|
Assuming you have a string:
string dataToSend = "lotsandlotsandlotsofdata";
Byte[] buffer = System.Text.Encoding.ASCII.GetBytes(dataToSend);
|
|
|
|
|
Can anyone tell me how to programmatically select a listview item in a windows form listview?
I want to force an item to be selected based upon its text.
Thanks,
|
|
|
|
|
lv.SelectedItem = lv.Items[0];
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I've tried this and it doesn't seem to work, I get a compile error when I tried this.
|
|
|
|
|
The ListView does not have a SelectedItem property.
It has a SelectedItems property but is readonly.
The proper way is to set the item's Selected Property
to true; There are also a bunch of methods to help
Like EnsureVisible( index ), TopItem and so on.
Bo Hunter
<marquee behavior="alternate">Bo Hunter
|
|
|
|
|
So after I set a listviewitems's selected property to true, how can I programaticaly select that item in the listview?
Is this even possible? I can't find anything on the net about this.
|
|
|
|
|
C#:
<font color="blue">private</font> <font color="blue">void</font> button1_Click(<font color="blue">object</font> sender, System.EventArgs e)<br> {<br> listView1.Items[1].Selected=<font color="blue">true</font>;<br> MessageBox.Show(listView1.SelectedItems[0].Text);<br>}
Csharp™ the coder formally known as dynamic
Me.twins.duedate = DateTime.Now.AddDays(+17).ToLongDateString Me.Birthday = DirectCast(Me.twins.DueDate, DateAndTime.SameDay)
|
|
|
|
|
I added listView1.Items[1].Selected=true; to my function and it still doesn't highlight the selected item for me. Is their something I'm not doing correctly?
|
|
|
|
|
Set the HideSelection to false;
Bo Hunter
<marquee behavior="alternate">Bo Hunter
|
|
|
|
|
Make sure you call the Focus() method of the listview after selecting the listviewitem.
|
|
|
|
|
lvOfficeNote.Items[0].Selected = true
is how you would do it
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I recently wrote a pocket PC version of the game Simon. so far it is coming along nicely, but i still havent incorporated sound into the game! it would be nice to have 4 distinct tones that will play when each of the four colored buttons lights up. i am not sure how to do messagebeeps or any other sounds in C#. also, i dont even know if they will port to the pocket PC properly... any thoughts?!
-613 "Code Poet"
"Real programmers don't work from 9 to 5. If any real programmers are around at 9am it's because they were up all night."
|
|
|
|
|
Strat613 wrote:
"Real programmers don't work from 9 to 5. If any real programmers are around at 9am it's because they were up all night."
Uhh yeah unless they have a family then they get 2 hours sleep
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|