Solved

VC++ and MM_ messages

Posted on 2003-11-08
4
405 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

726 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