• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 414
  • Last Modified:

VC++ and MM_ messages

I have a dialog based VC++ 6.0 app that has a specific dialog RecordDialog that needs to capture messages

MM_WOM_OPEN
MM_WOM_DONE
MM_WOM_CLOSE

MM_WIM_OPEN
MM_WIM_DATA
MM_WIM_CLOSE

In an old example of I have that was created with 16 bit Turbo C++ Owl.

Basically what I did was capture the messages in that dialog like so...

class ADialog...
{
public:
...
void MMWomOpen()=[MM_WOM_OPEN];

};

The func()=[ xxxxx]; is the old way of doing it in 16 bit Owl.

So how do I do it with VC6.0++?

Do I have to create callback functions outside of my dialog class?

If so what are the layouts of the callbacks?

This is so I can add recording/playback to my application.

I see also there is an example in the VC6.0++ help. But that is not dialog based app. Instead it's the old MFC type where you declare like a WndProc and do case statements for each message. I dont feel like writing my whole app over again.

Any help apreciated.

RJSoft


0
RJSoft
Asked:
RJSoft
  • 2
  • 2
1 Solution
 
AlexFMCommented:
class ADialog...
{

    //{{AFX_MSG(ADialog)
    ....
    //}}AFX_MSG
    LRESULT OnMessageWOMOpen(WPARAM wParam, LPARAM lParam);

};

// cpp file

BEGIN_MESSAGE_MAP(ADialog, CDialog)
    //{{AFX_MSG_MAP(ADialog)
    ....
    //}}AFX_MSG_MAP
    ON_MESSAGE(MM_WOM_OPEN, OnMessageWOMOpen)
END_MESSAGE_MAP()


LRESULT ADialog::OnMessageWOMOpen(WPARAM wParam,  LPARAM lParam)
{
    ...
    return 0;
}


0
 
RJSoftAuthor Commented:
Works great!

Only had one question though, since I had old routines that where for 16 bit api they had refference to huge pointers (BYTE huge *) pointers. huge is discontinued so I replaced them with (unsigned char *).

I realize back in those days they worried about addressing memory past a certain point which caused a pointer to go whacky doing some segment wrap arround thing.

Is what I did the best equivelent or is there a better option?

RJ
0
 
AlexFMCommented:
You can ignore all old keywords like HUGE, so (BYTE huge *) is BYTE*. BYTE is unsigned char.
0
 
RJSoftAuthor Commented:
Thanks

RJ
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now