Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

Chiman1

@Chiman1
About
Posts
27
Topics
21
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Collection of unique ids
    C Chiman1

    I have used

    list<>

    data type to store emp id. As

    List<int> EmpIds = new List<int>() ;

    But it takes duplicate entries. Which data structure I should use to have collection of unique ids.

    C#

  • How to create collection class in C#
    C Chiman1

    I have created a collection class which has below methods

    Class EmPInfo
    {
    Count()
    Add (Struct classinfo)
    Item()
    Sort()
    }

    This class uses List<> object ,which holdes Emp class obj. Add method internally craetes a EMP class object and stores that data in a list object. Sort function perform sorting using some information set by the user. Please suggest the correct way of creating a colletion class in .Net.

    C# csharp algorithms tutorial

  • How to return a collection from a method.
    C Chiman1

    public List<string> GetList()
    {
    List<string> list = new List<string>();
    return list;
    }

    But as per msdn we should not expose the generic list. How to return a list from a method. 2) Simillarly I have a method which has dictionary as a return type How to return a dictionary from a method. 3) In my code I have craeted a dictionary as

    Dictionary < int , Some Str>

    . Now I need a colletion of keys avaialble in the dictionary. How to do this.?? Do I need to retrive one by on from dictionary. ??

    C# tutorial question

  • Code Quality Check
    C Chiman1

    I am new to .Net , I have developed an application using C#.I want check the code quality of my application .Can any one suggest any tool ,which perform code quality check?

    C# csharp question

  • How to check for different datbase errors
    C Chiman1

    In the code how can we check for below errors i) DB files not available ii) DB is corrupted iii) Driver errors.

    C# database tutorial

  • Retrieve data (using query) from a Access database
    C Chiman1

    Thnx.. As shown in the example dataset contain data table information. Now i need to retrieve some set of data from dataset. How to do it. Can we fire quire on the data available in the dataset.

    C# database

  • Retrieve data (using query) from a Access database
    C Chiman1

    I am working on an application where i need to retrieve data (using query) from a Access database.(ABC.mdb) Please provide code snippet for this. it is helpful if you can provide sample which uses dataset .

    C# database

  • Sorted collection
    C Chiman1

    SortList require a unique key value and in our case name can be duplicate.

    C# csharp help question

  • Sorted collection
    C Chiman1

    I am working on an application where I have created a class emp which has ID and Name as a property. Now I want to create a collection of Emp class , which should be sorted based on the either ID or Name. (Program will decide whether it want to data sorted based on the Name or Id at the runtime). For and employ ID and NAMe property is not unique. It is possible that employed is having similar name. Can you please help me to decide which .net collection object should be used to achieve above functionality? If possible please provide a snippet. public class Emp { private int myID; public int ID { get { return myID; } set { myID = value; } } private string myName; public string Name { get { return myName; } set { myName = value; } } }

    C# csharp help question

  • Interoperability
    C Chiman1

    I am working on an application where I am using C# .net as well as ATL COM. I have created below classes 1) Class Add, Which is created using C# .Net. And which implement Addition functionality. This class uses IAdd interface which is having Add method to perform addition. (Please note that IAdd is an com interface and we have used it by creating interop dll)

    public class Add : IAdd
    {
    #region IAdd Members

        void IAdd.Add(double P1, double P2)
        {
            throw new Exception("The method or operation is not implemented.");
        }
    
        #endregion
    }
    
    1. Class Calculate (com visible component), which is created using C# .Net. And which internally uses Class ADD to perform addition. . (Please note that ICustom is an com interface and we have used it by creating interop dll)

    class Calculate : ICustom
    {
    #region ICustom Members
    Add add = new Add ();
    #endregion

        #region ICustom Members
    
        void  ICustom.CustomQueryInterface(Guid id, ref object ptr)
        {
            throw new Exception("The method or operation is not    implemented.");
        }
    
        #endregion
        }
    
    1. Class Client, This class is created using ATL COM, which crates the object of class Calculate as “calculate“ and then tries to retrieve interface IAdd using object calculate. To get the IAdd interface, what I have done is I have created a Custom Interface which contain a method similar to the Query Interface () method available in the IUnknownInterface. This interface is then implemented by the class Calculate, Now whenever client requires an IADD interface pointer; it will use ICustomInterface to retrieve it. Please suggest: What should be the implementation Of .CustomQueryInterface(Guid id, ref object ptr)? Also what should be the code at client side (Client is implemented inCOM)

    IDL file :

    [
    object,
    uuid(E99CD31D-34FE-4AFF-A1E6-C438F73F685F),
    dual,
    nonextensible,
    helpstring("ICOMClient Interface"),
    pointer_default(unique)
    ]
    interface ICOMClient : IDispatch{

    \[id(1), helpstring("method PerformCalculation")\] HRESULT PerformCalculation(void);
    

    };

    [
    object,
    uuid(53F4B9FA-B6E7-42aa-939B-97B93010270F),
    dual,
    nonextensible,
    helpstring("IAdd Interface"),
    pointer_default(unique)
    ]
    interface IAdd : IUnknown{
    [id(1), helpstring("method Add")] HRESULT Add([in] DOUBLE P1, [in] DOUBLE P2);
    };

    [
    object,
    uuid(8C4DE0FA-6D4B-4c52-9E35

    C# csharp com c++ database question

  • How can i track the menu item selection in C#
    C Chiman1

    In C++ we have TrackPopupMenuEx() function to displays a shortcut menu at the specified location and tracks the selection of items on the shortcut menu. How can i track the menu item selection in C#. How can i archive similar functionality in C#. Sample application appreciated.

    C# csharp c++ question

  • How to pass delegate as a parameter
    C Chiman1

    Hi, I am new to C# , Please suggest the approach. I have written below code . public class A { public B obj = new B(); public delegate int delegateCalculate(int i, int j); delegateCalculate dc ; public int Add(int Num1 , int Num2) { return (Num1 + Num2); } public int Sub(int Num1, int Num2) { return (Num1 - Num2); } public void Display() { dc = this.Sub; obj.Result(dc); //error } } public class B { public int Num1 = 10 ; public int Num2 = 20 ; public delegate int Calc (int i,int j); public int Result(Calc dc) { int ii = dc(Num1, Num2); return ii; } } The above code gives error for obj.Result(dc); call. Please suggest how to call Result() of class B in class A.

    C# csharp help tutorial

  • How to use collection object as interface method parameter in .NET
    C Chiman1

    Hi, How can i pass a collection object as a parameter ....??? Consider below example.. Interface IMyInterface { void DisplayData(??????); } Class MyClass : IMyInterface { void IMyInterface.DisplayData(??????) { Logic to display data Display First Name , Display last name... } } ///From client. Class Client { //I have a data structure (some data container) , which saves data like <key , value> say a map... MyClass myclass = new MyClass() myclass.DisplayData( ???) } Now what should be the parameter typr ???

    COM tutorial question csharp docker

  • <key value=""> collection as a parameter in an interface method</key>
    C Chiman1

    ok.. Let say .. Interface IMyInterface { void DisplayData(??????); } Class MyClass : IMyInterface { void IMyInterface.DisplayData(??????) { Logic to display data Display First Name , Display last name... } } ///From client. Class Client { //I have a data structure (some data container or .net collection obj) , which saves data in a<< key , value >> format .. MyClass myclass = new MyClass() myclass.DisplayData( ???) } My question is how can i pass a collection data structure as a parameter in a interface DisplayData() method ?? Can i directly pass a collection object in interface method?? (Please note that this is an interface method and can be used by other languages.)

    C# question csharp com

  • <key value=""> collection as a parameter in an interface method</key>
    C Chiman1

    Hi, I have created two library (COM) in C# , and i have a interface method as UpdateData() in a component. Now i need t0 pass a collection as a parameter in an interface method. How can i ac chive this. Can i pass a map object as a parameter in an interface method??

    C# question csharp com

  • using interface
    C Chiman1

    I want to use an interface method in my com class . Now this can be archive by two ways 1) by importing tlb file in idl file. ii) by including/adding .h file. Can you please explain the diff betn approach i and ii and in which scenario we should use them?

    COM com question

  • how to archive multiple inheritance in .net
    C Chiman1

    I am working in a project implemented in COM (ATL)where , my class derives from app 12-14 classes. Now while implementing the same class in C#, i am facing problem (as C# not support multiple inheritance). Can you please provide me the ways we can archive multiple inheritance in .net.

    C# csharp c++ com oop help

  • How to use C++ ATL-Template class in c#
    C Chiman1

    I am migrating a C++ application to .NET. In C++ ,I have an template class which uses some ATL library classes for eg. template< class T > class MyBaseClass: public IConnectionPointContainerImpl, public IPersistStorageImpl, public IPersistPropertyBagImpl, { } Now i need to use this call in my new C# .net project where my new .NET call will get derive from above MyBaseClass . Please let me know how can i archive this ??? Is this possible to use a template class which uses some ATL libraray classes directly in C# ? `chiman

    Managed C++/CLI csharp c++ question tutorial

  • How to use C+++ ATL template calss in C#
    C Chiman1

    I am migrating a C++ application to .NET. In C++ ,I have an template class which uses some ATL library classes for eg. template< class T > class MyBaseClass: public IConnectionPointContainerImpl, public IPersistStorageImpl, public IPersistPropertyBagImpl, { } Now i need to use this call in my new C# .net project where my new .NET call will get derive from above MyBaseClass . Please let me know how can i archive this ??? Is this possible to use a template class which uses some ATL libraray classes directly in C# ? `chiman

    C# csharp c++ question tutorial

  • Design Pattern
    C Chiman1

    Thnx buddy :)

    Design and Architecture design regex architecture
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups