Nicht statische Elemente, auf die in statischen Funktionen nicht zugegriffen werden kann

Ich habe eine Funktion definiert

HRESULT AMEPreviewHandler:: CreateHtmlPreview()
{
    ULONG  CbRead;
    const int Size= 115000;
    char Buffer[Size+1];
    HRESULT hr = m_pStream->Read(Buffer, Size, &CbRead ); 
    //this m_pStream is not accessible here even it is declared globally. the program is asking me to 
    // declare it static because this CreateHtmlPreview() function called 
    //inside the Static function (i mean here :-static CreateDialog\WM_Command\CreateHtmlPreview();)
    //but if i declare it static the two problems arised are 
    //(1.) It is not able to access the value of the m_pStream which is defined globally.
    //(2.)If i declare it static globally then there are so many other function which are using this
    // value of m_pStream are not able to access it because they are non static.  

}

Es wird irgendwo in meinem Programm als statisch deklariert:

static HRESULT CreateHtmlPreview(); //i have declared it static because i am calling this function from DialogProc function.If i dont create it static here it dont work

//The function CreateHtmlPreview() is called inside the DialogProc function like this-

BOOL CALLBACK AMEPreviewHandler::DialogProc(HWND m_hwndPreview, UINT Umsg, WPARAM wParam, LPARAM lParam) 
{......
case WM_COMMAND:
{  
    int ctl = LOWORD(wParam);
    int event = HIWORD(wParam);

    if (ctl == IDC_PREVIOUS && event == BN_CLICKED ) 
    {                       
        CreateHtmlPreview(); //here i am calling the function
        return 0;
    }  
}

}

Was kann also getan werden, um den Wert nicht statisch zu machen?m_pStream zugänglich in der statischenCreateHtmlPreview() Funktionsdefinition?

Antworten auf die Frage(4)

Ihre Antwort auf die Frage