You Are Here:

Community: Developer Discussion Boards

  « Previous Thread | Next Thread »

#1 Old Post Symbian C++ Expert ltomuta - 2007-12-03, 02:40

Join Date: Jan 2006
Posts: 3,185
Location: Michigan
Nokia Ron's Avatar
Nokia Ron
Offline
Forum Nokia Expert
This week we introduce a new Interview method, Ask the Expert. Unlike the interviews that took several weeks for answers our expert will answer these questions during the week that they are asked, hopefully the day they are asked.

This week our expert is ltomuta a senior engineer that specializes in Symbian C++.

If you have any question about Symbian C++, the SDK, API or anything at all please take advantage this week to "ask the expert".

Ron


Ron Liechty
Manager Forum Nokia Online Community
ron.liechty@nokia.com

#2 Old Exclamation Undefined symbol problem - 2007-12-03, 09:38

Join Date: Dec 2007
Posts: 59
Location: Bangkok
kittinut_k's Avatar
kittinut_k
Offline
Regular Contributor
I have a problem about Undefined symbol.
I would like to insert text to TDesArray by using :

array->InsertL(pos,* newItemText);

When compiling, the result show error massage :

Undefined symbol: 'void CDesC16Array::InsertL(int,class TDesC16 const &) (?InsertL@CDes16Array@@QAEXHABVTDesC16@@@Z)'

and

referenced from ' void CFirstContainer::ListInsertL(void) (?ListInsertL@CFirstContainer@@QAEXXZ)' in FirstContainer.cpp:93

Initially, this function is in the code, copied from the Nokia training program(S60UIControlsLab), yet when copying to my project, it does not work.

Please tell me how to fix this as the below detail
remark if you want more detail,pls mail to kittinut_k@hotmail.com

The ListInsertL function in FirstContainer.cpp

void CFirstContainer::ListInsertL()
{
TBuf<EMaxListEntryLen> textData;
CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL(textData, CAknQueryDialog::ENoTone);

if (dlg->ExecuteLD(R_TEXT_QUERY)) // * User press OK or not, display the query dialog
{
CDesCArray* array = static_cast<CDesCArray*>(iList->Model()->ItemTextArray());
HBufC* newItemText = PrependTabLC(textData);

TInt pos = iList->CurrentItemIndex();

array->InsertL(pos,* newItemText);

iList->HandleItemAdditionL();

CleanupStack::PopAndDestroy(); // newItemText;
}
}

The PrependTabLC function

HBufC* CFirstContainer::PrependTabLC(const TDesC& aText) const
{
HBufC* text = HBufC::NewLC(KTabString().Length() + aText.Length());
*text = KTabString;
TPtr refText = text->Des();
refText.Append(aText);
return text;
}

#3 Old Question How to get the image from server - 2007-12-03, 09:45

Join Date: Dec 2007
Posts: 59
Location: Bangkok
kittinut_k's Avatar
kittinut_k
Offline
Regular Contributor
I would like to use my Symbian phone to get the image from server. The server is connected to internet and Symbian phone will be used to view the image, received from the server.

Actually, I think the PHP programming will be created, but the client side program or engine is the unknown for me.

Please tell me how to carry out it.

#4 Old Re: Undefined symbol problem - 2007-12-03, 11:40

Join Date: Sep 2004
Posts: 7,953
Location: Tampere, Finland
ltomuta's Avatar
ltomuta
Offline
Forum Nokia Expert
Quote:
Originally Posted by kittinut_k View Post
I have a problem about Undefined symbol.
I would like to insert text to TDesArray by using :

Code:
array->InsertL(pos,* newItemText);
When compiling, the result show error massage :

Code:
Undefined symbol: 'void CDesC16Array::InsertL(int,class TDesC16 const &) (?InsertL@CDes16Array@@QAEXHABVTDesC16@@@Z)'
and

Code:
referenced from ' void CFirstContainer::ListInsertL(void) (?ListInsertL@CFirstContainer@@QAEXXZ)'  in FirstContainer.cpp:93
Initially, this function is in the code, copied from the Nokia training program(S60UIControlsLab), yet when copying to my project, it does not work.

Please tell me how to fix this as the below detail
remark if you want more detail,pls mail to kittinut_k@hotmail.com

The ListInsertL function in FirstContainer.cpp

Code:
void CFirstContainer::ListInsertL()
    {
    TBuf<EMaxListEntryLen> textData;
    CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL(textData, CAknQueryDialog::ENoTone);
  
    if (dlg->ExecuteLD(R_TEXT_QUERY)) // * User press OK or not, display the query dialog
        {
        CDesCArray* array = static_cast<CDesCArray*>(iList->Model()->ItemTextArray());
        HBufC* newItemText = PrependTabLC(textData);
	
        TInt pos = iList->CurrentItemIndex();
       
        array->InsertL(pos,* newItemText);

        iList->HandleItemAdditionL();

        CleanupStack::PopAndDestroy(); // newItemText;
        }
    }
The PrependTabLC function

Code:
HBufC* CFirstContainer::PrependTabLC(const TDesC& aText) const
    {
    HBufC* text = HBufC::NewLC(KTabString().Length() + aText.Length());
    *text = KTabString;
    TPtr refText = text->Des();
    refText.Append(aText);
    return text;
    }
"Undefined symbol: ..." is a link error and the first and easy step in fixing it is to make sure that you have all the needed libraries added to your project.

Go to the SDK documentation and search for CDesC16Array. You will find that is defined in header: ???????.h and library ????.lib. Add that library to your MMP file, re-generate the project and rebuild. The problem should disappear ... unless you run into another one.
Last edited by ltomuta : 2007-12-03 at 21:06. Reason: Typos, lots of them..

#5 Old Re: How to get the image from server - 2007-12-03, 11:54

Join Date: Sep 2004
Posts: 7,953
Location: Tampere, Finland
ltomuta's Avatar
ltomuta
Offline
Forum Nokia Expert
Quote:
Originally Posted by kittinut_k View Post
I would like to use my Symbian phone to get the image from server. The server is connected to internet and Symbian phone will be used to view the image, received from the server.

Actually, I think the PHP programming will be created, but the client side program or engine is the unknown for me.

Please tell me how to carry out it.
The design depends greatly on your application's requirements.
  • You can use a browser control to open an URL on your server. The same control will then take care of the image rendering.
  • Or you can have your own customized network engine that passes the retrieved image to your own customized image processing engine.

The Browser Control API is available since S60 2nd Edition, FP3. Examples applications can be found in the SDK.

If you need to implement your own engines look for the following example applications provided by Forum Nokia:
  • Symbian OS: End-to-End HTTP API Example v1.3
  • S60 Platform: HTTP Client API Example v2.0
  • Symbian OS: End-to-End Sockets API Example v1.3
  • S60 Platform: Internet Access Points Example v2.0
  • S60 Platform: Image Converter Example v2.0

#6 Old Re: Sybmain C++ Expert ltomuta - 2007-12-03, 16:12

Join Date: Mar 2003
Posts: 145
lkz633
Offline
Regular Contributor
Hello,

I would like to know if there is any support in Symbian for showing tables inside CEikRichTextEditor or if you have to draw it completly yourself?

Regards and thanks
lkz633

#7 Old Re: Sybmain C++ Expert ltomuta - 2007-12-03, 19:36

Join Date: Sep 2004
Posts: 7,953
Location: Tampere, Finland
ltomuta's Avatar
ltomuta
Offline
Forum Nokia Expert
Quote:
Originally Posted by lkz633 View Post
Hello,

I would like to know if there is any support in Symbian for showing tables inside CEikRichTextEditor or if you have to draw it completely yourself?

Regards and thanks
lkz633
Hi lkz633,

as far as I know the control does not support tables and quite frankly I don't see tables as a must have feature on a phone's small screen. However, I'll look around and get a final answer on this soon.

Update: One clever way of solving the lack of table support is to substitute it with a image representation. Of course you will have to take care of rendering the table and the solution is obviously feasible only for read-only documents. (Thanks symbianyucca!)

Best regards,
Last edited by ltomuta : 2007-12-10 at 18:36. Reason: Updated with workaround suggestion

#8 Old Re: Symbian C++ Expert ltomuta - 2007-12-04, 08:18

Join Date: Aug 2004
Posts: 160
Location: Hyderabad-India
Send a message via Skype™ to vvsnaresh
vvsnaresh's Avatar
vvsnaresh
Offline
Regular Contributor
Hi,

How do I add new fonts(like Telugu,Tamil and other Indian Languages which dont have support on Nokia Browser) to the Nokia Browser of S60 3rd edtion devices.By default it supports Hindi language, but not other Indian Languages.

Is there a way to do that just like our desktop browsers(I know that its not that easy here) ?
What is the best solution to make Nokia Browser support above mentioned unicode languages?

Thank You,


regards,
VVS.Naresh
--

#9 Old Re: Symbian C++ Expert ltomuta - 2007-12-06, 23:25

Join Date: Dec 2006
Posts: 2,094
Sorcery-ltd's Avatar
Sorcery-ltd
Offline
Forum Nokia Champion
Hi,

I want to do something I thought should be simple...

I want to change the background bitmap and colours of the status icons and navigation bar in my application only.

Is there an easy way to do this? Do I have to use the Skins API? Are there any examples anywhere? There seem to be examples for creating skin aware controls but not manipulating the skin using graphics in your applications standard resources (mbm and aif files). Is this possible or do I have to create a skin/theme?

Many thanks in advance,

Sorcery

#10 Old Re: Symbian C++ Expert ltomuta - 2007-12-07, 09:40

Join Date: Sep 2004
Posts: 7,953
Location: Tampere, Finland
ltomuta's Avatar
ltomuta
Offline
Forum Nokia Expert
Quote:
Originally Posted by Sorcery-ltd View Post
Hi,

I want to do something I thought should be simple...

I want to change the background bitmap and colours of the status icons and navigation bar in my application only.

Is there an easy way to do this? Do I have to use the Skins API? Are there any examples anywhere? There seem to be examples for creating skin aware controls but not manipulating the skin using graphics in your applications standard resources (mbm and aif files). Is this possible or do I have to create a skin/theme?

Many thanks in advance,

Sorcery
Hi Sorcery,

I'm not aware of any easy way of doing this. As for a complicated one ... I will have to look for it as this is something I've never done before.

Creating your own theme it will not help much as there is no way to have a per application skin and then you cannot prevent the user from changing its preferred theme to one that is not suitable for your application. Changing the theme dynamically every time your application transitions between foreground and background would have serious performance issues.

Best regards,

(to be continued ...)
Last edited by ltomuta : 2007-12-10 at 18:34. Reason: Removed signature

#11 Old Re: Symbian C++ Expert ltomuta - 2007-12-07, 09:52

Join Date: Sep 2004
Posts: 7,953
Location: Tampere, Finland
ltomuta's Avatar
ltomuta
Offline
Forum Nokia Expert
Quote:
Originally Posted by vvsnaresh View Post
Hi,

How do I add new fonts(like Telugu,Tamil and other Indian Languages which dont have support on Nokia Browser) to the Nokia Browser of S60 3rd edtion devices.By default it supports Hindi language, but not other Indian Languages.

Is there a way to do that just like our desktop browsers(I know that its not that easy here) ?
What is the best solution to make Nokia Browser support above mentioned unicode languages?

Thank You,
Hi, vvsnaresh!

On first look I am tempted to say that yes, the solution must be the same as in desktop browsers and that if the font is available in the system (system\fonts) the browser will load it. The WebKit is open source so you can actually have a look and see if the browser has any special font selection mechanism.

(to be continued ...)
Last edited by ltomuta : 2007-12-10 at 18:35. Reason: Removed signature

#12 Old Post Re: Symbian C++ Expert ltomuta - 2007-12-07, 15:12

Join Date: Aug 2007
Posts: 17
Location: Sevastopol, Ukraine
Carbider's Avatar
Carbider
Offline
Forum Nokia Champion
Hello, expert. Thanks for such an Interview.

My question is:
The RConnection class has Attach() method to associate it with an underlying interface.

I need to create such an underlying interface.

My task is to take all outgoing (maybe incoming) TCP/IP packets and encapsulate them into Bluetooth® packets for further wireless transmission.

Thanks a lot
Konstantine

#13 Old Re: Symbian C++ Expert ltomuta - 2007-12-07, 17:44

Join Date: Sep 2004
Posts: 7,953
Location: Tampere, Finland
ltomuta's Avatar
ltomuta
Offline
Forum Nokia Expert
Quote:
Originally Posted by Carbider View Post
Hello, expert. Thanks for such an Interview.

My question is:
The RConnection class has Attach() method to associate it with an underlying interface.

I need to create such an underlying interface.

My task is to take all outgoing (maybe incoming) TCP/IP packets and encapsulate them into Bluetooth® packets for further wireless transmission.

Thanks a lot
Konstantine
From a RConnection API an interface can be started either implicitly or explicitly. In the first case the interface is started as an effect of opening and using an RSocket or RHostResolver object. Interfaces are explicitly started by calling RConnection::Start, with or without overriding connections's preferences (TCommDbConnPref) as set in the CommDB.

Rather than starting their own interfaces (some times this would not be even possible) the applications have the choice of attaching themselves to an already existing connection/interface. The attachment type is set to EAttachTypeMonitor if a system control type of application wishes to monitor the state of the connection without otherwise affecting it. In particular, the interface idle timers will not be affected. The attachment type is set to EAttachTypeNormal if the application wishes to use the connection for normal data transfer. In this case the idle timers will take that into account.

Once the connection started (or attached) a socket can be open to send data through that particular interface. It is also possible to query the amount of data sent or received through the interface but you cannot get access to the data itself (unless of course you own the socket).
Last edited by ltomuta : 2007-12-10 at 18:33. Reason: Removed signature

#14 Old please help me !!! - 2007-12-10, 11:51

Join Date: Dec 2007
Posts: 6
yancp
Offline
Registered User
i have problem about symbian 3rd.

when i download a file by s60 browser,the file successfully associate with my application ,and the application 's method CxxxDocument::OpenFileL(CFileStore*& aFileStore, RFile& aFile)
will be called,so i can deal with the file by the parameter aFile.

now the problem is that: when the application is running in the backgroud,when i download a file by s60 browser,the file doesn't associate with my application successfully,the CxxxDocument::OpenFileL method is not called but the application is put in foregroud.

my application is stand-alone mode,the APP_REGISTRATION_INFO like below:
RESOURCE APP_REGISTRATION_INFO
{
app_file="testapp";
localisable_resource_file = "\\resource\\apps\\testapp";
localisable_resource_id = R_MEDIACLIENT_LOCALISABLE_APP_INFO;
embeddability=KAppNotEmbeddable;
newfile=KAppDoesNotSupportNewFile;
datatype_list =
{
DATATYPE
{
priority = EDataTypePriorityHigh;
type = "application/newx";
},
DATATYPE
{
priority = EDataTypePriorityHigh;
type = "application/newxx";
}
};
}

this problem puzzle me for one week,is it impossible to recieve any message when the application is runing in the background.if it is possible,how can i do it,which method will be call in my application to deal with the passed parameter.

#15 Old Re: please help me !!! - 2007-12-10, 12:48

Join Date: Sep 2004
Posts: 7,953
Location: Tampere, Finland
ltomuta's Avatar
ltomuta
Offline
Forum Nokia Expert
Quote:
Originally Posted by yancp View Post
i have problem about Symbian 3rd.

when i download a file by s60 browser,the file successfully associate with my application ,and the application 's method CxxxDocument::OpenFileL(CFileStore*& aFileStore, RFile& aFile)
will be called,so i can deal with the file by the parameter aFile.

now the problem is that: when the application is running in the background,when i download a file by s60 browser,the file doesn't associate with my application successfully,the CxxxDocument::OpenFileL method is not called but the application is put in foreground.

my application is stand-alone mode,the APP_REGISTRATION_INFO like below:
Code:
 RESOURCE APP_REGISTRATION_INFO
  {
  app_file="testapp";
  localisable_resource_file = "\\resource\\apps\\testapp";
  localisable_resource_id = R_MEDIACLIENT_LOCALISABLE_APP_INFO;
  embeddability=KAppNotEmbeddable;
  newfile=KAppDoesNotSupportNewFile;
    datatype_list = 
    {
    DATATYPE
        {
        priority = EDataTypePriorityHigh;
        type = "application/newx";
        },
    DATATYPE
        {
        priority = EDataTypePriorityHigh;
        type = "application/newxx";
        }
    };
  }
this problem puzzle me for one week,is it impossible to receive any message when the application is running in the background.if it is possible,how can i do it,which method will be call in my application to deal with the passed parameter.
The solution for your problem is available in our Knowledge Base, see the known issue KIS000588.

You need to implement the PreDocConstructL in your handler application and in it decide if the existing instance should be terminated or rather it should be notified that a new document is available.

P.S. From SDK's documentation: "EDataTypePriorityHigh should only be assigned under exceptional conditions, e.g. if no other application could ever handle a particular MIME type as brilliantly."

Quote:
Originally Posted by yancp View Post
ltomuta :
thank you for you reply.i have try to add the method PreDocConstructL().
but when my application is runing in the backgroud ,i download another file by browser,the file associate with my application ,it seem that the brower start another my application instance and when the new instance run the method PreDocConstructL(),it close the old application instance.
the problem is that:i don't want to my old application instance to be closed,i just want to associate the new download file with my old instance. what can i do? thank you very much.
Well, this is easy. Do not close the existing application instance ... The default behavior is that the 2nd instance simply exits, which is exactly what you want except that you don't want to exit before receiving the new file name in OpenFileL. Once you know the file than needs to be played you will have to pass this information to the old instance (you can send a message to it or use Publish And Subscribe API or ...) and only then exit but not before sending the old instance to foreground.

Quote:
Originally Posted by yancp View Post
i have two problem:
first ,my application now is stand-alone,is it nessesary to change it into embedded(embeddability=KAppEmbeddable). it seems that when it is stand-alone,and the CxxxApplication don't overload the method PreDocConstructL(),the 2nd instance will never be start.the browser only send the old instance to the foreground and the old instance can't deal with the file.

second,how can i send a message.is it task.sendmessage()?
and how can i recieve the message,which method should i overload to recieve it?

waiting for you reply,thanks a lot!
The already mentioned known issue states:

Quote:
Originally Posted by KIS000588

Note that above code works only for stand-alone (non-embedded) handler applications, and required SwEvent capability.
Since I trust my colleague who wrote that line I would suggest that your evaluation might be for some reasons incorrect. Please do try the suggested solution, it should work.

Yes, the message can be sent though TApaTask::SendMessage(). To receive the message you will have to override the ProcessMessageL() method in your apps' CEikAppUi derived class. Please see the SDK help for more information.

Quote:
Originally Posted by yancp View Post
hi itomuta:
my application now is stand-alone mode ,i overload the PreDocConstructL()method in my CxxxApplication class,and the method like this:
Code:
void CMediaClientApplication::PreDocConstructL()
{
  //call PreDocConstructL from base class
  CEikApplication::PreDocConstructL();
}
so now ,when i open another file by browser,the file associate with my app,and app's openfile is called where i can get the file name and send message to the old instance which is runing in the backgroud.the code is like below:

Code:
void CxxxDocument::OpenFileL(CFileStore*& aFileStore, RFile& aFile)
{
aFileStore = NULL;
TFileName fileName;
User::LeaveIfError(aFile.FullName(fileName));
aFile.Close();
CxxxAppUi *appui = static_cast<CxxxAppUi *> (iAppUi);
TInt err = KErrNone; 
TApaTaskList taskList(CEikonEnv::Static()->WsSession()); 
TApaTask task = taskList.FindApp(KUidxxxApp); 
if(task.Exists())
{
   TBuf8<500> params;
   params.Copy((TUint8*)fileName.Ptr(),fileName.Length()*2);
   TUid msgUid( TUid::Uid(KUidApaMessageSwitchOpenFileValue));
   task.BringToForeground();
   TInt error = task.SendMessage(msgUid, params);
   //appui->HandleCommandL(EEikCmdExit); 	
}
}
but the problem is that: task.SendMessage(msgUid, params) return -46 ,so the old instance don't receive the message(i overload the appui's method HandleMessageL() to recieve the message). when there is only one instance .task.SendMessage(msgUid, params) return 0 ,and it receive the message sent by itself.

another puzzle: when there are two instance,how can i know which task is the old instance,and which is the new one,as the uid is the same.when the old one is runing in the backgroud,and i open a new instance by browser,the new instance how to know the old one is runing in the back groud.i think just by the code below can't judge it,because the new instance have the same uid as the old one.
Code:
TApaTaskList taskList(CEikonEnv::Static()->WsSession()); 
TApaTask task = taskList.FindApp(KUidxxxApp);
thanks a lot!
(to be continued ... )
Last edited by ltomuta : 2007-12-10 at 18:31. Reason: Answer follow-up questions.
  « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Symbian C++ or MDIP: some newbie questions sgalmeida General Symbian C++ 2 2006-12-30 09:57
A little survey regarding Java vs Symbian C++ Olnex Mobile Java General 0 2006-11-01 10:00
Question regarding Java vs Symbian C++ Olnex Mobile Java General 5 2006-09-28 00:53
How Can I Use TSmsUserDataSettings in Symbian 6.1? ilsocio General Symbian C++ 2 2003-08-19 17:39
setting of Series 60 MIDP SDK for Symbian OS version 1.2 for networking servigo Mobile Java Networking & Messaging & Security 2 2003-07-31 08:47

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia