Click here to Skip to main content
15,886,067 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange Pin
Stefan_Lang13-Oct-14 2:41
Stefan_Lang13-Oct-14 2:41 
QuestionMFC Ribbon Editor Pin
Richard Andrew x6410-Oct-14 9:30
professionalRichard Andrew x6410-Oct-14 9:30 
QuestionCListBox Header Pin
D.Manivelan10-Oct-14 3:08
D.Manivelan10-Oct-14 3:08 
AnswerRe: CListBox Header Pin
jeron110-Oct-14 6:57
jeron110-Oct-14 6:57 
QuestionUndeclared identifier in API Pin
piul9-Oct-14 4:00
piul9-Oct-14 4:00 
QuestionRe: Undeclared identifier in API Pin
CPallini9-Oct-14 4:17
mveCPallini9-Oct-14 4:17 
AnswerRe: Undeclared identifier in API Pin
piul9-Oct-14 5:01
piul9-Oct-14 5:01 
AnswerRe: Undeclared identifier in API Pin
Orjan Westin9-Oct-14 5:06
professionalOrjan Westin9-Oct-14 5:06 
You can use the pimpl idiom:

C++
//libApi.h

class MyApiClass{
  public:
  //some methods, the implementation of which is simply forwarding to MyApiClassImpl ...
  private:
  // forward declaration of implementation details
  class MyApiClassImpl;
  //
  std::auto_ptr<MyApiClassImpl> impl;
};

and
C++
// libApi.cpp
#include <map>
#include <string>
#include "Param.h"

// Declaration of implementation class
class MyApiClass::MyApiClassImpl
{
public:
  // Mirroring MyApiClass...
private:
  std::map<std::string, Param> vars;
};

// Implementation of API class
MyApiClass::MyApiClass()
: impl(new MyApiClassImpl())
{}

int MyApiClass::SomeFunction()
{
  return impl->SomeFunction();
}

// Implementation class
MyApiClass::MyApiClassImpl::MyApiClassImpl()
{}

int MyApiClass::MyApiClassImpl::SomeFunction()
{
  // Do the stuff...
}


(Edited to fix code written too fast...)

modified 9-Oct-14 11:12am.

GeneralRe: Undeclared identifier in API Pin
Freak309-Oct-14 22:28
Freak309-Oct-14 22:28 
GeneralRe: Undeclared identifier in API Pin
Orjan Westin9-Oct-14 23:02
professionalOrjan Westin9-Oct-14 23:02 
QuestionCOM Component Pin
john56329-Oct-14 1:45
john56329-Oct-14 1:45 
AnswerRe: COM Component Pin
«_Superman_»9-Oct-14 2:26
professional«_Superman_»9-Oct-14 2:26 
QuestionC++ MFC Dialog Password encryption Vs2005 [moved] Pin
WinterC7-Oct-14 20:16
WinterC7-Oct-14 20:16 
GeneralRe: C++ MFC Dialog Password encryption Vs2005 Pin
Nelek8-Oct-14 0:08
protectorNelek8-Oct-14 0:08 
AnswerRe: C++ MFC Dialog Password encryption Vs2005 [moved] Pin
Richard MacCutchan8-Oct-14 4:16
mveRichard MacCutchan8-Oct-14 4:16 
RantDoes this line of code bother anyone? Pin
stgagnon7-Oct-14 11:29
stgagnon7-Oct-14 11:29 
GeneralRe: Does this line of code bother anyone? Pin
«_Superman_»7-Oct-14 15:53
professional«_Superman_»7-Oct-14 15:53 
GeneralRe: Does this line of code bother anyone? Pin
stgagnon8-Oct-14 2:36
stgagnon8-Oct-14 2:36 
GeneralRe: Does this line of code bother anyone? Pin
Richard MacCutchan7-Oct-14 22:40
mveRichard MacCutchan7-Oct-14 22:40 
GeneralRe: Does this line of code bother anyone? Pin
stgagnon8-Oct-14 2:38
stgagnon8-Oct-14 2:38 
GeneralRe: Does this line of code bother anyone? Pin
Richard MacCutchan8-Oct-14 2:48
mveRichard MacCutchan8-Oct-14 2:48 
QuestionRe: Does this line of code bother anyone? Pin
CPallini7-Oct-14 23:06
mveCPallini7-Oct-14 23:06 
GeneralRe: Does this line of code bother anyone? Pin
stgagnon8-Oct-14 2:41
stgagnon8-Oct-14 2:41 
AnswerRe: Does this line of code bother anyone? Pin
Stefan_Lang13-Oct-14 3:00
Stefan_Lang13-Oct-14 3:00 
GeneralRe: Does this line of code bother anyone? Pin
Chris Maunder8-Oct-14 3:07
cofounderChris Maunder8-Oct-14 3:07 

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.