×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    13

    After call the function, the simulator close

    I read string from file. I just send this string to server. But at the same time,the simulator close. When the connection sets up(use socket),I need sending the string to server.(In mobile use symbian c++,and server use Java in PC).
    The problem is in ChatInet.cpp. The function is RequestData(). When I receive 'a' from server,I read string from file and send message to server. But at the same time the simulator will close.

    I don't know why simulator closed. Anybody know it? Thanks.

    The program is here:
    http://tinyurl.com/nxx4t9

  2. #2
    Registered User
    Join Date
    Jun 2008
    Location
    India
    Posts
    1,048

    Re: After call the function, the simulator close

    Hi,

    I think nobody can tell you exactly what is happening. But may be your code is leaving with any exception. You can or should debug your code and see what is happening and in which function it is leaving and why? Always try debugging first of all before posting.

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    13

    Re: After call the function, the simulator close

    Ok,but the simulator just close. No message in this program. How do I debug it? I am novice in symbian. Thanks

  4. #4
    Registered User
    Join Date
    Jun 2008
    Location
    India
    Posts
    1,048

    Re: After call the function, the simulator close

    Hi,

    Are you using Carbide for development? If you have not done debugging yet then you can go through wiki to learn how to do debugging on emulators and device both. I am also giving a link to you.

    http://wiki.forum.nokia.com/index.ph...gging_Articles

  5. #5
    Registered User
    Join Date
    Jun 2008
    Posts
    13

    Re: After call the function, the simulator close

    Yes,I use the carbide to development. But there is no error message,it can start the emulators to execute my program. Thanks

  6. #6
    Registered User
    Join Date
    Feb 2007
    Location
    Tampere
    Posts
    370

    Re: After call the function, the simulator close

    Hi,

    As you have noticed, the problem is when you send the data and not while receiving it.
    So may be you can put break points in the send part of your code and Step through that code (debug over each line), so that we know which line fails. Also would help if you can post your code over here and mark line which fails, so that someone on forum can help you with it.
    Regards

    - MVP
    "Dare To Dream" - A.P.J.Kalam

  7. #7
    Registered User
    Join Date
    Jun 2008
    Posts
    13

    Re: After call the function, the simulator close

    Thanks. How do I set breakpoint in my program?
    I am new in symbian.

  8. #8
    Registered User
    Join Date
    Feb 2007
    Location
    Tampere
    Posts
    370

    Re: After call the function, the simulator close

    Hi,

    Assuming you are using Carbide and your project is open
    Say you are Send file name is "SendMe.cpp" and your function is "sendnow()"
    Goto first line in that function and then goto carbide menu options above "Run"->"Toggle breakPoint"
    Regards

    - MVP
    "Dare To Dream" - A.P.J.Kalam

  9. #9
    Registered User
    Join Date
    Jun 2008
    Posts
    13

    Re: After call the function, the simulator close

    Thanks. I will try it.

  10. #10
    Registered User
    Join Date
    Jun 2008
    Posts
    13

    Re: After call the function, the simulator close

    I set breakpoint in my program,and just run in debug mode.
    If the line(marked with breakpoint) is fail,any message will display?
    I don't get error message,and the emulators close. Thanks

  11. #11
    Registered User
    Join Date
    Feb 2007
    Location
    Tampere
    Posts
    370

    Re: After call the function, the simulator close

    Hi,

    Not necessarily you get message, but you can probably see some error in your debug window, Also now that you know which line fails, you should now investigate why that line fails, was the variable on that line defined earlier, is the object used on that line valid etc. worth asking your co-worker to help you at this point to understand further steps, than asking every step on the forum.
    Regards

    - MVP
    "Dare To Dream" - A.P.J.Kalam

  12. #12
    Registered User
    Join Date
    Jun 2008
    Location
    India
    Posts
    1,048

    Re: After call the function, the simulator close

    After putting breakpoints in your function just watch closely the flow in debug mode. You have to detect on which particular line your code is leaving. you can see it on console.

  13. #13
    Registered User
    Join Date
    Jun 2008
    Posts
    13

    Re: After call the function, the simulator close

    case'a':
    _LIT(KFILE,"c:\\kk.txt");
    RFileReadStream read; read.Open(CCoeEnv::Static()->FsSession(),KFILE,EFileRead);
    TBuf<40> buf2;
    read.ReadL(buf2,27);
    read.Close();
    SendMessageL(buf2);
    break;

    In debug mode,it display Suspended:Breakpoint hit
    The red line is Suspended

  14. #14
    Registered User
    Join Date
    Feb 2007
    Location
    Tampere
    Posts
    370

    Re: After call the function, the simulator close

    Write your line read.Open(CCoeEnv::Static()->FsSession(),KFILE,EFileRead); to User::Leave(read.Open(CCoeEnv::Static()->FsSession(),KFILE,EFileRead));

    Also verify your file "kk.txt" exists at the location given "c:\"
    Regards

    - MVP
    "Dare To Dream" - A.P.J.Kalam

  15. #15
    Registered User
    Join Date
    Jun 2008
    Location
    India
    Posts
    1,048

    Re: After call the function, the simulator close

    Hi,

    The problem is in this line

    RFileReadStream read; // declaration
    or in opening the file.

Similar Threads

  1. how to call function from main
    By amitkamboj in forum Symbian
    Replies: 8
    Last Post: 2009-04-03, 11:42
  2. Default call to Draw Function
    By nisheethpandey in forum Symbian User Interface
    Replies: 6
    Last Post: 2009-02-17, 18:30
  3. data call function
    By greenhornx in forum General Development Questions
    Replies: 0
    Last Post: 2004-07-23, 04:08
  4. Cannot compile SDK's examples for 7650 platform...
    By midletsoft in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-08-12, 19:11
  5. Problem with Nokia D211 Linux Drivers
    By fiveam in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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