Click here to Skip to main content
15,918,889 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: link error Pin
Tomasz Sowinski13-Aug-02 9:40
Tomasz Sowinski13-Aug-02 9:40 
GeneralRe: link error Pin
RocardoS13-Aug-02 9:56
sussRocardoS13-Aug-02 9:56 
GeneralRe: link error Pin
Tomasz Sowinski13-Aug-02 10:01
Tomasz Sowinski13-Aug-02 10:01 
GeneralRe: link error Pin
RocardoS13-Aug-02 10:16
sussRocardoS13-Aug-02 10:16 
Generalmultiple recordsets Pin
danag13-Aug-02 9:30
danag13-Aug-02 9:30 
GeneralRe: multiple recordsets Pin
Bill Wilson13-Aug-02 13:09
Bill Wilson13-Aug-02 13:09 
GeneralRe: multiple recordsets Pin
danag13-Aug-02 13:35
danag13-Aug-02 13:35 
GeneralRe: multiple recordsets Pin
Alexander Wiseman13-Aug-02 14:54
Alexander Wiseman13-Aug-02 14:54 
Hello!

You cannot call the 'GetDocument()' function of a view before you call 'CRecordView::OnInitialUpdate()'. Your program crashes because GetDocument() does not know what to return.

Let me quickly explain. The CRecordView::OnInitialUpdate function hooks your view into the document, so that you can always retreive the associated document with GetDocument(). If you try and call GetDocument() before that, it will probably return NULL, giving you an 'Unhandled exception' (trying to access something in a NULL pointer).

So, you code should look something like this (minus the comments, of course, which just explain what I'm doing):
void CMgen1View::OnInitialUpdate()
{
    //Always call this before calling GetDocument:
    CRecordView::OnInitialUpdate();

    //Now the view is hooked to the document, so get the set:
    m_pSet = GetDocument()->m_mgen1Set;
    LoadListbox();
}


Hope that helps!

Sincerely,
Alexander Wiseman

Est melior esse quam videri
It is better to be than to seem
Generalmodeless dialog-Resizing Pin
udayGovekar13-Aug-02 9:23
udayGovekar13-Aug-02 9:23 
GeneralRe: modeless dialog-Resizing Pin
Tomasz Sowinski13-Aug-02 9:26
Tomasz Sowinski13-Aug-02 9:26 
QuestionHow do i use acmFormatEnum? All help is appreciated! Pin
redeemer13-Aug-02 9:10
redeemer13-Aug-02 9:10 
AnswerRe: How do i use acmFormatEnum? All help is appreciated! Pin
Ernest Laurentin13-Aug-02 10:46
Ernest Laurentin13-Aug-02 10:46 
AnswerRe: How do i use acmFormatEnum? All help is appreciated! Pin
Ernest Laurentin14-Aug-02 17:40
Ernest Laurentin14-Aug-02 17:40 
GeneralCOleSafeArray Pin
Mazdak13-Aug-02 9:08
Mazdak13-Aug-02 9:08 
GeneralRe: COleSafeArray Pin
Ernest Laurentin13-Aug-02 10:06
Ernest Laurentin13-Aug-02 10:06 
Generalchar representation of a double Pin
senorbuckwheat13-Aug-02 8:22
senorbuckwheat13-Aug-02 8:22 
GeneralRe: char representation of a double Pin
Chris Losinger13-Aug-02 8:30
professionalChris Losinger13-Aug-02 8:30 
GeneralRe: char representation of a double Pin
Tomasz Sowinski13-Aug-02 8:31
Tomasz Sowinski13-Aug-02 8:31 
Generalmodal dialog range checking Pin
jimNLX13-Aug-02 8:19
jimNLX13-Aug-02 8:19 
GeneralRe: modal dialog range checking Pin
Tomasz Sowinski13-Aug-02 8:21
Tomasz Sowinski13-Aug-02 8:21 
GeneralRe: modal dialog range checking Pin
jimNLX13-Aug-02 8:23
jimNLX13-Aug-02 8:23 
GeneralRe: modal dialog range checking Pin
Tomasz Sowinski13-Aug-02 8:28
Tomasz Sowinski13-Aug-02 8:28 
GeneralRe: modal dialog range checking Pin
jimNLX13-Aug-02 8:43
jimNLX13-Aug-02 8:43 

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.