Link to home
Start Free TrialLog in
Avatar of ganesanas
ganesanas

asked on

Volume Manipulation in C++

Hi,
Is it possible to use windows.h
in the MFC application in visual C++ 6.0

I have tried it does't work...
the following message is displayed as error

fatal error Windows.h already included MFC apps must not
#include windows.h

or can i manipulate volume(mute,incr,decr, etc) with out
using MFC

Asganesan
Avatar of nietod
nietod

>> Is it possible to use windows.h
USE it yes
INCLUDE it no.

Windows.h is already included for you.  But certainly you can use the windows API functions and other items defined in windows.h in an MFC application.

>> can i manipulate volume(mute,incr,decr, etc)
>> with out using MFC
I don't understand!  Are you using MFC or not?
You can do it with or without MFC.  But what is your program using?
If you are not using MFC, then you probably want to use waveOutSetVolume().
Avatar of ganesanas

ASKER

Thanks nietod....

My  doubt is whether an application that is
developed using MFC(which has include files such as
#include <afx.h>
#include <afxwin.h>
#include <afxext.h>          
#include <afxdtctl.h>            
#include <afxcmn.h> )


can include windows.h  ....?


when I included windows.h I received the
error message fatal error:
windows.h aleready included:
MFC apps must not #include <windows.h>


my question is whether windows.h and mfc include files
co-exist in same cpp??

I experienced this problem because already i have written
an application without MFC which is using windows.h

now have developed an module with mfc support
I want to integrate both that why the question....



>> My  doubt is whether an application
>> that is developed using MFC
If you are painting a picture, when does it have to be a bowl of fruit and when does it have to be portrait?

If you want to use MFC, use it.  If you don't don't.  You never have to use it.  The only time you couldn't use it woudl be if you are writting portable programs, i.e. standard C++ programs, not windows GUI programs.

First you have to decide if you want to us eMFC or not for an application.  if so, it incudes <windows.h> so you shoudln't.  if not, and if you need <windows.h> include it.

>> my question is whether windows.h and
>> mfc include files
>> co-exist in same cpp??
MFC includes windows.h for you.  For some reason--I don't know why--it prevents you from doing so again.  But that is n't important.  Since it includes windows.h you have all the contents of windows.h available to you in an MFC application.   If you aren't using MFC, then you need to include windows.h.   In either case you have windows.h's information included.

>> now have developed an module with mfc support
As far as I know, you can't just write a little MFC module to an application.  The application has to be an MFC application.  MFC will impose a strict core design to your application.  it defines the program entry point (WinMain()), it defines the central logic on the application (message loop and other core features.)   You then need to customize the application for your needs by addign clases and procedures to the MFC basic desing.   you can't just merge this into an already existing application.
Mr.nietod ,
Thanks....

what I can infer from your reply...
is that code using MFC  can't be included in an
application that doesn't support MFC.. am I right?



further can u suggest ;

how to play wave file @ varying speed ( slow, medium,faster)
something like slow motion and fast forward in video...
a piece of code will be of great use...
regards....
Asganesan

ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial