Solved

VC++ and MM_ messages

Posted on 2003-11-08
4
395 Views
Last Modified: 2012-05-04
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
Comment
Question by:RJSoft
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 130 total points
ID: 9709078
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
 
LVL 3

Author Comment

by:RJSoft
ID: 9712336
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
 
LVL 48

Expert Comment

by:AlexFM
ID: 9712811
You can ignore all old keywords like HUGE, so (BYTE huge *) is BYTE*. BYTE is unsigned char.
0
 
LVL 3

Author Comment

by:RJSoft
ID: 9720933
Thanks

RJ
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now