Answer Questions
Van Binh Problems with function ?
Hi There is a problem I am facing at the moment. I have a base class called A; I have 2 classes that inherits from it . B and C. I have a method with 3 overloads . 1 for A ,1 for B and 1 for C. public void DoSomeWork(A a){} .... On calling the method It goes to the proper one by its parameter. Now, My problem is that I am using a factory to get the proper Object for a specific case and I then assign it in an A object (base class). I then want to send it to the method and expects it to go to the proper one but it goes to the one with A no matter the type returned. I always get "in A1" //Base class A1 a2 = new A2 (); //Call the proper function DoSomeWork(a1); public void DoSomeWork( A1 a ...Show All
den2005 "Smalltalk’s object-based hierarchy does not work so well".Also c#??
I read a book , "Thinking in C++".At pg:694( Introduction to templates) he writes: "The Smalltalk solution. Smalltalk (and Java, following its example) took a simple and straightforward approach: You want to reuse code, so use inheritance. To implement this, each container class holds items of the generic base class Object (similar to the example at the end of Chapter 15). But because the library in Smalltalk is of such fundamental importance, you don’t ever create a class from scratch. Instead, you must always inherit it from an existing class. You find a class as close as possible to the one you want, inherit from it, and make a few changes. Obviously, this is a benefit because it minimizes your effort (and explains why yo ...Show All
dreamer60 Inheritance - Polymorphism
Hi everyone, I'm trying to find a solution to my problem, here it is: let say I have a base class: public abstract class BusinessBase <T> { private T m_DataSet; public virtual T DataContainer { get { return this .m_DataSet; } set { this .m_DataSet = value ; } } } then I derive that base class: (ATDS is a typed DataSet) public class A : BusinessBase < ATDS > { public A() { this .DataContainer = new ATDS (); } } then i Derive the derived class: (BTDS is a typed DataSet) public class B : A { public B() {   ...Show All
medel Why is there a PDB file in my projects Release folder?
This is probably a deployment question, but there doesn't seem to be a deployment section in .NET Development Forum. I thought the PDB file was only for debugging purposes, so why is there a PDB file in my bin\Release folder What are the (dis)advantages of including this file in deployment Hi, I am actually trying to force my project (C#, VS2005 sp1) to generate PDB files in release mode, but despite many hours of googling and searching through options I cannot find anywhere describing how (or whether) this is possible! Any help would be greatly appreciated! Very interesting question. You should try google it, and see what you come up with. I myself don't include pdb's in ...Show All
clint 2 Setting cookies in WebBrowser control???
Is this possible Cookies are associated with a document. See HtmlDocument.Cookie . An HtmlDocument can be retreived via the WebBrowser.HtmlDocument property. ...Show All
Hans L scheduling
Hi all, I have written a windows application in Visual C# and I want to make so that it schedules itself to run once daily when its installed. Does anyone know how I can do that Thanx in advance LOL . Thank You ! Dear Fellows, Every body knows that every version of Windows i.e from 95 to Vista has the schedule task but this is a Programming forum so while answering a question one will always reply with a solution in programing. So I did it that way. This is C# Language forum not the Windows XP forum so I assume all questions asked here are somehow related to perform a task prgramatically. Solution of Windows service is not dependant on user, The accound under which it run can be changed with a single property of W ...Show All
Markus B. System.Threading.Threadstart question...
Im not sure that this is the correct forum for this but it was the closest that I could find for this particular question. I apologize in advance if this is a newbie question. Im still getting my feet wet in the .Net environment. I wrote a windows service today ( a particularly easy task now with VS 2005 ) and I used a thread to do the work in the service. things work fine when the method that I use in the ThreadStart creation doesnt take any paramaters, but I couldnt figure a way to use a method that takes a paramater. I tried aThread = new Thread ( new ThreadStart (<class> .method(arg))); aThread = new Thread ( new ThreadStart (<class> .method)); But both of those lines would give me compiler errors. I c ...Show All
Thomas Aylesworth Problem loading web forms
I am new in C# and I am building a simple web form with just a label, but when I try to run it, comes a messages saying that the page cannot be loaded. What coud it be Is it user permissions or somethig Thanks You are right this does not seem to come from any code because you are not allowed to acces this page. Did you write any rights for accessing folders etc. into your web.config Hi, do you have a specific errr message is iis installed on your server what is the source of the page, where the error occurs if the error is in the source code. idem and then you press strg+f5 in visual studio 2005 Thats strange actually the page should be shown in ...Show All
Zero_ Intellisense only working on some Classes and not others
Hi, I've done a good search on Google and on here and tried many of the solutions to fix a faulty Intellisense, but I get the feeling it's me that's doing something wrong rather than the Intellisense. I've just started using VS2005Pro as my IDE for editing my .cs Code Behind files after using TextPad before. I made the change as I want the benefit of Intellisense. I don't have my site set up as a project, I'm just editing each .cs file on it's own, as I don't want to hand anything else over to VS. So I've created a new .cs file, and I've started typing: using System. and Intellisense pops up to give me options. Unfortunately not everything I want is in the Intellisense list. Collections, IO, Runtime and others are availabl ...Show All
Calvin Bell Adding a 2nd Word Table
I am trying to automate word, using VS2005 C#. I can get text and ONE table in the word document, but I need to add text after the table and another table. How do I add another table/more text to the document Here'scode I have pared down as an example. It adds a line of text and a table (4 x 4) and attemps to add a second table except it puts the 2nd table in a cell of the 1st table. Thanks. Eileen object missing = Missing .Value; // Create a word object that we can manipulate Microsoft.Office.Interop.Word. Application Word_App = null ; Document Word_doc = null ; try { Word_App = new Microsoft.Office.Interop.Word. Application (); Word_doc = new Document (); } catch ( Exc ...Show All
bola shokry Array of struct A in struct B!
Hi struct A { int x; int y; } struct B { int z; A [] tab=new A[14]; //cannot have instance field initializer in struc ...I know! } but i need an array of struct in another struct thanks. struct B { int z; A[] tab; public B(int z, int tab) { this.z = z; this.tab = new A[tab]; } } tab : 1) is it an array : A[] tab; 2) or an int : new A[tab]; Thanks struct B { int z; A[] tab; public B(int intZ, int tabLenght) { this.z = intZ; this.tab = new A[tabLenght]; } } More clear now Does B have to be a struct If so, can you add a parameterized constructor to it 1-yes B has to be a struct. 2- "can you add a ...Show All
ackermsb registry.classesroot
Can some one provide me a demo code using this class. strFilePath= @"C:\Guna\VS2005\AplnOpener\AplnOpener\bin\Debug\AplnOpener.exe" ; regRootKey= Registry .ClassesRoot; regRootKey = regRootKey.CreateSubKey( ".guna" ); regRootKey.SetValue( "" , "AplnOpener" ); regRootKey.SetValue( "Content Type" ,strFilePath); //regSubKey =regRootKey.CreateSubKey("OpenWithList"); //regSubSubKey=regSubKey.CreateSubKey("AplnOpener.exe"); ...Show All
Sergiulica1 Image Acquisition from IP Cameras
Hi, Is there a common solution to acquire image and video from IP cameras from different vendors How can I acquire video from 2 different cameras at the same time There are WIA, TWAIN and DirectShow technologies which are popular but what is the difference between DirectShow and WIA Detailed explanations and source codes would be appreciated :) Sorry i never work with cameras, only want help you with work with several hardware devices at same time :P Regards. Multithreading is ok, but what I need is what you would use for the // Code for read data from a device and send Would you use Twain, WIA or DirectShow Which one has which advantages and disadvantages Thanks for the code friend. ...Show All
Ross Watson Compare filename to a mask
I have a FileInfo object. I need to compare the FullName property to a mask like "*.jpg" or "warcraft.*" or " rant.bmp" to see if it matches. How can I do this Thanks Hi , Do you need to just compare against the 3 mentioned above or any jpg file and any file having name as warcraft(what ever the extension may be) and (is it rant.bmp or rant.bmp) any bmp or only the bmp file u have mentioned Anyways, since fileinfo.FullName is a string object , it has so many functions like "Equals","Compare","Contains","Endswith" and "Startswith".Using these functions u can compare any filename with any extension. Hope u c ...Show All
hrp313 Freeze on SetParentHandle
My UserControl have to adds some child controls on Runtime. But somtimes my application will be frozen at the line below: this.Controls.Add(this.myChildControl); and open CallStack give me some inforation: 0x000000 SetParentHandle() Please help me out!. thanks Hi all Thanks for your help, I found where cause this bug. It's happen because I forget check InvokeRequired at privious action when I update my UserControl. My Thread is running and update GUI so I have to check if InvokeRequired. Thank again. Hi all, Thanks for your help, I found out where cause this bug. I missed to to check InvokeRequired when update control in my previous action on this UserControl. ...Show All
