|
Dear Navaneethkn,
Thanks for a nice reply. Indeed it was helpful.
Thanks,
Arindam D Tewary
|
|
|
|
|
Well, option 1 means that Q is derived from P. This means that it has access to protected methods in P. Consider the following:
class P
{
protected bool IsValid { get { return ... ; } }
}
class Q : P
{
public void Validate()
{
if (IsValid)
...
}
}
Now, you can't do the same with the following:
class R
{
private P foo = new P();
public void Validate()
{
if (foo.IsValid) ...
}
}
What you are seeing is explained using IsA and HasA relationships. In the case Q, we say that Q is a P - there is an implicit inheritance chain and Q has access to certain *exposed* portions of P. In the case of R, we say that R has a P - no inheritance chain, and no access to the internals of P.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Dear Pete O'Hanlon
Excellent !! I am sure this is what I was looking for .... and the way you have presented is awesome. Thanks a lot !!!!
Thanks,
Arindam D Tewary
|
|
|
|
|
What you use depends on what is logical in the relation between the classes.
Inheritance is used when the objects are basically the same. Like an airline pilot is also a person, so the class AirlinePilot would inherit from the class Person.
Class members are used when one object is a part of or a member of another. An airline pilot is not the same thing as an aeroplane, but rather a part of it, so the AirlinePilot object would be a member of the AeroPlane class.
---
single minded; short sighted; long gone;
|
|
|
|
|
Dear Guffa,
Thanks for a nice reply. Indeed it was very much helpful.
Thanks,
Arindam D Tewary
|
|
|
|
|
My MaintenanceLog table has an entry with following data in a row.
Name: Toney Mirra
ActualDateTime: 2007-02-16 12:55:02.867
PlannedDateTime: 2008-12-05 20:08:57.000
Comments: Sample Entry
But when I run the following query it doesnt return any value.
I think there is some problem in DateTime format. Can anyone help me fixing this?
select Comments from MaintenanceLog where
ActualDateTime = '2/16/2007 12:55:02 PM' and
PlannedDateTime = '12/5/2008 8:08:57 PM'
|
|
|
|
|
sks83 wrote: I think there is some problem in DateTime format. Can anyone help me fixing this?
Well, in general you should use the ISO format because it is culture neutral. YYYY-dd-MMTHH:mm:ss.fff
Your query doesn't work because there is no data that maches. Your ActualDateTime is 867 milliseconds out from what is stored in the database.
|
|
|
|
|
Could anybody help me please? Is there any way to displaying flash animations on C# forms?
jaye
modified on Monday, September 12, 2011 12:05 PM
|
|
|
|
|
www.componentone.com one of the components (C1Flash) can do that
VirtualVoid.NET
|
|
|
|
|
you can host a browser control on your form and then you should be able to load flash in that
Russell
|
|
|
|
|
Hi to All,
I am working on a project in which i have to read data from an Excel file , processing them and write them to another excel file .my codes for reading the data and writing the data in excel are working in diffent application but when i merge them it gives me error
"Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: An outgoing call cannot be made since the application is dispatching an input-synchronous call. (Exception from HRESULT: 0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))."
help me.
sachin jangir
|
|
|
|
|
|
hi Navneeth
Thanks for ur concern ,
here is my code
initailizing code:
Microsoft.Office.Interop.Excel.Application objExcel = new Microsoft.Office.Interop.Excel.Application();
code for Reading from excel:-
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
Workbook CallListWorkBook = objExcel.Workbooks.Open(openFileDialog1.FileName, 0, true, 5, "", "", true, XlPlatform.xlWindows, "\t", false, false, 0, true, 0, 0);
Sheets CallingSheet = CallListWorkBook.Worksheets;
Worksheet worksheet = (Worksheet)CallingSheet.get_Item(1);
Range CallingRange = worksheet.get_Range("A1", "A1");
CallingRange = CallingRange.get_End(XlDirection.xlToRight);
totalColumn = CallingRange.Column;
string downAddress = CallingRange.get_End(XlDirection.xlDown).get_Address(false, false, XlReferenceStyle.xlA1, Type.Missing, Type.Missing);
//string downAddress = CallingRange.get_Address(false, false, XlReferenceStyle.xlA1, Type.Missing, Type.Missing);
CallingRange = worksheet.get_Range("A1", downAddress);
System.Array CallingValues = (System.Array)CallingRange.Cells.Value2;
//objExcel.Workbooks.Close();
//objExcel.Quit();
ConvertToStringArray(CallingValues);
}
Code for writing in excel:
Excel.Workbooks CallListWorkBooks;
Excel.Sheets CallingSheet;
Excel._Worksheet worksheet;
Excel.Range CallingRange;
Excel.Workbook CallListWorkBook;
try
{
// Instantiate Excel and start a new workbook.
// objExcel = new Excel.Application();
CallListWorkBooks = objExcel.Workbooks;
CallListWorkBook = CallListWorkBooks.Add(Missing.Value);
CallingSheet = CallListWorkBook.Worksheets;
worksheet = (Excel._Worksheet)CallingSheet.get_Item(1);
//Get the CallingRange where the starting cell has the address
//m_sStartingCell and its dimensions are m_iNumRows x m_iNumCols.
CallingRange = worksheet.get_Range("A1", Missing.Value);
int totalrows = arr.Count;
CallingRange = CallingRange.get_Resize(totalrows, 1);
//Create an array.
string[,] saRet = new string[totalrows, 1];
//Fill the array.
int j = 0;
for (long iRow = 0; iRow < totalrows; iRow++)
{
for (long iCol = 0; iCol < 1; iCol++)
{
//Put a counter in the cell.
saRet[iRow, iCol] = Convert.ToString(arr[j]);
//saRet[iRow, iCol] = Convert.ToDouble(theArray[i, 2]);
j++;
}
}
//Set the CallingRange value to the array.
CallingRange.set_Value(Missing.Value, saRet);
if (IsActive == 1)
{
CallListWorkBook.SaveAs("c:\\Active.xls", Excel.XlFileFormat.xlWorkbookNormal, null, null, false, false, Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);
}
else
{
CallListWorkBook.SaveAs("c:\\inactive.xls", Excel.XlFileFormat.xlWorkbookNormal, null, null, false, false, Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);
}
objExcelForWriting.Visible = false;
objExcelForWriting.UserControl = false;
CallListWorkBooks.Close();
objExcel.Quit();
}
catch (Exception theException)
{
String errorMessage;
errorMessage = "Error: ";
errorMessage = String.Concat(errorMessage, theException.Message);
errorMessage = String.Concat(errorMessage, " Line: ");
errorMessage = String.Concat(errorMessage, theException.Source);
MessageBox.Show(errorMessage);
}
}
|
|
|
|
|
why C# interfaces doesn't contain data members?
|
|
|
|
|
Because it doesn't actually implement anything. It only provides a contract that states what methods/properties will be present.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Because that is not the purpose of an interface.
An interface defines the public interface* of a class (or part of a class) that implements the interface.
If you want data members then you should look at implementing an abstract class .
* Note there is a difference between interface and interface
|
|
|
|
|
Hello,
Does anyone know how to elevate Users in Vista progrmatically without any User Interface to appear?
I need to do this in order to install something, which normally can be installed only by an admin, from a lower user account...
Please help me if you can. I need urgent help..
Thanks
L.P.
|
|
|
|
|
I don't believe that this is possible, because it would represent a major security hole in Vista. One of the tenets of Vista is that elevation only happens when the user agrees to it. If it didn't then virus and trojan writers would be able to run rampant throughout Vista.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Lucian.Palcu wrote: Does anyone know how to elevate Users in Vista progrmatically without any User Interface to appear?
You can't. At the point that elevation occurs a dialog is presented on a secured desktop to which the user must be respond. The secure desktop means that processed also cannot hijack the window (by getting hold of its handle) and respond on the user's behalf.
Lucian.Palcu wrote: I need to do this in order to install something, which normally can be installed only by an admin, from a lower user account...
Then I would definitely say you need admin rights for that!
Interestingly Vista contains some funky virtualisation stuff which means that you cannot write to the Program Files directory except as admin. However, for compatibility with older or badly behaved programs if a write is detected it will create a special directory in the user's profile and write the file there to protect the integrity of the system.
|
|
|
|
|
hi,
i need lil help.i want to make a winform in which i have to make a grouppanel which looks the same like the toolbox in the microsoft visual studio.
i want to pick up labels from that panel n want to drop it in the same form.so i want that treeview thing to b the same as in that toolbox. i just want to add labels in that panel n nothing else.
n those labels should b dragable.
plz can anyone guide me with this problem. its very urgent n i got deadlines 4 it
thanks
reply soon.
|
|
|
|
|
The toolbox in Visual Studio is a custom owner-drawn control (based on TreeView I think). To create a control that looks and behaves the same is a non-trivial task. If you're more interested in the functionality and don't need it to look as slick as the VS toolbox, you can use a simple TreeView control.
As for drag and drop, it's pretty simple. Search CodeProject for articles on that topic -- there are several.
|
|
|
|
|
hi I wanted to put some dll in the gac
so I used the gacutil /i XXX.dll
and put it there
but I still couldn't use it in my program,, why?
thanx
|
|
|
|
|
You have added a reference to it in your project haven't you?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
check you have that dll copied into gac ? open assembly folder and check
|
|
|
|
|
Hi Friends
How a size of a class can be determined? As an example
Class A
{
}
Class A
{
int i;
public A()
{
i=10;
}
}
Class B
{
A aa=new A()
public B()
{
}
}
What would be the size of object of type A and B ??
Thanks in advance.
Thanks,
Arindam D Tewary
|
|
|
|
|