Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VC++ and MM_ messages

Posted on 2003-11-08
4
Medium Priority
?
409 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 520 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.
Suggested Courses

618 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