Posts

Showing posts from January, 2018

Types of inheritance w.r.to Access Specifiers in C++ Part Three

Image
Types of inheritance w.r.to Access Specifiers in C++ Part Three Private Inheritance Source code #include<iostream> #include<cstdlib> using namespace std; class Parent {     private:         int a;     protected:         int x;  //can access by the derived class     public:         void setVal(int v)         {             x=v;             } };  class Child:private Parent {     public:         void printVal(void)         {             setVal(10); //accessing public member function here             cout << "value of x: " << x << endl; //protected data member direct access here         } }; int m...

Types of inheritance w.r.to Access Specifiers in C++ Part Two

Image
Types of inheritance w.r.to Access Specifiers in C++ Part Two Protected inheritance: source code: #include<iostream> #include<cstdlib> using namespace std; class GrandParent{ public:   void grandParentMethod( void )   {  cout<<"Method in the grand parent class"<<endl;   } }; class Parent : protected GrandParent{ public:   void parentMethod( void )   { cout<<"Method in the parent class"<<endl;  } }; class Child: protected Parent{ public:   void    childMethod( void ){     cout<<"Method in the child class"<<endl;     parentMethod();     grandParentMethod();   } }; int main( void ) {   Child C;   C.childMethod();     // C.parentMethod(); // error protected inheritance     system("pause");   return 0; } ///////////////...

Types of inheritance w.r.to Access Specifiers in C++ Part One

Image
Types of inheritance w.r.to Access Specifiers in C++ there are three types of inheritance with respect to Access Specifiers in C++ 1.public inheritance 2. protected inheritance 3. private inheritance today we will discus public inheritance; source code:  #include<iostream> #include<cstdlib> using namespace std; class Person { public: void showPublicFunction() { cout<<"\n I am public function "; } private: void showPrivateFunction() { cout<<"\n I am private function"; } protected:  void showProtectedperson(){ cout<<"\n Protected Person is showing "; } }; class Student :public Person { public: void showStudent() { cout<<"\n Student is showing "; Person::showProtectedperson();//protected Function Person::showPublicFunction();//public function // Person::showPrivateFunction();//priva...

C# Windows Media Player

C# Windows Media Player Controls 1. windows media player 2. List Box 3. Button 4.open File Dialog box //c# code in Button click event if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)             {                 files = openFileDialog1.SafeFileNames;                 path = openFileDialog1.FileNames;                 for (int i = 0; i < files.Length; i++)                 {                     listBox1.Items.Add(files[i]);                 }             } //Code in ListBox1 evetnt   axWindowsMediaPlayer1.URL = path[listBox1.SelectedIndex]; ////////////////////////////////////////////////////Done////////////////////////...

Windows Volume Controller Class

Windows Volume Controller Class  using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WMPNamespace {     public class VolumeController     {         [DllImport("user32.dll")]         public static extern IntPtr SendMessageW(IntPtr hWnd, int Msg,             IntPtr wParam, IntPtr lParam);         private const int APPCOMMAND_VOLUME_MUTE = 0x80000;         private const int APPCOMMAND_VOLUME_UP = 0xA0000;         private const int APPCOMMAND_VOLUME_DOWN = 0x90000;         private const int WM_APPCOMMAND = 0x319;               private void Mute()         {             SendMessageW(this.Handle, WM_APPCOMMAND, this.Handle,               ...