|
while writting WMI application, i could read many values by means of System.Management namespace.
many examples show how to read the values in Win32_class.
my question is : How to modify the value in Win32_class using System.Management namespace ?
there are some methods which might do this work such as Put(), SetPropertyValue(). But How to use them ?
|
|
|
|
|
I'm using Media Player to play media files, and my problem is getting it to play multiple files where my code does the queuing. I get a medaEnded message, but if I queue another file, it doesn't play. Does anyone have any ideas ?
And anyone who suggests DirectX will be shot. DX9 is an absolute joke, that's why I'm trying to get the core of my app working with Media Player 3 days before I deliver the application.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Heath Stewart wrote:
CharSet=CharSet.Auto
Gotcha, I'll try an be more complete next time. Thanks.
- Nick Parker My Blog | My Articles
|
|
|
|
|
thx for your answer...but i already have the handle of the window...all i want is to get the urls of the address bar in case of the IE or the opened folder in case of he Explorer ...how can i accomplish this?
thx for your time
|
|
|
|
|
Hello Gurus,
I deployed a windows-based applications with some crystal reports on client machines. Running the reports popped up the following error on client machines.
Error: Cannot find KeycodeV2.dll, or invalid key
Where can I find the "LicenseKey" tag to enter my registered key code?
Thanks gurus, with another $million,
Khang
===================================================================
Crystal Reports Rep. gave me the following instructions but I could not find it at all:
This error may occur if the LicenseKey value is not entered. Kindly follow
the steps given below to enter the value:
* Right click "Project" in the Solution Explorer
* Click "Add" and then "Merge Modules".
After clicking "Merge Modules" it will have a property "LicenseKey" in which you can enter the value.
|
|
|
|
|
When you first started the Crystal Reports tool in Visual Studio .NET, it prompted you to register. This email - per the instructions on the screen when you finished registering - includes your registration information that needs to be entered to use the designer, as well as the Crystal_regwizXXXX.msm merge module if you're building a Windows Installer project.
Read Deploying Crystal Reports in .NET Applications[^] in the Visual Studio product documentation.
If you're using the standalone edition, you need to read the instructions for the steps required to accomplish what I outlined above. I doubt that it's very different, and the merge modules should be the same.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hello Heath,
Thank you so much for replying so quickly. Yes, I already registered my Crystal Reports product for MS Visual Studio 2003.
As I understood from the Crystal Reports Rep., after adding the merged module "Crystal_regwiz2003.msm" to the Setup Project, I will have a KeyCode tag to enter my registered key code. However, I could not find this tag any where. And I still get that run-time error.
Thanks,
Khang
|
|
|
|
|
In Visual Studio (or whatever you're using to create your Windows Installer package), select the Crystal_regwiz2003.msm merge module. In Visual Studio, right click and select Properties. This displays the PropertyGrid. In there is a custom property that should be obvious. I don't have this machine set up for that right now, but - like I said - it should be obvious.
Set the property value ot your key code, recompile the package, and redeploy it. This is also covered in the documentation for which I gave you a link.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I got it. It was hiding under the "MergedModuleProperties" tree. I expanded the tree and saw that property.
You're great, Heath. I guess life is very sweet at Microsoft?
Thanks so much
Khang
|
|
|
|
|
Hi,
I have a file which contains 13726 names on a text file (my school's students' names). Every line contains one name. And I have a textbox on a form which gets the name of the file and when I press the button it has to make seperate files which has 300 names in it. I mean I have to seperate these 13726 names on different files which has must contain 300 names and the last one must have 276 names in it. I made my button's function like below:
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
int a=1; int b=1; int k;<br />
StreamReader re = File.OpenText(textBox1.Text.ToString()+".txt");<br />
string input = null;<br />
ArrayList arrText = new ArrayList();<br />
while ((input = re.ReadLine()) != null)<br />
{<br />
arrText.Add(input);<br />
if(a%300 == 0)<br />
{<br />
FileInfo t = new FileInfo(textBox1.Text.ToString()+"_"+ b + ".txt");<br />
StreamWriter Tex = t.CreateText();<br />
for(k=(b-1)*300;k<(300*b)+1;k++)<br />
{<br />
if(k==0)<br />
{<br />
Tex.WriteLine(arrText[k+1]);<br />
}<br />
else<br />
{<br />
Tex.WriteLine(arrText[k]);<br />
}<br />
}<br />
Tex.Write(Tex.NewLine);<br />
Tex.Close();<br />
}<br />
a++;<br />
}<br />
re.Close();<br />
}<br />
but I couldn't get a result so any help would be greatly appreciated...
Thank you,
Cem Louis
|
|
|
|
|
Ok lets start right at the beginning - there were quite a few issues with this block of code.
1.) The reason why nothing gets written to begin with is that your test
'a%300 == 0'
Will only do something every 300 items. The test you want to make is
'a%300 != 0' since for every item BELOW 300 you will always get a
remainder (e.g. 1%300 = 1, 2%300 = 2 etc)
2.) Having got the code to move past this first check we then have a problem with the next for loop because you may not necessarily have 300 items in your array - in fact you'll only have one the first time through.
3.) Also I am curious why you are adding 1 to K for the first every entry
cemlouis wrote:
if(k==0)
{
Tex.WriteLine(arrText[k+1]);
}
Since again the first time through you will only have one item in the array and arrays are ZERO indexed.
4.) I would recommend reading in the entire array and then writing out the contents in 300 blocks and then whatever is left for the last block. I would also suggest writing out the new files as XML since it will be easier to PARSE later and also can be used to show the information with little extra work on your part.
Hope that this helps a little
Markgr
|
|
|
|
|
Hello Gurus,
How can you find out which row and column when the mouse hovers or moves over a DataGrid control? Not Mouse clicking! I'm in C#; I guess it's similar for VB.NET.
Thanks with a $million,
Khang
|
|
|
|
|
Check out the MouseHover and MouseMove events, you will just need to write a handler method for whichever you decide to monitor. You can perform a HitTest[^] to get additional information as well.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thank you so much, Nick. I will try it out.
Khang
|
|
|
|
|
I am using C# to write a test executive to control different instruments and need to be able to set properties of controls from different classes while not in the form class. any ideas
Greg
|
|
|
|
|
The other classes need to have a copy of your form class, and it needs to expose properties to set the values in question. Or, a nicer way to do it is to set events that, when fired, set the values in question, and subscribe the classes that set the properties to fire those events.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
The other classes need to have a copy of your form class
You should use the term copy carefully. Since controls are reference types, another class needs a reference to that control. One could always enumerate the public Control.Controls property as well, meaning that you wouldn't need to have a reference to that specific control at execution time so long as you could identify it.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath I was messing around with enumeration and was wondering if you had some code available. I know VB.NET real well but have just started working with C#.
GregD
|
|
|
|
|
You should start by reading the Visual C# Language[^] reference in the Visual Studio product documentation. Just fumbling around won't give you the building blocks you need. I'm all for self-discovery, but a basic amount of knowledge has to be acquired (like a language), not so much learned. Even just browsing the keywords (like foreach I'll use in a moment) can help immensly.
Enumeration in C# is rather easy:
int[] nums = new int[] {1, 2, 3};
foreach (int num in nums)
Console.WriteLine(num); This is compiled to this similar code:
int[] nums = new int[] {1, 2, 3};
IEnumerator e = nums.GetEnumerator();
int num;
while (e.MoveNext())
{
num = (int)e.Current;
Console.WriteLine(num);
} This code is universal to any managed language, since it uses classes defined by the CLI. You can enumerate anything that implements IEnumerable (this includes ICollection and IList implementations, since ICollection inherits IEnumerable and IList inherits ICollection ) this way.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
|
You can compare more than just days. One simple (and there are many) comparison would be:
DateTime now = DateTime.Now;
if (now > now.AddMonths(-6))
The TimeSpan lets you build a span that includes more than days as well. Since both DateTime and TimeSpan are structs (value types), keep in mind that methods like AddMonths do not change the referenced struct.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
hi all.. i'm developing a program that get the current processes that are running on the computer and if any process has i user interface getting the name of this GUI of the process...i'm checking if the process has MainWindowHandler...if so i'm getting the process MainWindowTitle....it is working fine but for processes such as Explorer.exe or Iexplorer.exe ... the MainWindowTitle doesn't return anything...i wanna return the urls that the ie launching ...or the folders that are opened now...how can i accomplish this??
thank for ur time
|
|
|
|
|
You will need to P/Invoke quite a bit here. FindWindow , FindWindowEx and GetWindowText will be used more than likely. The class name of Internet Explorer is "IEFrame", so you can start by doing something like the following:
[DllImport("user32.dll")]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
IntPtr pIE = FindWindow("IEFrame", null);
if(pIE != IntPtr.Zero)
{
}
Once you have the Handle to the window, you will want to find the handle to the address bar. I'm not sure but I think the class name for that is either "ComboBox" or "ComboBoxEx32". This should get you started.
- Nick Parker My Blog | My Articles
|
|
|
|
|
You forgot one important thing:
[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
IntPtr pIE = FindWindow("IEFrame", null);
if(pIE != IntPtr.Zero)
{
} [To the original poster] Without that, only the ANSI version of the function would be used; you would not be able to find Windows with Unicode text, plus you would be unnecessarily converting the encoding on Windows NT (i.e., Windows NT 4, Windows 2000, Windows XP, Windows 2003, "Longhorn", and all future Windows OSes), which natively supports Unicode (same as the .NET Framework).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I have two groupboxes in my application form. The user chooses an input type in the first groupbox and then a DSP function in the second.
I would like to implement the following:
1. Choose a particular DSP function by clicking the corresponding radio button.
2. Each DSP function has a set of parameters that can be changed by the user. These function-specific parameters are stored in groupboxes specific to the DSP function.
i.e.
DSP_Function_1's parameters can be set using GroupBox1,
DSP_Function_2's parameters can be set using GroupBox2, etc.
All parameter related groupboxes are of the same size and open in the same space.
Also, I want these groupboxes to open in my main form and not a separate form.
What would be the simplest way to implement this?
|
|
|
|