Fetching binary file linked in URL

I have to write a console application which will fetch a zip on a daily
basis.
This zip file is hotlinked in a web page. The name of this .zip file will
change every day. I've been able to start the session, open the URL,
read each line, and get the line with the .zip file URL in it no problem.
Where I am running intro trouble is writing the zip file to disk as binary.
I'm following the example from the VC++ Online Help reference to
CFile::Open(). Can anyone see what I am doing wrong ?

thanks in advance.

#include <afx.h>
#include <afxwin.h>
#include <afxinet.h>
#include <iostream>
#include <stdlib.h>

int main(int argc, _TCHAR* argv[])
{
    CStdioFile* pRemoteURLFile;
    CStdioFile* pRemoteZipFile;
    CFile* pLocalZipFile;
    CInternetSession pSessionURL("URLSession");
    CInternetSession pSessionZip("ZipSession");
    char* ziptag = "shapefile";
    CString sURL;
    CString sZipURL;
    CString sReadLine;
    char* pFileName = "test.dat";
    int iFound;
    int iNumLines;
    UINT nBytesRead;
    char pbuf[100];
    CFileException  cFileErr;
    pRemoteURLFile = NULL;
    pRemoteZipFile = NULL;
    pLocalZipFile = NULL;
    iNumLines = nBytesRead = 0;
    sURL = "http://activefiremaps.fs.fed.us/fireptdata/modisfire_2004.htm";
    pRemoteURLFile =
pSessionURL.OpenURL(sURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
    while (pRemoteURLFile->ReadString(sReadLine))
    {
        iNumLines ++;
        iFound = sReadLine.Find("shapefile");
        if (iFound > 0)
        {
            sZipURL = getZIPURL(sReadLine,ziptag,sURL);
        }
    }
    delete pRemoteURLFile;
    pSessionURL.Close;

    pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
    pRemoteZipFile =
pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);

    //** The below line fails **
   if( pLocalZipFile->Open(pFileName, CFile::modeCreate | CFile::modeWrite |
CFile::typeBinary, &cFileErr ) )
   {
        while (pRemoteZipFile->Read(pbuf,100))
        {
            //count bytes read to see if size of file is correct
            nBytesRead = nBytesRead + sizeof(pbuf);

            //** write binary date to pLocalZipFile here **
        }
        printf("%d bytes read from remote file %s\n",nBytesRead,sZipURL);
        delete pRemoteZipFile;
        pSessionZip.Close;
        return 0;
   }
}


0
11/12/2004 5:02:00 PM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
539 Views

Similar Articles

[PageSpeed] 1

"David Jacques" <David.Jacques@ccrs.nrcan.gc.ca> wrote in message 
news:cn2qa9$c6t1@nrn2b.NRCan.gc.ca...
>I have to write a console application which will fetch a zip on a daily
> basis.
> This zip file is hotlinked in a web page. The name of this .zip file will
> change every day. I've been able to start the session, open the URL,
> read each line, and get the line with the .zip file URL in it no problem.
> Where I am running intro trouble is writing the zip file to disk as 
> binary.
> I'm following the example from the VC++ Online Help reference to
> CFile::Open(). Can anyone see what I am doing wrong ?
>
> thanks in advance.

CFile appears to be an MFC class.  As such, you need to ask in an mfc or 
vc++ newsgroup for specifics on dealing with it.  This group deals only with 
standard C++ language issues, not platform or implementation-specific 
issues.

-Howard


0
alicebt (2)
11/12/2004 5:42:38 PM
What is coming back in cFileErr from
if( pLocalZipFile->Open(pFileName, CFile::modeCreate | CFile::modeWrite | 
CFile::typeBinary, &cFileErr ) ) ?

Also, are your certain your app has write permission to pFileName?

Jim H


"David Jacques" <David.Jacques@ccrs.nrcan.gc.ca> wrote in message 
news:cn2qa9$c6t1@nrn2b.NRCan.gc.ca...
>I have to write a console application which will fetch a zip on a daily
> basis.
> This zip file is hotlinked in a web page. The name of this .zip file will
> change every day. I've been able to start the session, open the URL,
> read each line, and get the line with the .zip file URL in it no problem.
> Where I am running intro trouble is writing the zip file to disk as 
> binary.
> I'm following the example from the VC++ Online Help reference to
> CFile::Open(). Can anyone see what I am doing wrong ?
>
> thanks in advance.
>
> #include <afx.h>
> #include <afxwin.h>
> #include <afxinet.h>
> #include <iostream>
> #include <stdlib.h>
>
> int main(int argc, _TCHAR* argv[])
> {
>    CStdioFile* pRemoteURLFile;
>    CStdioFile* pRemoteZipFile;
>    CFile* pLocalZipFile;
>    CInternetSession pSessionURL("URLSession");
>    CInternetSession pSessionZip("ZipSession");
>    char* ziptag = "shapefile";
>    CString sURL;
>    CString sZipURL;
>    CString sReadLine;
>    char* pFileName = "test.dat";
>    int iFound;
>    int iNumLines;
>    UINT nBytesRead;
>    char pbuf[100];
>    CFileException  cFileErr;
>    pRemoteURLFile = NULL;
>    pRemoteZipFile = NULL;
>    pLocalZipFile = NULL;
>    iNumLines = nBytesRead = 0;
>    sURL = "http://activefiremaps.fs.fed.us/fireptdata/modisfire_2004.htm";
>    pRemoteURLFile =
> pSessionURL.OpenURL(sURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>    while (pRemoteURLFile->ReadString(sReadLine))
>    {
>        iNumLines ++;
>        iFound = sReadLine.Find("shapefile");
>        if (iFound > 0)
>        {
>            sZipURL = getZIPURL(sReadLine,ziptag,sURL);
>        }
>    }
>    delete pRemoteURLFile;
>    pSessionURL.Close;
>
>    pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>    pRemoteZipFile =
> pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>
>    //** The below line fails **
>   if( pLocalZipFile->Open(pFileName, CFile::modeCreate | CFile::modeWrite 
> |
> CFile::typeBinary, &cFileErr ) )
>   {
>        while (pRemoteZipFile->Read(pbuf,100))
>        {
>            //count bytes read to see if size of file is correct
>            nBytesRead = nBytesRead + sizeof(pbuf);
>
>            //** write binary date to pLocalZipFile here **
>        }
>        printf("%d bytes read from remote file %s\n",nBytesRead,sZipURL);
>        delete pRemoteZipFile;
>        pSessionZip.Close;
>        return 0;
>   }
> }
>
> 


0
jnhtx (73)
11/12/2004 6:04:45 PM
What is the content of the CFileException (cFileErr) that you passed ?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/
_mfc_cfile.3a3a.open.asp

Many possibilities , but I think the following is the most likely: " One
access permission and one share option are required ". Add one
(CFile::shareExclusive by exemple).

Liviu

"David Jacques" <David.Jacques@ccrs.nrcan.gc.ca> wrote in message
news:cn2qa9$c6t1@nrn2b.NRCan.gc.ca...
> I have to write a console application which will fetch a zip on a daily
> basis.
> This zip file is hotlinked in a web page. The name of this .zip file will
> change every day. I've been able to start the session, open the URL,
> read each line, and get the line with the .zip file URL in it no problem.
> Where I am running intro trouble is writing the zip file to disk as
binary.
> I'm following the example from the VC++ Online Help reference to
> CFile::Open(). Can anyone see what I am doing wrong ?
>
> thanks in advance.
>
> #include <afx.h>
> #include <afxwin.h>
> #include <afxinet.h>
> #include <iostream>
> #include <stdlib.h>
>
> int main(int argc, _TCHAR* argv[])
> {
>     CStdioFile* pRemoteURLFile;
>     CStdioFile* pRemoteZipFile;
>     CFile* pLocalZipFile;
>     CInternetSession pSessionURL("URLSession");
>     CInternetSession pSessionZip("ZipSession");
>     char* ziptag = "shapefile";
>     CString sURL;
>     CString sZipURL;
>     CString sReadLine;
>     char* pFileName = "test.dat";
>     int iFound;
>     int iNumLines;
>     UINT nBytesRead;
>     char pbuf[100];
>     CFileException  cFileErr;
>     pRemoteURLFile = NULL;
>     pRemoteZipFile = NULL;
>     pLocalZipFile = NULL;
>     iNumLines = nBytesRead = 0;
>     sURL =
"http://activefiremaps.fs.fed.us/fireptdata/modisfire_2004.htm";
>     pRemoteURLFile =
> pSessionURL.OpenURL(sURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>     while (pRemoteURLFile->ReadString(sReadLine))
>     {
>         iNumLines ++;
>         iFound = sReadLine.Find("shapefile");
>         if (iFound > 0)
>         {
>             sZipURL = getZIPURL(sReadLine,ziptag,sURL);
>         }
>     }
>     delete pRemoteURLFile;
>     pSessionURL.Close;
>
>
pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>     pRemoteZipFile =
> pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>
>     //** The below line fails **
>    if( pLocalZipFile->Open(pFileName, CFile::modeCreate | CFile::modeWrite
|
> CFile::typeBinary, &cFileErr ) )
>    {
>         while (pRemoteZipFile->Read(pbuf,100))
>         {
>             //count bytes read to see if size of file is correct
>             nBytesRead = nBytesRead + sizeof(pbuf);
>
>             //** write binary date to pLocalZipFile here **
>         }
>         printf("%d bytes read from remote file %s\n",nBytesRead,sZipURL);
>         delete pRemoteZipFile;
>         pSessionZip.Close;
>         return 0;
>    }
> }
>
>


0
landron (12)
11/12/2004 6:09:52 PM
In the watch window after breaking it shows the following:

cFileErr {cause=0 OS Error=m_lOsError} CFileException

I've also tried to use a plain FILE* instead of a CSdtioFile for the
destination file to write locally using fopen(), fwrite() and fclose().
However this did produce a corrupt zip file of the incorrect size.
Somehow my file is larger than the zip if downloaded manually via IE.
Though I think this has to do with how I am reading the pRemoteZipFile.


"Jim Howard" <jnhtx@spamcop.net> wrote in message
news:OjwwbIOyEHA.2212@TK2MSFTNGP15.phx.gbl...
> What is coming back in cFileErr from
> if( pLocalZipFile->Open(pFileName, CFile::modeCreate | CFile::modeWrite |
> CFile::typeBinary, &cFileErr ) ) ?
>
> Also, are your certain your app has write permission to pFileName?
>
> Jim H
>
>
> "David Jacques" <David.Jacques@ccrs.nrcan.gc.ca> wrote in message
> news:cn2qa9$c6t1@nrn2b.NRCan.gc.ca...
> >I have to write a console application which will fetch a zip on a daily
> > basis.
> > This zip file is hotlinked in a web page. The name of this .zip file
will
> > change every day. I've been able to start the session, open the URL,
> > read each line, and get the line with the .zip file URL in it no
problem.
> > Where I am running intro trouble is writing the zip file to disk as
> > binary.
> > I'm following the example from the VC++ Online Help reference to
> > CFile::Open(). Can anyone see what I am doing wrong ?
> >
> > thanks in advance.
> >
> > #include <afx.h>
> > #include <afxwin.h>
> > #include <afxinet.h>
> > #include <iostream>
> > #include <stdlib.h>
> >
> > int main(int argc, _TCHAR* argv[])
> > {
> >    CStdioFile* pRemoteURLFile;
> >    CStdioFile* pRemoteZipFile;
> >    CFile* pLocalZipFile;
> >    CInternetSession pSessionURL("URLSession");
> >    CInternetSession pSessionZip("ZipSession");
> >    char* ziptag = "shapefile";
> >    CString sURL;
> >    CString sZipURL;
> >    CString sReadLine;
> >    char* pFileName = "test.dat";
> >    int iFound;
> >    int iNumLines;
> >    UINT nBytesRead;
> >    char pbuf[100];
> >    CFileException  cFileErr;
> >    pRemoteURLFile = NULL;
> >    pRemoteZipFile = NULL;
> >    pLocalZipFile = NULL;
> >    iNumLines = nBytesRead = 0;
> >    sURL =
"http://activefiremaps.fs.fed.us/fireptdata/modisfire_2004.htm";
> >    pRemoteURLFile =
> > pSessionURL.OpenURL(sURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
> >    while (pRemoteURLFile->ReadString(sReadLine))
> >    {
> >        iNumLines ++;
> >        iFound = sReadLine.Find("shapefile");
> >        if (iFound > 0)
> >        {
> >            sZipURL = getZIPURL(sReadLine,ziptag,sURL);
> >        }
> >    }
> >    delete pRemoteURLFile;
> >    pSessionURL.Close;
> >
> >
pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
> >    pRemoteZipFile =
> > pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
> >
> >    //** The below line fails **
> >   if( pLocalZipFile->Open(pFileName, CFile::modeCreate |
CFile::modeWrite
> > |
> > CFile::typeBinary, &cFileErr ) )
> >   {
> >        while (pRemoteZipFile->Read(pbuf,100))
> >        {
> >            //count bytes read to see if size of file is correct
> >            nBytesRead = nBytesRead + sizeof(pbuf);
> >
> >            //** write binary date to pLocalZipFile here **
> >        }
> >        printf("%d bytes read from remote file %s\n",nBytesRead,sZipURL);
> >        delete pRemoteZipFile;
> >        pSessionZip.Close;
> >        return 0;
> >   }
> > }
> >
> >
>
>


0
11/12/2004 6:21:17 PM
You can also try URLDownloadToFile, it may help...

Mike

"David Jacques" <David.Jacques@ccrs.nrcan.gc.ca> wrote in message
news:cn2qa9$c6t1@nrn2b.NRCan.gc.ca...
> I have to write a console application which will fetch a zip on a daily
> basis.
> This zip file is hotlinked in a web page. The name of this .zip file will
> change every day. I've been able to start the session, open the URL,
> read each line, and get the line with the .zip file URL in it no problem.
> Where I am running intro trouble is writing the zip file to disk as
binary.
> I'm following the example from the VC++ Online Help reference to
> CFile::Open(). Can anyone see what I am doing wrong ?
>
> thanks in advance.
>
> #include <afx.h>
> #include <afxwin.h>
> #include <afxinet.h>
> #include <iostream>
> #include <stdlib.h>
>
> int main(int argc, _TCHAR* argv[])
> {
>     CStdioFile* pRemoteURLFile;
>     CStdioFile* pRemoteZipFile;
>     CFile* pLocalZipFile;
>     CInternetSession pSessionURL("URLSession");
>     CInternetSession pSessionZip("ZipSession");
>     char* ziptag = "shapefile";
>     CString sURL;
>     CString sZipURL;
>     CString sReadLine;
>     char* pFileName = "test.dat";
>     int iFound;
>     int iNumLines;
>     UINT nBytesRead;
>     char pbuf[100];
>     CFileException  cFileErr;
>     pRemoteURLFile = NULL;
>     pRemoteZipFile = NULL;
>     pLocalZipFile = NULL;
>     iNumLines = nBytesRead = 0;
>     sURL =
"http://activefiremaps.fs.fed.us/fireptdata/modisfire_2004.htm";
>     pRemoteURLFile =
> pSessionURL.OpenURL(sURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>     while (pRemoteURLFile->ReadString(sReadLine))
>     {
>         iNumLines ++;
>         iFound = sReadLine.Find("shapefile");
>         if (iFound > 0)
>         {
>             sZipURL = getZIPURL(sReadLine,ziptag,sURL);
>         }
>     }
>     delete pRemoteURLFile;
>     pSessionURL.Close;
>
>
pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>     pRemoteZipFile =
> pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>
>     //** The below line fails **
>    if( pLocalZipFile->Open(pFileName, CFile::modeCreate | CFile::modeWrite
|
> CFile::typeBinary, &cFileErr ) )
>    {
>         while (pRemoteZipFile->Read(pbuf,100))
>         {
>             //count bytes read to see if size of file is correct
>             nBytesRead = nBytesRead + sizeof(pbuf);
>
>             //** write binary date to pLocalZipFile here **
>         }
>         printf("%d bytes read from remote file %s\n",nBytesRead,sZipURL);
>         delete pRemoteZipFile;
>         pSessionZip.Close;
>         return 0;
>    }
> }
>
>


0
11/12/2004 6:37:42 PM
David Jacques wrote:
> 
> I have to write a console application which will fetch a zip on a daily
> basis.
> This zip file is hotlinked in a web page. The name of this .zip file will
> change every day. I've been able to start the session, open the URL,
> read each line, and get the line with the .zip file URL in it no problem.
> Where I am running intro trouble is writing the zip file to disk as binary.
> I'm following the example from the VC++ Online Help reference to
> CFile::Open(). Can anyone see what I am doing wrong ?

Why are you using so many pointers in your program?

>     CFile* pLocalZipFile;

This is a pointer to a CFile object

>     pLocalZipFile = NULL;

Here you set the pointer to 0.

>     //** The below line fails **
>    if( pLocalZipFile->Open(pFileName, CFile::modeCreate | CFile::modeWrite |
> CFile::typeBinary, &cFileErr ) )

and here you program as if the pointer points to a CFile object, whih
of course is not the case.

WHy not simply

   CFile LocalZipFile;

Now you have a CFile object

   if( LocalZipFile.Open( pFileName, ....

and the CFile object will try to open the file.

Plain and simple:
Don't use pointers if you don't have to.

-- 
Karl Heinz Buchegger
kbuchegg@gascad.at
0
kbuchegg (3)
11/15/2004 9:09:20 AM
Thanks to all who responded.
I solved the problem.
I just used a FILE* to create and write to the local file.
(Along with a 1 time read and write of bytes).
Zip file is the same as if manually downloading with a right click of the
mouse.
Not the most elegant solution, but it works.

<<snipped>>

pRemoteZipFile =
pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
 pFileName = getZipFileName(sZipURL);

if (( pLocalZipFile = fopen(pFileName,"wb")) != NULL)
 {
    //get # of bytes in whole file
    dwActual = pRemoteZipFile->SeekToEnd();

   //calculate size of buffer based on whole file size
   pBuffer = (char*)calloc(sizeof(char),(dwActual));

   //point file to beginning again to read
   pRemoteZipFile->SeekToBegin();

   //read whole file into this buffer once
   lNumBytesRead = pRemoteZipFile->Read(pBuffer,dwActual);

   //write the binary data locally all at once
   fwrite(pBuffer,dwActual,1,pLocalZipFile);
 }

 fclose(pLocalZipFile);
 delete pRemoteZipFile;
 return 0;


0
11/15/2004 6:24:11 PM
Remember if you use FILE* you must set the mode to be binary or you will get nasty \n
translations which will do you in.
				joe

On Fri, 12 Nov 2004 13:21:17 -0500, "David Jacques" <David.Jacques@ccrs.nrcan.gc.ca>
wrote:

>In the watch window after breaking it shows the following:
>
>cFileErr {cause=0 OS Error=m_lOsError} CFileException
>
>I've also tried to use a plain FILE* instead of a CSdtioFile for the
>destination file to write locally using fopen(), fwrite() and fclose().
>However this did produce a corrupt zip file of the incorrect size.
>Somehow my file is larger than the zip if downloaded manually via IE.
>Though I think this has to do with how I am reading the pRemoteZipFile.
>
>
>"Jim Howard" <jnhtx@spamcop.net> wrote in message
>news:OjwwbIOyEHA.2212@TK2MSFTNGP15.phx.gbl...
>> What is coming back in cFileErr from
>> if( pLocalZipFile->Open(pFileName, CFile::modeCreate | CFile::modeWrite |
>> CFile::typeBinary, &cFileErr ) ) ?
>>
>> Also, are your certain your app has write permission to pFileName?
>>
>> Jim H
>>
>>
>> "David Jacques" <David.Jacques@ccrs.nrcan.gc.ca> wrote in message
>> news:cn2qa9$c6t1@nrn2b.NRCan.gc.ca...
>> >I have to write a console application which will fetch a zip on a daily
>> > basis.
>> > This zip file is hotlinked in a web page. The name of this .zip file
>will
>> > change every day. I've been able to start the session, open the URL,
>> > read each line, and get the line with the .zip file URL in it no
>problem.
>> > Where I am running intro trouble is writing the zip file to disk as
>> > binary.
>> > I'm following the example from the VC++ Online Help reference to
>> > CFile::Open(). Can anyone see what I am doing wrong ?
>> >
>> > thanks in advance.
>> >
>> > #include <afx.h>
>> > #include <afxwin.h>
>> > #include <afxinet.h>
>> > #include <iostream>
>> > #include <stdlib.h>
>> >
>> > int main(int argc, _TCHAR* argv[])
>> > {
>> >    CStdioFile* pRemoteURLFile;
>> >    CStdioFile* pRemoteZipFile;
>> >    CFile* pLocalZipFile;
>> >    CInternetSession pSessionURL("URLSession");
>> >    CInternetSession pSessionZip("ZipSession");
>> >    char* ziptag = "shapefile";
>> >    CString sURL;
>> >    CString sZipURL;
>> >    CString sReadLine;
>> >    char* pFileName = "test.dat";
>> >    int iFound;
>> >    int iNumLines;
>> >    UINT nBytesRead;
>> >    char pbuf[100];
>> >    CFileException  cFileErr;
>> >    pRemoteURLFile = NULL;
>> >    pRemoteZipFile = NULL;
>> >    pLocalZipFile = NULL;
>> >    iNumLines = nBytesRead = 0;
>> >    sURL =
>"http://activefiremaps.fs.fed.us/fireptdata/modisfire_2004.htm";
>> >    pRemoteURLFile =
>> > pSessionURL.OpenURL(sURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>> >    while (pRemoteURLFile->ReadString(sReadLine))
>> >    {
>> >        iNumLines ++;
>> >        iFound = sReadLine.Find("shapefile");
>> >        if (iFound > 0)
>> >        {
>> >            sZipURL = getZIPURL(sReadLine,ziptag,sURL);
>> >        }
>> >    }
>> >    delete pRemoteURLFile;
>> >    pSessionURL.Close;
>> >
>> >
>pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>> >    pRemoteZipFile =
>> > pSessionZip.OpenURL(sZipURL,1,INTERNET_FLAG_TRANSFER_BINARY,NULL,NULL);
>> >
>> >    //** The below line fails **
>> >   if( pLocalZipFile->Open(pFileName, CFile::modeCreate |
>CFile::modeWrite
>> > |
>> > CFile::typeBinary, &cFileErr ) )
>> >   {
>> >        while (pRemoteZipFile->Read(pbuf,100))
>> >        {
>> >            //count bytes read to see if size of file is correct
>> >            nBytesRead = nBytesRead + sizeof(pbuf);
>> >
>> >            //** write binary date to pLocalZipFile here **
>> >        }
>> >        printf("%d bytes read from remote file %s\n",nBytesRead,sZipURL);
>> >        delete pRemoteZipFile;
>> >        pSessionZip.Close;
>> >        return 0;
>> >   }
>> > }
>> >
>> >
>>
>>
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
11/23/2004 7:55:43 PM
Reply:

Similar Artilces:

Query XML file
hi guys I'm new to XML. I've publish XML to Web Server. Now I want to query specific information. Pls tell me the most easiest way to do that. second Is there any way to secure online XML file. If yes pls inform me. thanks ...

How do I decrease the file load time in Publisher 2002?
Need to "speed up" the file load times for Publisher documents on a 100 Mbps network and a P4 2.2 GHz client running Windows XP with an integrated video card. NexusITG <NexusITG@discussions.microsoft.com> was very recently heard to utter: > Need to "speed up" the file load times for Publisher documents on a > 100 Mbps network and a P4 2.2 GHz client running Windows XP with an > integrated video card. a) Create smaller files b) Copy the files to your local disk and edit them there. Opening Publisher files across a LAN connection is a recipe for disaster....

outlook.pst file size
Hi Folks, I am having trouble deleting things from Outlook 2000. If I look at my Outlook.pst file, the size is 1,329,856 kb (pretty big!?). If I move some sent items to a folder on another drive - say I move 40 megs of files, check the Sent Items folder and confirm that they are gone, check Deleted Items and make sure that they are not there. Log out of Outlook and back in and look at my outlook.pst size, it does not change - still 1,329,856 kb! It continues to grow with every email that I send and receive. Am I doing something wrong? Thanks for your help. Ken Peoples Best regards, Ken...

How big is your money file?
Mine is about 25Mb. Is there a limit? Is there an size I should not go over? Tod DeBie wrote: > Mine is about 25Mb. Is there a limit? Is there an size I should not > go over? My current is about 10 meg. I suggest you may want to archive some of the older data as Money does slow down with larger files. -- Joseph Meehan Dia duit My file is about 50Mb. I have not found a compelling reason to archive. -- "Tod DeBie" <tod_debie@hotmail.com> wrote in message news:uIadnRGTE_ZYzQbfRVn-uA@comcast.com... > Mine is about 25Mb. Is there a limit? Is th...

CSV formatted text file to Excel
Hi all, I am writing a small VC++ application of how to import the CSV formatted ..txt file to excel. I am facing problem while parsing the text file. "TicketNo","CarNo","PersonAge" 12534 , 763534 , 23 12345 , 624333, 24 The problem is in MFC there is a SetValue2(CoeVariant:column data) method in which if i will pass an array(12534) then it will be imported to excel.For example IfI will search for the "employee number" field in text file then the values passed to SetValue2()should be 12543 and 12345.But Using C++ I cannot do so as I...

network links in email not working (web ok)
in outlook 2007 on windows 7 the hyperlinks to files on our company network shared drive result in the error "can not find file (address) verify the path or internet address is correct" I can send myself an email message with a hyper link added from the "insert hyperlink" commands that point to files on my computer and they work fine. I sent myself a couple test messages with internet address links and they worked fine. Both an email from my assistent and one I made with the exact same link result in the error. I tried a different address on the same ne...

Linking Excel Tables
Is there any way to link two separate Excel tables so that the data flows between the tables and sorts as if the two were just one table? We have worksheets where the quantity of data forces us to place the data in multiple tables, for example in three tables across a landscape page. However, we want the data in the three tables to behave as a single table, much like linked text frames in a page layout program. When adding data we simply want the overflow to be pushed into the adjoining table. Likewise, when we sort the data we want the data to be sorted in all three tables an...

Outlook keeps fetching new headers
Outlook keeps fetching new headers daily at the same time, this usally errors out with The UID of a message changed unexpectedly. I have looked for Rules or filters that may cause this, but found nothing. Has anyone ever seen this problem ...

backup files corrupt
Hello everyone, I have 2 backup files done in Money2002 it holds information since 1998. I recently had to restore my computer, so i had to reinstall money2002 when i tried to restore the backup file it says it is corrupt or not a money back up file...is there anyway to fix this. Thanx In microsoft.public.money, raul wrote: >Hello everyone, I have 2 backup files done in Money2002 it >holds information since 1998. I recently had to restore my >computer, so i had to reinstall money2002 when i tried to >restore the backup file it says it is corrupt or not a >money back u...

clicking links in OE email cause system to hang
Anytime I click on a hyperlink contained in the body of the email, my system (which is brand new) does not respond. The only way to get response is to Ctrl+Alt+Del and end OE. Any suggestions on how to fix? Thanks Dan This newsgroup is for support of Outlook 97, 98, 2000 & 2002 from the Office family for Windows PCs. For Outlook Express (OE) support try posting in one of these newsgroups: microsoft.public.inetexplorer.ie4.outlookexpress for OE 4.x microsoft.public.windows.inetexplorer.ie5.outlookexpress for OE 5.x http://support.microsoft.com/newsgroups/default.aspx?ICP=GSS3&NewsG...

"Save As" command missing from file menu
My coworker's copy of Excel seems to no longer have the "Save As" command in her file menu. The menu is fully expanded, so it doesn't seem to be hidden. She can still save using the control-S command, but would like her save as option back. Any ideas? Maybe got dragged off. You could go to Tools>Customize>Toolbars and select Worksheet MenuBar and reset. This would wipe out any customizations done the this bar. Or Tools>Customize>Commands>File. Drag the Save As up to the File menu. Gord Dibben MS Excel MVP On Thu, 7 Feb 2008 13:14:36 -0800 (PST), Matt....

1900 date system as a preference in new files II
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi, <br><br>As seen in the previous discussion (with the same title) it is possible to change the default date system preference (either 01/01/1900 like Windows does or 02/01/1904 like Mac does). <br> I tried, as suggested by McGlimpsey in the previous discussion, to locate the new workbook template (with Windows date preference) in a different folder for the reasons he explicated. I also tried to put it in the excel startup folder. <br><br>Initially none of these solutions worked, but ...

Calling xml file from http.open
I can use http.open to get and XML document as follows.... But I keep getting the header info back instead of the raw XML, so I can not parse the XML file that is returned. If I use a .ASP extension instead of .XML, the file is parsed fine. Should I be adding something in my xml file like <noheader> to make sure the "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\"> is not returned? call_string = "SLNet_AddPriceBookItem.xml" xmlAddItem_http.Open("POST", call_string, false) xmlAddItem_http.Send(xmlSend_doc) xmlBack_doc = xmlAddItem...

Subform Linking To Multiple Master Fields
Hi I have a subform which is based on a query named ACCOUNTS with the fields: Name Company Arrival (which is date field) Departure (which is date field) Charge In the Form named ACCOUNTS SEARCH I have controls named: Pick Company (Which is a combo box) Pick Arrival (which is date field) Pick Departure (which is date field) I want to set the criteria in the controls Pick Company, Pick Arrival and Pick Departure to filter out in the subform the records I want. Thanks You can use more than one field in Master and Child linking fields. I have not done it but first try with commas as se...

transferring files from "un-bootable" laptop
Geek Squad tells me the motherboard on my laptop has failed. As a result, I can't boot it up. How do I get the files transferred out to another laptop or desktop? Neither of which is new. Thanks. brubaker325 wrote: > Geek Squad tells me the motherboard on my laptop has failed. As a > result, I can't boot it up. How do I get the files transferred out > to another laptop or desktop? Neither of which is new. > Thanks. I'd be wary of anything Geek Squad tells you. If the motherboard has truly failed, you should remove the hard drive and connect it t...

reading binary reader
Hi, I have an Activex Control, from wrapper program i am sending stream binary reader to the control from MFC ActiveX control how can i get my origional string. ...

Linking Files
I am using Excel 2003 and would like to do the following: I have one file that I’d like to use as a list that all other files within this project would refer to; this file is simply a list of billing reasons. Within the multiple (~30) other files I would like to be able to use a drop down list (in column N) that’s using the data in the “billing reasons” file. I was informed that this may not work because the “billing reasons” file has to be open whenever one of the other ~30 files is accessed. Since these are files being used over a network, it isn’t feasible to make sure the “billing reaso...

Merging accts from different .mny files
Is there any way to merge accounts from two different .mny files? I've tried to search the help but don't find anything about this. Use QIF export and import. Make sure that account names aren't duplicated. Also if more than one account to be brought across, then import all QIF files together - use CTRL + click when asked which file to import. -- Regards Bob Peel, Microsoft MVP - Money For UK tips & fixes see http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny. For wishes or suggestions see http://register.microsoft.com/mswish/suggestion.asp or for UK wishes e...

burn a cd of an excel file that I got from e-mail
I received an e-mail with some information that was sent in the excel spreadsheat format. I would like to burn a cd of this so I can transfer the information to another computer that has excel on it, but does not have an e-mail address. Open Email. Save attachment to your HD, select the file, copy to CD RW drive "awoosoul" <awoosoul@discussions.microsoft.com> wrote in message news:A3523896-3438-4F12-AD12-518F5A552509@microsoft.com... : I received an e-mail with some information that was sent in the excel : spreadsheat format. I would like to burn a cd of this so I can tra...

Access corrupt files DBF?
Access corrupt files DBF? "Frank Dulk" <fdulk@bol.com.br> wrote: >Access corrupt files DBF? What is your question? I see you're from Brazil. Have you asked your question in the Portuguese Access newsgroup? microsoft.public.pt.access. Tony -- Tony Toews, Microsoft Access MVP Please respond only in the newsgroups so that others can read the entire thread of messages. Microsoft Access Links, Hints, Tips & Accounting Systems at http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ "Frank D...

Adding a personalized link to an image
Hello I am getting to know Publisher. I am currently trying to send an e-mail to a bunch of college. I have made a personalized hyper link, and that's just fine. But I like to make an personalized hyper link on an image. Is that possible at all? Please do help me - I'm getting quiet frustrated scrolling through all the menus looking for a solution... :) Thanks. -- Correct me if I''m right. ...

%20 in file names
When I download files with spaces in the file names IE replaces the spaces with %20 I haven't noticed this with other versions of IE and I would like it to leave the file name as it is. is there an option, or patch or upgrade available for this? IE has always done this. Since spaces in file names are considered illegal HTML, it's up to the web authors to correct it by using hyphens, underbars, etc. <die.spam@hotmail.com> wrote in message news:6565cd1c-f4ac-4fb0-b49f-efc41843d0a2@b7g2000pro.googlegroups.com... : When I download files with spaces in the file nam...

open CSV.file
I have a lot of csv file, in that file the date column contain both text and date values, but when i change my system settings to UK and if i manually change the date format using custom type "dd-mmm-yy", all the date and text value of that column will easily change to dd-mmm-yy, but when i created a macro to do the same thing, the problem iam facing here is when it open each csv files the date is getting changed(the column contains both text and date values) when i open the file using the below code it opens the file in a actual format(date values will not change...

Outlook should keep files in the clipboard after closing a window
When you open a message (in a new window) in Outlook 2007, and copy one or more files contained in this message, and then close the window, the file is not kept in the clipboard. I have to copy the file and paste it before closing the window. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I ...

Outlook RPCRT4.DLL FILE CANNOT BE STARTED
When sending/receiving in Outlook 2000, recieving the error message RPCRT4.DLL FILE CANNOT BE STARTED. This just started and have not had any other problems. ...