Click here to Skip to main content
15,923,789 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ftp .... Pin
Prakash Nadar9-Apr-04 15:14
Prakash Nadar9-Apr-04 15:14 
GeneralStatic library and dialog box Pin
Liobsynde9-Apr-04 9:00
Liobsynde9-Apr-04 9:00 
GeneralRe: Static library and dialog box Pin
Prakash Nadar9-Apr-04 9:11
Prakash Nadar9-Apr-04 9:11 
GeneralRe: Static library and dialog box Pin
Liobsynde9-Apr-04 9:28
Liobsynde9-Apr-04 9:28 
GeneralRe: Static library and dialog box Pin
Prakash Nadar9-Apr-04 9:41
Prakash Nadar9-Apr-04 9:41 
GeneralRe: Static library and dialog box Pin
Liobsynde9-Apr-04 9:57
Liobsynde9-Apr-04 9:57 
GeneralRe: Static library and dialog box Pin
Prakash Nadar9-Apr-04 15:05
Prakash Nadar9-Apr-04 15:05 
GeneralRe: Static library and dialog box Pin
Ravi Bhavnani9-Apr-04 9:23
professionalRavi Bhavnani9-Apr-04 9:23 
Ideally, the data processing library (MCB_Library) shouldn't contain any GUI calls. If there's a need for MCB_Library to get information from the client application at run-time, you might want to make MCB_Library call into its client and execute a known data retrieval method.

For example, define an interface (an abstract base class with a single pure virtual method) called IMCB_Client.

class IMCB_Client
{
public:
  IMCB_Client() {};
  virtual ~IMCB_Client() {};

public:
  virtual bool getDataFromUser
    (void* pData) = 0;
}
Your MIM application should "implement" the interface (by simply multiply inheriting from IMCB_Client), like so:
class CMimApp : public CWinApp,
                public IMCB_Client()
{
  ...
  // IMCB_Client implementation
  public:
    bool getDataFromUser
      (void* pData);
}
The implementation of CMimApp::getDataFromUser() should display the appropriate dialog and store the desired information in pData. The method could return false to indicate the data is not available. CMimApp should register itself as a client of MCB_Library. This just means storing a pointer to CMimApp in MCB_Library.

Finally, replace your call to display the dialog in MCB_Library with this code:
ASSERT (m_pClient != NULL);
DATA someData;
bool bGotData = m_pClient->getDataFromUser (&someData);
if (bGotData)
   ...
/ravi

My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com

GeneralShutting Down when not Logged on Pin
reymano9-Apr-04 8:33
reymano9-Apr-04 8:33 
GeneralRe: Shutting Down when not Logged on Pin
avenger_sb2510-Apr-04 17:45
avenger_sb2510-Apr-04 17:45 
GeneralRe: Shutting Down when not Logged on Pin
reymano11-Apr-04 3:10
reymano11-Apr-04 3:10 
GeneralDisplay Items on Active Desktop Pin
microcyb9-Apr-04 7:58
microcyb9-Apr-04 7:58 
General"Cl.exe - No Disk" Pin
Matthew Fleming9-Apr-04 6:53
Matthew Fleming9-Apr-04 6:53 
GeneralRe: "Cl.exe - No Disk" Pin
Andrew Lawrence9-Feb-10 12:07
Andrew Lawrence9-Feb-10 12:07 
GeneralCapturing Resing of Window event Pin
Adi Narayana9-Apr-04 6:44
Adi Narayana9-Apr-04 6:44 
GeneralRe: Capturing Resing of Window event Pin
Ravi Bhavnani9-Apr-04 6:56
professionalRavi Bhavnani9-Apr-04 6:56 
GeneralRe: Capturing Resing of Window event Pin
Michael Dunn9-Apr-04 15:00
sitebuilderMichael Dunn9-Apr-04 15:00 
GeneralRe: Capturing Resing of Window event Pin
Adi Narayana10-Apr-04 1:53
Adi Narayana10-Apr-04 1:53 
GeneralShell Extension ....ICopyHook Interface Pin
ZarrinPour9-Apr-04 4:28
ZarrinPour9-Apr-04 4:28 
GeneralHiding Application from task list Pin
Anonymous9-Apr-04 4:02
Anonymous9-Apr-04 4:02 
GeneralRe: Hiding Application from task list Pin
2249179-Apr-04 4:28
2249179-Apr-04 4:28 
GeneralRe: Hiding Application from task list Pin
Prakash Nadar9-Apr-04 7:51
Prakash Nadar9-Apr-04 7:51 
GeneralRe: Hiding Application from task list Pin
Anonymous9-Apr-04 7:58
Anonymous9-Apr-04 7:58 
GeneralRe: Hiding Application from task list Pin
Prakash Nadar9-Apr-04 8:23
Prakash Nadar9-Apr-04 8:23 
GeneralRe: Hiding Application from task list Pin
Anonymous9-Apr-04 9:09
Anonymous9-Apr-04 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.