×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jan 2007
    Posts
    77

    About logwrap.h logwrap.inl

    Hi !

    I need some help about these files. I'm doing some changes in this object called CLogEvent. We have in the file logwrap.h the following private variables:

    private:
    TLogId iId;
    TUid iEventType;
    TTime iTime;
    TLogDurationType iDurationType;
    TLogDuration iDuration;
    TContactItemId iContact;
    TLogLink iLink;
    TLogFlags iFlags;
    HBufC* iDescription;
    HBufC* iRemoteParty;
    HBufC* iDirection;
    HBufC* iStatus;
    HBufC* iSubject;
    HBufC* iNumber;
    HBufC8* iData;
    };

    I am including one more, called HBufC* Network, and I created the respective methods to Set and Get this variable, just like we have for the others.

    So I implemented the code in the file logwrap.inl .
    But I have realized that I need to find WHERE this variables are initialized, because, as u can see in logwrap.inl (if u don't know, these files are from SDK library), we have there:

    inline void CLogEvent::SetSubject(const TDesC& aSubject)
    /** Sets the subject of this event.

    The subject is represented by a string.

    The string is copied into a pre-allocated heap descriptor that has a maximum
    length of KLogMaxSubjectLength.
    If the length of the specified descriptor
    is greater than KLogMaxSubjectLength, then the data is truncated.

    @param aSubject The subject. */
    {
    TPtr ptr(iSubject->Des());
    ptr.Copy(aSubject.Ptr(), Min(aSubject.Length(), ptr.MaxLength()));
    }

    I tried to do the same method, but for my new variable Network. And I'm getting the error KERNEXEC-3 and crashed the app. And the error is in
    the highlighted line code, just because, I think, I didn`t initialized the variable. So I tried to do that inside this method, and everytime it passes there I got the error USER 44 , because of the kind of declaration pointer and initialization I think.


    So, anyone could help me to find WHERE I need to initilize this variables in
    logwrap.h file?

    Regards
    lm.thiago

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: About logwrap.h logwrap.inl

    what about doing it like this:

    iSubject->Des().Copy(aSubject);

    yucca

  3. #3
    Regular Contributor
    Join Date
    Jan 2007
    Posts
    77

    Re: About logwrap.h logwrap.inl

    Hi! But as I said, I tried it and didn't work.
    It's because when I do the red part of:

    iOperatorLongName->Des().Copy(aOperatorLongName);

    it is already a error, because iOperatorLongName, my new variable added,
    it isn't initialized, just declared in logwrap.h file.

    And I need to find where these variables in .h file are initialized, because
    u can see in the comment (The string is copied into a pre-allocated heap descriptor), that they are pre-allocated somewhere, and I have no idea where is it....

    Please, do u have any idea?

    Regards.
    lm.thiago

  4. #4
    Regular Contributor
    Join Date
    Jan 2007
    Posts
    77

    Re: About logwrap.h logwrap.inl

    Just to complement more information, if I try:

    inline void CLogEvent::SetNetwork(const TDesC& aOperatorLongName)
    {
    RFileLogger iLog;
    iLog.Connect();
    iLog.CreateLog(_L("Logging"),_L("MyLogFile"),EFileLoggingModeAppend);
    iLog.Write(_L("Vou setar!"));
    iLog.CloseLog();
    iLog.Close();

    //iOperatorLongName = HBufC::NewL(30);
    //iOperatorLongName->Des().Copy(aOperatorLongName);
    //iOperatorLongName = aOperatorLongName.AllocLC();

    to do this, like in the lines commented, it "works", but the app crashes like I said because of the declaration pointer, and the way to alloc memory, and got the error USER 44 or 54 i think, don't remember.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×