|
Try the sandcastle help forums. I suspect, if it's possible, the answer will be there.
|
|
|
|
|
In C# code how can I detect if Directx9 is installed on the user machine?
|
|
|
|
|
You can check the value of the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX\Version registry key. This table[^] will show you the version according to the version number. For example 4.09.00.0904 is DirectX 9.0c .
2A
|
|
|
|
|
I was able to do this on XP but I can't get any code to work on Win X64 could you give me an example.
TNX
|
|
|
|
|
You have to look at the same path under the SOFTWARE\Wow6432Node\...
|
|
|
|
|
This seems to be working. Any suggestions? I guess I will have to identify the OS and have an alternative for XP - right? Many thanks!
public void readRegistryForDX9()
{
RegistryKey rk = Registry.LocalMachine;
RegistryKey sk = rk.OpenSubKey("SOFTWARE\\Wow6432Node\\Microsoft\\DirectX");
string temp = (string)sk.GetValue("Version");
if (temp.IndexOf("4.09")<0) MessageBox.Show("Directx 9 Must be installed");
else MessageBox.Show("Directx 9 already installed");
return;
}
|
|
|
|
|
You don't need to "read the OS". You just look under one registry path and if the value isn't there, you look under the other one. If it's not under either, DirectX isn't installed.
|
|
|
|
|
What Dave said above should do it.
One note though - be sure to free any resources used by the RegistryKey objects - encolsing them in using statements is good:
using (RegistryKey sk = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wow6432Node\\Microsoft\\DirectX"))
{
}
It's also good practice to check sk for null as if the key's not present on the system sk.GetValue("Version") will thrown an exception.
P.S. No need to explicitly return from a void method.
2A
|
|
|
|
|
|
i set the dataSource to datagridview
DatTbl = CustomerManger.SelectCustomersAllDT();
ds.Tables.Add(DatTbl);
DatTbl.TableName = "Customers";
dgvCustomers.DataSource = null;
dgvCustomers.DataSource = ds;
dgvCustomers.DataMember = "Customers";
then is selectionChange event i Select another data in list and before set it to listbox datasource .. datasource of datagrid change and all columns and data of customer cleared and replaced by Notices ???????
private void dgvCustomers_SelectionChanged(object sender, EventArgs e)
{
NoticList NL=NoticeManager.SelectNoticesbyCustCD(newCust.CustId);
}
if i comment this line datasource of datagrid view doesn't change
|
|
|
|
|
I don't know. You probably need to show more code.
And you don't need the DataSet, you can use the DataTable (or preferably its DefaultView) as the DataSource.
|
|
|
|
|
hi, I'm trying to get multiple values that was selected in a dropdown list, the problem is that it's only returning one value, if I select two or more values only give me one, here's the code:
List<String> dep = new List<String>();
foreach (ListItem item in sltnamedep.Items)
{
if (item.Selected)
{
dep.Add(item.Text);
}
}
for (int i = 0; i < dep.Count; i++)
Response.Write(dep[i]);
|
|
|
|
|
is the MultiSelection is enabled for the listView? can you print/check the number of selected items using sltnamedep.Items.Count property
Jibesh V P
|
|
|
|
|
Make sure you have focus on the control.
MSDN says:
Quote: Items appear selected only when the ListView control has focus. To select items in response to a user action such as a button click, be sure to call the Focus method in addition to setting this property.
|
|
|
|
|
Hi I created i project using a reference to a dll (Microsoft.Office.Core).
I'm going to port this project on different computers, and it happens that this assembly is under different path.
So to be able to use the project I need to update the reference.
Is there a way to let know the project to look for the correct path of the .dll?
|
|
|
|
|
See some of these answers[^]; this DLL comes with MS Office, so you need that installed on the target system.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi I have created a word document where user fill in details. Now i want to save those details when the user close the word document.
Thank you in advance
|
|
|
|
|
Using an UPDATE statement, to update the database. You'd use an IDbConnection to connect to the database, and use a IDbCommand to execute the SQL-statement.
Post some code if you're stuck, or get a good introductionary book if you don't know where to begin.
|
|
|
|
|
Hi,
How to read a jpeg image from the binary data in a file in C#? Here, image is stored as a bindary data in the file.Now i need to construct a image from this data.
|
|
|
|
|
Assuming that the data is a Jpeg file, just stored as binary:
byte[] bytes = File.ReadAllBytes(path);
MemoryStream ms = new MemoryStream(bytes);
Image returnImage = Image.FromStream(ms);
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
Thanks Griff..But this gives "Argument Exception" saying parameter is not valid.
|
|
|
|
|
Then I suspect that the data is not a jpeg file - what are you trying to do? Not "read a file as an Image, but what is the file? Why are you reading it? What are you trying to achieve? It may be that one of use is using the wrong terms!
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
I need help on how to capture windows messages.
|
|
|
|
|
|
What technology are you using? Windows Forms or WPF? If you're using WinForms, there's an implicit WndProc that you can add your code into. If it's WPF, things get a little more complicated as you have to add your own WndProc handler.
|
|
|
|