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

C / C++ / MFC

 
GeneralUpload file using Wininet Pin
Member 65656011-Nov-03 9:55
Member 65656011-Nov-03 9:55 
GeneralRe: Upload file using Wininet Pin
Johnny ²11-Nov-03 11:41
Johnny ²11-Nov-03 11:41 
GeneralRe: Upload file using Wininet Pin
Member 65656012-Nov-03 0:58
Member 65656012-Nov-03 0:58 
GeneralProblem storing pointer to parent Pin
srev11-Nov-03 9:20
srev11-Nov-03 9:20 
GeneralRe: Problem storing pointer to parent Pin
TFrancis11-Nov-03 9:45
TFrancis11-Nov-03 9:45 
GeneralRe: Problem storing pointer to parent Pin
srev11-Nov-03 9:50
srev11-Nov-03 9:50 
GeneralRe: Problem storing pointer to parent Pin
Christian Graus11-Nov-03 9:46
protectorChristian Graus11-Nov-03 9:46 
GeneralRe: Problem storing pointer to parent Pin
Antti Keskinen11-Nov-03 10:13
Antti Keskinen11-Nov-03 10:13 
Humm..

Here's a common solution I use to solve these types of problems: take each .cpp file you have and see what includes they make. Include, afterall, does nothing else than slap the entire file specified to the position where the command is. This is the easy way to think it.

Following this logic, if you want to avoid including a header file, you can always use the extern keyword. This word, when placed in front of a type, specifies that this type is declared in some other object module. The linker is then responsible to finding this declaration, and if you have the view class header included in any other .cpp file taking part in the linking process, the declaration of the class will be found.

Hence, just put a 'extern class CMyDerivedView' and include a 'CMyDerivedView* pParent' to the property page class. Make sure that the .cpp file of CMyDerivedView is partaking the build when using this solution.

Note that when you have a pointer to your class, you can always access the parent CView class of your view class by using the GetParent method (assuming the property pages are children of the view). This way, you can access the CView master class. Doing a 'DYNAMIC_DOWNCAST' from this pointer to your derived view class is then possible.

This means that in the most extreme case, all that is required is to put a 'extern class CMyDerivedView' in the property page .cpp file, and then using this method to access the parent view. However, this variable will remain global and may cause further problems down the road.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Problem storing pointer to parent Pin
srev11-Nov-03 10:44
srev11-Nov-03 10:44 
GeneralCompiling error Pin
Azzedine11-Nov-03 9:07
Azzedine11-Nov-03 9:07 
GeneralRe: Compiling error Pin
David Crow11-Nov-03 9:46
David Crow11-Nov-03 9:46 
QuestionReduce flicker in ListView ? Pin
_skidrow_vn_11-Nov-03 7:59
_skidrow_vn_11-Nov-03 7:59 
AnswerRe: Reduce flicker in ListView ? Pin
David Crow11-Nov-03 8:18
David Crow11-Nov-03 8:18 
GeneralRe: Reduce flicker in ListView ? Pin
Signal-911-Nov-03 8:39
Signal-911-Nov-03 8:39 
GeneralRe: Reduce flicker in ListView ? Pin
David Crow11-Nov-03 8:44
David Crow11-Nov-03 8:44 
GeneralRe: Reduce flicker in ListView ? Pin
Signal-911-Nov-03 11:40
Signal-911-Nov-03 11:40 
GeneralRe: Reduce flicker in ListView ? Pin
David Crow12-Nov-03 2:58
David Crow12-Nov-03 2:58 
GeneralRe: Reduce flicker in ListView ? Pin
Signal-912-Nov-03 9:37
Signal-912-Nov-03 9:37 
Generalopening a web file Pin
doctorpi11-Nov-03 7:57
doctorpi11-Nov-03 7:57 
GeneralRe: opening a web file Pin
David Crow11-Nov-03 8:12
David Crow11-Nov-03 8:12 
GeneralRe: opening a web file Pin
doctorpi11-Nov-03 8:16
doctorpi11-Nov-03 8:16 
GeneralRe: opening a web file Pin
RaajaOfSelf11-Nov-03 22:40
RaajaOfSelf11-Nov-03 22:40 
GeneralRe: opening a web file Pin
Chris Hills12-Nov-03 23:07
Chris Hills12-Nov-03 23:07 
Generalopen a workbrook automation excel Pin
jerome_data11-Nov-03 7:55
jerome_data11-Nov-03 7:55 
GeneralRe: open a workbrook automation excel Pin
David Crow11-Nov-03 8:05
David Crow11-Nov-03 8:05 

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.