The File Server...

Login to reply to this topic.
Fri, 2005-08-19 02:53
Joined: 2005-08-17
Forum posts: 50
Hi, I'd like to ask about the file server connection... I'm sorry i you're gonna say that I should read the docs... It's just that I've just woken up  Grin and doing this is like... Uhmmm... My breakfast... So please understand if I'm a bit a little out of myself right now... So let's get into the question...

1. How do I connect to a file server?
2. What Header does RFs belong to?
3. How do I use it with TFindFile? Suppose I use it to find all .gif files in my directory...

I'll be reading more about this... Hopefully... Your responses would help me understand this a lot better.... Thanks! Grin

Fri, 2005-08-19 03:36
Joined: 2005-08-17
Forum posts: 50
Re: The File Server...
Hi, Here's what I'm doing now...


Code:

RFs                 FileSession;
CDir      *dirList = NULL;
TInt8       i;
TBuf<256>     totalPath;
TBuf<50>       fileName;

TInt       n;


_LIT( KDirName, "c:\\System\\Apps\\Bmpmanip\\" );
_LIT( KFileSpec,"c:\\System\\Apps\\Bmpmanip\\*.gif" );


void CBmpmanipAppView::ConstructL(const TRect& aRect)
    {
    // Create a window for this application view
    CreateWindowL();

    // Set the windows size
    SetRect(aRect);

    // Activate the window, which makes it ready to be drawn
    ActivateL();

//Initialize file iterator to zero
n=0;

//Make a list of gif files and put them into an array
GetFilesL();


iBitmap = new (ELeave) CFbsBitmap();

iRotator = CMdaBitmapRotator::NewL();
iFileSaver = CMdaImageBitmapToFileUtility::NewL(*this);
iScaler = CMdaBitmapScaler::NewL();

iConverter = CMdaImageFileToBitmapUtility::NewL(*this);
//Start an asynchronous process to open the gif file
    iConverter->OpenL(fileName[n]);
    }



void CBmpmanipAppView::GetFilesL()
{
FileSession.Connect();

if( KErrNone != FileSession.GetDir(KFileSpec,KEntryAttMaskSupported,ESortByName,dirList) )
{
return;
}
   
for( i=0;i<dirList->Count();i++ )
{
fileName = (*dirList)[i].iName;
totalPath = KDirName;
totalPath.Append( _L("\\") );
totalPath.Append( fileName );     
}
   
if( dirList )
        {
            delete dirList;
            dirList = NULL;
                }
FileSession.Close();
}


Hmmm... What I intent to do is get the first image stored in in TBuf fileName... I can't figure out what I've been doing wrong... I get the following error messages...


Quote
C:\SYMBIAN\6.1\SERIES60\SERIES60EX\BMPMANIP\SRC\Bmpmanipappview.cpp(84) : error C2664: 'OpenL' : cannot convert parameter 1 from 'unsigned short' to 'const class TDesC16 &'
        Reason: cannot convert from 'unsigned short' to 'const class TDesC16'
        No constructor could take the source type, or constructor overload resolution was ambiguous
Bmpmanipdocument.cpp
Eikonenvironment.cpp
Bmpmanip.uid.cpp
Generating Code...
Error executing cl.exe.

BMPMANIP.APP - 1 error(s), 0 warning(s)


I'd really really really appreciate your help... Thanks! Grin

Fri, 2005-08-19 09:36
Joined: 2005-08-18
Forum posts: 7
Re: The File Server...
fileName is a Tbuf datatype.....

how can u send it as fileName[i];

 instead decleare rpointerarray<hbufc *> filenames;
then filenames.Insert(fileName.Alloc(),position);

now u canpass it as openL(filenames[i]);
  • Login to reply to this topic.