|
call the forms parent activate procedure
this.Parent.Activate()
or give the second form an argument (the main form)
<br />
class Form2 {<br />
Form1 myParentForm;<br />
...<br />
Form2 (Form1 parent) {<br />
...<br />
myParentForm = parent;<br />
...<br />
}<br />
...<br />
this.myParentForm.Activate();<br />
...<br />
}<br />
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
Actually I need Drill Down Crystal Reports.
Ex : 10 Mater Recodes are there.
TEST 1
TEST 2 liket that.
If I click TEST1,It should display another report TEST1 Details.Help me Please!
|
|
|
|
|
U can go for SubReport "On-Demand" Option.
Give the details in subreport. Insert subreport in main report and give the name as TEST1
All the best
|
|
|
|
|
Hi!Dear,
I released my c# project usbtest(Cs) and got the usbtest(Cs).exe.There is no problem when I run it on my own WinXP PC,but when I run it on other's WinXP PC or Win2000 PC,then error occurs:
Win2000:error name:usbtest(Cs).exe--cannot find DLL
error content:can not find DLL mscoree.dll in the appointed path. F:\;.;C:\WINNT\System32; C:\WINNT\system; C:\WINNT;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
WinXP: error name:usbtest(Cs).exe--application error
error content:application normal initialization (0xc0000135) fail.Please click "OK" to terminate application.
Can you tell what makes this error and how to work out it?
Thanks!
momer
|
|
|
|
|
Hello,
The .NET application must be installed to run a .NET application. mscoree.dll is a DLL that is installed as a part of the .NET framework installation. You cannot redistribute this DLL yourself, it must be installed with the .NET framework installer.
|
|
|
|
|
hi,Brian Nottingham,
Thank you very much!
But what my problem is not the .net itself I think. The vs.net can run on my PC without any trouble. the truble is my program can only run on my own PC(WinXP) where I develop it.when I run it on other PC(WinXP or Win2000) the error occurs.
If you like,I can email you my c# program usbtest(Cs).
Thank you again!
momer
|
|
|
|
|
Right, thats what I am saying. If you have VS.NET installed on your computer, then you have the .NET Framework installed, and thus your program works. If the other PC's do not have VS.NET installed, or the .NET Framework installed, then your program would not work.
|
|
|
|
|
Hi,Brian,
So,Do we have to ask our customs to install .NET Framework before use our application developed by C#.NET?
what if the application developed by VC.net?
And the .NET Framework package 1.1 is 23.5MB,is it necessary to force our customs to install the whole package? Maybe there is one or more alternative way to solve this problem.
momer
|
|
|
|
|
Hi,Brian,
So,Do we have to ask our customs to install .NET Framework before use our application developed by C#.NET?
what if the application developed by VC.net?
And the .NET Framework package 1.1 is 23.5MB,is it necessary to force our customs to install the whole package? Maybe there is one or more alternative way to solve this problem.
momer
|
|
|
|
|
Yes, your customers would have to install the .NET Framework before using any application developed in a .NET language. The .NET Framework is not required for C++\MFC, but it is however required if you use MC++.
|
|
|
|
|
Your customer MUST install the .NET Framework (the same version you developed your app under) in order to run your application.
If you app was written using C++/MFC, without using any managed extension, then you can get away with deploying your app without the .NET Framework. But, if your app was coded in Managed C++, then your customers will have to install the Framework in order to use your app.
There are projects out there that will strip down the .NET Framework and install only those components requires by your application, but this is NOT a recommended practice. It makes the Framework lighter in terms of disk space, but if your custom were to try and install a Service Pack for the .NET Framework, it won't work. Also, if you run into problems and must consult Microsoft on the issue, the FIRST thing they'll tell you to do is install the ENTIRE .NET Framework.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all,
(1)i've got 24 columns in my Ms access database. After selecting a row, i need to extract each of this value and store them in an array. Currently, i'm using this method which is kinda long:
foreach (DataTable getTable in graph_ds.Tables )
{
foreach (DataRow getRow in getTable.Rows )
{
//extract the values from the 24 columns
string a = getRow["col1"].ToString();
string b = getRow["col2"].ToString();
string c = getRow["col3"].ToString();
string d = getRow["col4"].ToString();
string e = getRow["col5"].ToString();
..........
string x = getRow["col24"].ToString();
..........
//store them in an array
float [] b = new float[24];
b[0]= float.Parse(a);
b[1]=float.Parse(b);
b[2]=float.Parse(c);
b[3]=float.Parse(d);
..........
b[23]=float.Parse(x);
}
}
Is there any other shorter method.?
(2)i've got 24 column in my database. after i've selected a row based on a certain condition, how do i get the biggest value in this 24 column?
Chris
|
|
|
|
|
why not just throw in another loop there so you dont have to repetitively read each of the 24 columns? Somthing like this:
<br />
<br />
foreach(DataTable dt in myDataSet.Tables)<br />
{<br />
int colCount = dt.Columns.Count;<br />
foreach(DataRow dr in dt.Rows)<br />
{<br />
float [] b = new float[colCount]<br />
for(int i=0;i<colCount;i++)<br />
{ <br />
string colName = String.Format("col{0}",i+1);<br />
b[i] = float.Parse(dr[colName].ToString);<br />
}<br />
<br />
}<br />
}<br />
|
|
|
|
|
I made up a bigger and explicit answer but i wasn't logged on so here is the short version :P :
(1)use the following loooop
<br />
for(int i = 0 ; i < 24; i++) {<br />
b[i] = Convert.ToFloat(getRow["col" + i + 1]);<br />
}<br />
(2)use a sort routine on the vector (actualy a get max value search the whole vector and store the biggest value)
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
hi, thanks for the reply. however, my column name isn't col1 to col24. it goes like this: date, 0000, 0100, 0200....1000,1200,1300..2300. i tried your method. Since i'm using this extracted data to plot a graph, i need to do twice for this:
for(int i = 0 ; i < 24; i++)
{
b[i] = Convert.ToFloat(getRow["0" + i + "00"]);
}
for(int j = 0 ; j < 24; j++)
{
c[i] = Convert.ToFloat(getRow[i + "00"]);
}
But i realise it's not possible to plot the graph. so is there another method where i can extract all the column data in just 1 for loop?
|
|
|
|
|
hi, thanks for the reply. however, my column name isn't col1 to col24. it goes like this: date, 0000, 0100, 0200....1000,1200,1300..2300. i tried your method. Since i'm using this extracted data to plot a graph, i need to do twice for this:
for(int i = 0 ; i < 24; i++)
{
b[i] = Convert.ToFloat(getRow["0" + i + "00"]);
}
for(int j = 0 ; j < 24; j++)
{
c[i] = Convert.ToFloat(getRow[i + "00"]);
}
But i realise it's not possible to plot the graph. so is there another method where i can extract all the column data in just 1 for loop?
anyway sorry for the annoymous msg haha
Chris
|
|
|
|
|
hey i managed to extract the information and plot the graph. thanks alot. anw i'm still stuck on hw to get the biggest value. like i say my column name goes like this: date, 0000,0100,0200.....,0900,1000,1100,..2200,2300. so how shu i go about getting the biggest value from column 0000 to 2300.?
|
|
|
|
|
hey thanks anyway, i solve on hw to get the biggest value.
Chris
|
|
|
|
|
I've written a DirectSound application in C# that controls the playback/streaming of audio data.
In my application, I have three UserControls. The code for each of these Controls performs a particular DSP task.
The following is added in the main form's constructor:
rbDSP1.Tag = new ControlFactory(ctlDSP1.Create);
rbDSP2.Tag = new ControlFactory(ctlDSP2.Create);
rbDSP3.Tag = new ControlFactory(ctlDSP3.Create);
On my main form, I have a panel that is used to display these controls. Clicking one of three radio buttons results in the corresponding control being displayed in the panel area.
The code for this is as follows:
private void DisplayControl(object sender, System.EventArgs e)
{
RadioButton rb = sender as RadioButton;
if (rb != null)
{
if (rb.Checked)
{
if (m_DSPControl != null)
{
panelControl.Controls.Remove(m_DSPControl);
m_DSPControl.Dispose();
}
ControlFactory cf = rb.Tag as ControlFactory;
m_DSPControl = cf();
if (m_DSPControl != null)
panelControl.Controls.Add(m_DSPControl);
}
}
}
public static Control Create()
{
return new ctlDSP1();
}
Just as an example, let's say UserControl ctlDSP1 just has a trackbar that acts as a volume control, and I need to obtain the value of the trackbar to control the volume of the playback buffer (whose code is in the main form).
I used Tom's suggestion (http://tinyurl.com/46yov), and it works.
However, I still face the following problem:
In the main form, how do I ensure that I am creating the Event Handler for ctlDSP1 and not for the other controls?
|
|
|
|
|
If I understand you correctly, you just need some type checking. You're already doing it with as (a safe cast), but you can also use is or a simple type check using GetType and typeof .
You might also consider using polymorphism instead of class factories, since activation in the .NET Framework - both for local and remote classes - is already handled by the Framework. IF all your controls implement the same interface you wouldn't have to worry about differences in types as long as your interface exposes the properties, methods, and events you need.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi all,
I am reading a file which contains 128 byte header and then the actual pixel data. The bit depth is 12bits with the data type given as LSB_MSB (i think it means the first 8 bits of first byte contains LSB's and the next 8 bits contains reamaining 4 MSB bits... am i right?). Means this image file data is 12 bit dpeth with a range of (4096) greylevels. Now I am trying to convert this into 24 bit BMP file means 8 bits per R,G,B layer, since this is a greylevel image we will have same R,G,B value which leaves us with 256 grey levels instead of 4096. Now how can i do this conversion... or should i have to ignore the 4 MSB bits and consider only 8 LSB bits and create an RGB image form it....please help me out.. its very urgent....
Plz atleast any suggestions or ideas are appreciated... I have posted already abt this many times(from 1 month)...but i dont know whether I am not clear to u all... since as this is a site full of experts, i think atleast one may know this...
thanks in advance,
Suman
|
|
|
|
|
I don't think you're right. Did you try to impliment what I suggested to you this morning ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi Graus,
Yeah I have implemented a program which reads my file byte by byte and shows them on a richtextbox...and i did get ur point of shifting but i dont know how to shift the values by 4 (as I am reading byte by byte, becos i have to use 2 bytes of data at time). I think if I get tht shifting, I can implement this conversion program in full.
One more doubt can I use the BitmapCreate function "CreateBitmap" in c# for creating new Bitmap for this data. If so should I have to copy all the data tht i read from previous file into an array and then pass it as the data pointer to this command...
thanks,
Suman
|
|
|
|
|
Hi Graus,
thanks for ur ideas.... and atlast I am almost done with my program (but i don't know whether it gives correct image or not). I am not getting your shifting thing. See we are having 2 bytes of data for each pixel naaa... in which first byte consists LSB bits. and in the next byte we are having MSB bits (does in this byte the first four MS bits are our data or the last 4 LS bits are our data). By shifting... wht kind of shifting are u suggesting... either circular shift(left or right) or just left/right shift of 4 values. after shifting which byte should we have to take (first byte or second byte) after shifting wht happens to the padded values or intial 4 bits. All these doubts are there in my head . Plz, help me out in this and I dont ask u again on this
Suman
|
|
|
|
|
Hi Graus,
Thanks for ur advices and I have done this conversion atlast by using a LUT for (4096 to 256) and will this produces a nice image or not?... actually first of all i read the data in byte format and look over it and it seems pretty much the same as i said the LSB bits in first byte and in the second byte the upper nibble are zeros and the lower nibble is consisting of remainin four bits. Wht i did is i read both bytes at a time and used the value of first byte to add with the calculated value by using the four lower bits of second byte like (Bit0*256+Bit1*512+Bit2*1024+Bit3*2048) which gives me a value ranging between (0 - 4096) and then i used the LUT for getting corresponding greylevel in (0-255) range. Can u tell me whether I am right or not?...
thanks,
Suman
|
|
|
|