Click here to Skip to main content
15,899,024 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionvc++ Pin
amitesh29112-Sep-05 3:58
sussamitesh29112-Sep-05 3:58 
QuestionMFC Application - Document handling Pin
KSMANN2-Sep-05 3:51
KSMANN2-Sep-05 3:51 
AnswerRe: MFC Application - Document handling Pin
Roger Allen2-Sep-05 6:44
Roger Allen2-Sep-05 6:44 
AnswerRe: MFC Application - Document handling Pin
ThatsAlok2-Sep-05 19:28
ThatsAlok2-Sep-05 19:28 
QuestionLoading Dll and calling class's methods Pin
Bernard382-Sep-05 3:38
Bernard382-Sep-05 3:38 
AnswerRe: Loading Dll and calling class's methods Pin
Cedric Moonen2-Sep-05 3:49
Cedric Moonen2-Sep-05 3:49 
GeneralRe: Loading Dll and calling class's methods Pin
Bernard382-Sep-05 4:36
Bernard382-Sep-05 4:36 
GeneralRe: Loading Dll and calling class's methods Pin
Cedric Moonen2-Sep-05 5:12
Cedric Moonen2-Sep-05 5:12 
From what I know, you cannot. The compiler needs to know if the function you are calling is included in the file.

One solution to overcome the problem of including both the *.h and the *.cpp files in your project is to use an interface for your class: you just make your class inherits from a pure abstract class (a class that has no member variables and whose functions needs to be redefined in the child class). Something like:

class MyInterface<br />
{<br />
   // Constructor + Destructor<br />
<br />
   void Method1() = 0;<br />
   void Method2() = 0;<br />
   ....<br />
}


And in a separate file, you define your class that inherits of MyInterface:
class MyClass : public MyInterface<br />
{<br />
   void Method1();<br />
   void Method2();<br />
}


And the functions arre defined in the cpp file of the class.

So like that you only need to provide the .h file of the interface to your program and your program will only use a pointer to the interface. But inside the dll, when you create the pointer, you create in fact the child class.

Hope this helps
Questionisspace. What about isreturn Pin
LCI2-Sep-05 3:35
LCI2-Sep-05 3:35 
AnswerRe: isspace. What about isreturn Pin
toxcct2-Sep-05 4:03
toxcct2-Sep-05 4:03 
GeneralRe: isspace. What about isreturn Pin
LCI2-Sep-05 4:30
LCI2-Sep-05 4:30 
AnswerRe: isspace. What about isreturn Pin
toxcct2-Sep-05 4:36
toxcct2-Sep-05 4:36 
QuestionI need to load custom data to Analysis Server (MS-OLAP) without going through any OLE DB Pin
kuldeepjangir2-Sep-05 3:15
kuldeepjangir2-Sep-05 3:15 
Question0xc0000005 access violation --- Need Urgent help... Pin
Smita Duraphe2-Sep-05 3:06
Smita Duraphe2-Sep-05 3:06 
AnswerRe: 0xc0000005 access violation --- Need Urgent help... Pin
ThatsAlok2-Sep-05 20:38
ThatsAlok2-Sep-05 20:38 
QuestionOutlook mail list Pin
Member 2434132-Sep-05 2:36
Member 2434132-Sep-05 2:36 
AnswerRe: Outlook mail list Pin
ThatsAlok2-Sep-05 19:30
ThatsAlok2-Sep-05 19:30 
QuestionDirectX SDK impact on performances Pin
uplink22-Sep-05 2:18
uplink22-Sep-05 2:18 
GeneralRe: DirectX SDK impact on performances Pin
LeFauve2-Sep-05 6:20
LeFauve2-Sep-05 6:20 
GeneralRe: DirectX SDK impact on performances Pin
LeFauve3-Sep-05 23:51
LeFauve3-Sep-05 23:51 
QuestionVC6 -&gt; .NET Pin
mcsherry2-Sep-05 2:12
mcsherry2-Sep-05 2:12 
AnswerRe: VC6 -&gt; .NET Pin
toxcct2-Sep-05 2:40
toxcct2-Sep-05 2:40 
GeneralRe: VC6 -&gt; .NET Pin
mcsherry2-Sep-05 2:54
mcsherry2-Sep-05 2:54 
GeneralRe: VC6 -&gt; .NET Pin
toxcct2-Sep-05 2:59
toxcct2-Sep-05 2:59 
GeneralRe: VC6 -&gt; .NET Pin
mcsherry2-Sep-05 3:18
mcsherry2-Sep-05 3:18 

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.