|
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?
|
|
|
|
|
Hi there!
I am a newbie in C#, and I am making a program using the AVIFile.
Now I have a problem, it seems that the functions getframeclose() and close() from avistream and avimanager doesn’t release all the memory that they use.
In the task manager the "Mem Usage" increase to 90000K when in the start it was 13000k.
The problem is in this group of instructions, the only thing that I want is one frame of the video.
AviManager aviManager = new AviManager(aux, true);
VideoStream aviStream = aviManager.GetVideoStream();
aviStream.GetFrameOpen();
Bitmap bmp = aviStream.GetBitmap(Convert.ToInt32(Position));
aviStream.GetFrameClose();
aviManager.Close();
With this group of instructions the "Mem Usage" in the task manager increases 20000k!!!!
I don´t think that this is the size of Bitmap, Am I wrong?!
How can I solve my problem?!
COuld you help me?!
Thanks you very much, Sérgio Órfão
|
|
|
|
|
Deterministic finalization (or lack there of) has been a large debate ever since .NET was release in beta. You should read up on garbage collection, which is what .NET uses to clean up resources. There are several articles here on CP and MSDN, here are a few:
Garbage Collector Basics and Performance Hints[^]
Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework[^]
Quick tip, if your objects implement IDisposable interface, wrap them in a using statement. This will automatically emit try/finally blocks around your code and then call Dispose on the object for you. An example:
using(Bitmap b = new Bitmap(32, 32))
{
}
Looks like:
try
{
Bitmap b = new Bitmap(32, 32);
}
finally
{
b.Dispose();
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
First of all, I want to thank you for your reply.
I was trying to implement your suggestion but when I put this instruction
using(AviManager aviManager = new AviManager(aux, true))
the compiler gave me this error
Cannot implicitly convert type 'AviFile.AviManager' to 'System.IDisposable'
Is it possible to makr my object implement IDIsposable interface?!
If not, how can I do the Dispose function?!
I tried this way
public void Dispose()
{
Finalize();
System.GC.SuppressFinalize(this);
}
But didn´t work =/
Can I make a dispose function for this class?!! If yes, how?!
Thanks again, Sérgio
|
|
|
|
|
If you have written the AviManager class you can obviously change it to include the IDisposable interface (and obviously implement the Dispose method), otherwise you can subclass the AviManager and thus implement the IDisposable interface. You will need to know how to clean up the resources in AviManager .
public class MyAviManager : AviManager, IDisposable
{
void Dispose()
{
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Adding a method isn't enough - you have to implement the interface that defines that method. Just do what Nick said.
You NEVER call Finalize() - especially not in IDisposable.Dispose . You really should read Implementing Finalize and Dispose to Clean Up Unmanaged Resources[^].
Also, if you're not going to free native resources, there's no reason to implement IDisposable . The GC will release managed resources, but unmanaged resources (i.e., file, graphics, images handles, etc.) you must release (or release from other objects by calling their IDisposable.Dispose implementation, if possible).
The Bitmap in your first code snippet is currently the only thing that implements IDisposable , so you should use using as Nick suggested.
Be sure to read that link I posted above to learn more about IDisposable and managed and unmanaged resources.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi,
I'm writing a logging utility and I need to wrap the string.Format method. I'd like to call the Trace method of MyLog like this:
<br />
MyLog.Trace("Var1:{0};Var2:{1};", MyVar1, MyVar2);<br />
The Trace method should then use the string.Format function to produce a properly looking string. I thought the signature for my Trace method should be:
<br />
public void Trace(string s, object[] args){};<br />
But the compiler complains:
cannot convert from 'string' to 'object[]'
when coding:
<br />
string sFun = "Hello World!";<br />
MyLog.Trace("Say {0}", sFun);<br />
How can this be done? Any help is greatly appreceated.
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
Matthias Steinbart wrote:
public void Trace(string s, object[] args){};
Change it to:
public void Trace(string s, params object[] args)
- Nick Parker My Blog | My Articles
|
|
|
|