This site is no longer active and is available for archival purposes only. Registration and login is disabled.

C++ Help


C++ Help

Postby zinger » Mar 29, 2003 @ 4:08am

I'm now one week into C++ and need help. I'm playing with GAPIDRAW trying to add sound. My problem is this whole class business and variable declarations. Here's the code:

CWave * m_cWave;
m_cWave = new CWave( );

DWORD m_dwSysVolume = m_cWave->getVolume( );
m_cWave->setVolume(0x71C471C4);
m_cWave->playResourceWav(hInst, IDR_WAVE, false);

This works from within WinMain. If I use m_cWave from within the GAPIDRAW functions I recieve m_cWave' : undeclared identifier. I'm sure this is basic C++ stuff that's why I posted here instead of the GAPIDRAW forum.

Please forgive my newbieness.
zinger
pm Member
 
Posts: 173
Joined: Oct 5, 2002 @ 8:54pm
Location: DE, USA


Postby Dan East » Mar 29, 2003 @ 5:11am

You need to include the header that defines the CWave class. Probably gapidraw.h or something like that.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby zinger » Mar 29, 2003 @ 6:49am

zinger
pm Member
 
Posts: 173
Joined: Oct 5, 2002 @ 8:54pm
Location: DE, USA


Postby Dan East » Mar 29, 2003 @ 8:51am

You need to provide the prototype for the class in a header file, so you can include it in other source files.

This:
class CWave
{
stuff deleted
};

should go into a .h file. Include that file in any cpp that uses that class.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby zinger » Mar 29, 2003 @ 5:52pm

That worked. Thanks Dan!
zinger
pm Member
 
Posts: 173
Joined: Oct 5, 2002 @ 8:54pm
Location: DE, USA


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron