Monday, December 14, 2009

C/C++ interaction with hardware



Hi Guy!!! 


Once again some magic wait for you and it just 1 click away from ur side 
so what you waiting for ?? 


Here, I Show you the C and C++ as Incredible Languages the following topics are covered using these two magical and extra ordinary languages 


If You really Feel Excitement then just Rate it..



1) Change your mouse pointer 
2) Controling digital circuit through computer 
3) Implementation of Mouse Events.
4) reading serial port
5) Electrical equipment control 
6) PC Based Device Controller 
7) Electrical equipment control 
8) bootsector editer 


For all these the link is given below use it:

Link:

http://www.sourcecodesworld.com/source/LanguageHome.asp?LangId=2



mp3 Player in CPP Language

hi  guys!!!

have u reading the title, ya its true i have the code for mp3 player which plays the song

The code:
the header file we make as follows
mp3.h file

------------------------------------------------------------------------------------------

#ifndef _MP3H_
#define _MP3H_

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <mmsystem.h>
#include <strmif.h>
#include <Control.h>
#include <evcode.h>
#include <Uuids.h>

class cMp3
{
private:
 IBaseFilter   *  pif;
 IGraphBuilder *  pigb;
 IMediaControl *  pimc;
 IMediaEventEx *  pimex;

 bool    ready;

public:
cMp3();
~cMp3();

void Play();
void Pause();
void Stop();

int Load(LPSTR filename);
void Cleanup();
};

#endif

----------------------------------------------------------------------------------------------
mp3.cpp file:


cMp3::cMp3()
{
pif = NULL;
pigb = NULL;
pimc = NULL;
pimex = NULL;

ready = false;

CoInitialize(NULL);
}

cMp3::~cMp3()
{
Cleanup();
}

void cMp3::Cleanup()
{
CoUninitialize();

if (pimc)
pimc->Stop();

if(pif)
{
pif->Release();
pif = NULL;
}

if(pigb)
{
pigb->Release();
pigb = NULL;
}

if(pimc)
{
pimc->Release();
pimc = NULL;
}

if(pimex)
{
pimex->Release();
pimex = NULL;
}
}

int cMp3::Load(LPSTR szFile)
{
WCHAR wFile[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, szFile, -1, wFile, MAX_PATH);

if (SUCCEEDED(CoCreateInstance( CLSID_FilterGraph,
NULL,
CLSCTX_INPROC_SERVER,
IID_IGraphBuilder,
(void **)&this->pigb)))
{
pigb->QueryInterface(IID_IMediaControl, (void **)&pimc);
pigb->QueryInterface(IID_IMediaEventEx, (void **)&pimex);

if (SUCCEEDED(pigb->RenderFile(wFile, NULL)))
{
ready = true;
}
}
return (ready);
}

void cMp3::Play()
{
if (ready)
{
pimc->Run();
}
}

void cMp3::Pause()
{
if (ready)
{
pimc->Pause();
}
}

void cMp3::Stop()
{
if (ready)
{
pimc->Stop();
}
}
---------------------------------------------------------------------------------------------------

Enjoy.................

Monday, December 7, 2009

C Programming Magic(If...Else Both part Execute )

Hi Guys!!!


Here For you some Tremendous Trick to Execute both If...Else Part in C editor

Here are the 2 codes.

1) 

if (!(printf("Hello")))
    ;
    else
    printf("World");

2)

if(1)

printf("\n Hello");

else;

printf("World");

Sunday, December 6, 2009

Passport Size Photo Maker

Hi guys Every Person Needs the Passport size photo for his/her regular official work, so here, i come with the software which help you to make the different region wise passport size photo

Link:

http://hotfile.com/dl/18180369/5adbd6d/P_P_S_1.51.rar.html