Solved

How to get to protected member m_nIDHelp

Posted on 1997-05-06
7
993 Views
Last Modified: 2013-11-20
There is a protected member variable m_nIDHelp.  I am
not sure if it is a member of the CWnd class or the
CDialog class.  It shows up as a "protected" member
of my CDialog object in the debugger.

Anyway, the question is, is there an access function
available so that I can get to this from outside the
class?  Or am I going to have to subclass from CDialog
and provide my own access function?

By the way, what do I do when an expert answers a
question that is not sufficient?  My question is tagged
as answered and waiting for a grade so no one looks
at it.  The expert said to get back to him if it was
not sufficient, but the only way I have to do this is
by posting a comment and I have had no response for
quite a while.  The first response was virtually
immediate, but now it sits.
0
Comment
Question by:solomon021499
  • 4
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
MarkusLoibl earned 70 total points
Comment Utility
In afxwin.h you find the definition of CDialog, included the member:
protected:
        UINT m_nIDHelp;
There you also find:
public:
      void SetHelpID(UINT nIDR);
You can call this member from outside the class.

By the way, if you do not agree with someone's answer, do the following: When you evaluate the proposed answer, use the radio button with the lowest agreement (I don't know the correct text, but when it says "excellent-good-ok-bad", use bad). The question then does not loose the status of a question; it will be put back to the unanswered questions.

0
 

Author Comment

by:solomon021499
Comment Utility
Thank you for resonding.  I did see the definition of CDialog in afxwin.h and the void SetHelpID(UNIT nIDR) function.  However, I need to be able to retrieve the value, not set it.

I assume this means that I will have to provide this myself.

Also, thank you for your advice about question status.
0
 
LVL 1

Expert Comment

by:MarkusLoibl
Comment Utility
you also find in the MFC-sources:

ON_MESSAGE(WM_HELPHITTEST, OnHelpHitTest)
LRESULT CDialog::OnHelpHitTest(WPARAM, LPARAM)
{
 if (m_nIDHelp != 0)
  return HID_BASE_RESOURCE + m_nIDHelp;
 return 0;
}

I think you can use this member to retrieve your actual m_nIDHelp with:
  UINT helpId = myDialog->SendMessage(WM_HELPHITTEST);
  if( helpId ) helpId -= HID_BASE_RESOURCE;
This should work!
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:solomon021499
Comment Utility
I tried it and have not yet been able to get it to work.
It is necessary to include afxpriv.h, but I get many compilation errors in it when I do so.  I assume that it requires yet another header, but I have not yet found it.  Thank you.  I will let you know when I get it.
0
 

Author Comment

by:solomon021499
Comment Utility
As I indicated in my last comment, I have not been able to get
UINT helpId = myDialog->SendMessage(WM_HELPHITTEST);
if( helpId ) helpId -= HID_BASE_RESOURCE;
to work when including afxpriv.h.  I do not know how to elimination the multitude of compilation errors that occur when including that file.  I tried defining WM_HELPHITTEST and HID_BASE_RESOURCE myself to the value in afxpriv.h
#define WM_HELPHITTEST      0x0366
#define HID_BASE_RESOURCE   0x00020000UL  
which did work.  However, this is a embarassing work around.  Do you have any ideas, what the problem is.  Do I need to include yet another file?


0
 
LVL 1

Expert Comment

by:MarkusLoibl
Comment Utility
I use VC++ 5.0 and do not have any problems with it.
I just built up a little example, and I can send you the files with e-mail, if you tell me your email-adress
(send it to:  MarkusLoibl@ThinkTools.com )

0
 
LVL 1

Expert Comment

by:MarkusLoibl
Comment Utility
I use VC++ 5.0 and do not have any problems with it.
I just built up a little example, and I can send you the files with e-mail, if you tell me your email-adress
(send it to:  MarkusLoibl@ThinkTools.com )

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

12 Experts available now in Live!

Get 1:1 Help Now