Solved

VC++ and MM_ messages

Posted on 2003-11-08
4
398 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to convert c++ code to Android App 3 83
c++ getting the first 10 characters of a char* string 11 90
How to convert MFC APP to Win32 APP. 19 69
I could not build boost code, 10 78
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

920 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

14 Experts available now in Live!

Get 1:1 Help Now