Thread

Okay, I'm confused here . . . Here's the Source Code and SCRIPT in Question . . . (Sdk)

Okay, I'm confused here . . . Here's the Source Code and SCRIPT in Question . . . // Sdk

1  |  

andon m. coleman

Sep 8, 1999, 3:14pm
This is a multi-part message in MIME format.

------=_NextPart_000_0008_01BEF9FC.2626BBA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

// UpdaterDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Updater.h"
#include "UpdaterDlg.h"
#include "afxinet.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] =3D __FILE__;
#endif

#define HTTPBUFLEN 1024
char httpbuff[HTTPBUFLEN];

bool GetHttpFile(const char *url, const char *filename);

/////////////////////////////////////////////////////////////////////////=
////
// CUpdaterDlg dialog

CUpdaterDlg::CUpdaterDlg(CWnd* pParent /*=3DNULL*/)
: CDialog(CUpdaterDlg::IDD, pParent)
{
file://{{AFX_DATA_INIT(CUpdaterDlg)
// NOTE: the ClassWizard will add member initialization here
file://}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in =
Win32
m_hIcon =3D AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CUpdaterDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
file://{{AFX_DATA_MAP(CUpdaterDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
file://}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CUpdaterDlg, CDialog)
file://{{AFX_MSG_MAP(CUpdaterDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
file://}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////=
////
// CUpdaterDlg message handlers

BOOL CUpdaterDlg::OnInitDialog()
{

CDialog::OnInitDialog();

SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);

CFile NewData ("version.new", CFile::modeRead);
char pbuf[2000];
UINT nBytesRead =3D NewData.Read( pbuf, 1000 );
CString msg =3D pbuf;
int NewVersion;
int OldVersion;

msg =3D msg.Left(msg.Find("%N"));
msg.MakeReverse();
msg =3D msg.Left(msg.Find("VM%"));
msg.MakeReverse();
NewVersion =3D atoi (msg);

if (1 =3D=3D 1)
{
CFile OldData ("version.dat", CFile::modeRead);
char pbuf2[2000];
UINT nBytesRead =3D OldData.Read( pbuf2, 1000 );
CString msg =3D pbuf2;

msg =3D msg.Left(msg.Find("%N"));
msg.MakeReverse();
msg =3D msg.Left(msg.Find("VM%"));
msg.MakeReverse();
OldVersion =3D atoi (msg);
=20
if (NewVersion =3D=3D OldVersion)
{
OldVersion =3D atoi (msg);
msg.Format(" Update Patch %d Detected . . .\r\n\r\n Verifying . . . . =
.. . . . . . . . Failure!\r\n Creating Data Table . . . Failure!\r\n\r\n =
NO DIFFERENCE IN VERSION!",NewVersion);
GetDlgItem(IDC_Status)->SetWindowText(msg);
}

else if (NewVersion > OldVersion)
{

msg.Format(" Update Patch %d Detected . . .\r\n\r\n Verifying . . . . =
.. . . . . . . . Success!\r\n Creating Data Table . . . Success!\r\n\r\n =
Applying Patch for %d to %d",NewVersion,NewVersion,OldVersion);
GetDlgItem(IDC_Status)->SetWindowText(msg);
msg =3D pbuf;
msg =3D msg.Left(msg.Find("1L"));
msg.MakeReverse();
msg =3D msg.Left(msg.Find("N%"));
msg.MakeReverse();

int FILES =3D atoi (msg);

msg =3D pbuf;
int FILENUM =3D 1;

CString LOCAL;
CString EXTERNAL;
int VERSION;

while (FILENUM !=3D FILES)
{
CString NUML;
CString NUML2;
CString NUMF;
CString NUMV;

NUML.Format("%dL",FILENUM);
NUML2.Format("%dL",(FILENUM+1));
NUMF.Format("%dF",FILENUM);
NUMV.Format("%dV",FILENUM);
=20
msg =3D pbuf;
msg =3D msg.Left(msg.Find(NUMF));
NUML.MakeReverse();
msg.MakeReverse();
msg =3D msg.Left(msg.Find(NUML));
NUML.MakeReverse();
msg.MakeReverse();

LOCAL =3D msg;

msg =3D pbuf;
msg =3D msg.Left(msg.Find(NUMV));
NUMF.MakeReverse();
msg.MakeReverse();
msg =3D msg.Left(msg.Find(NUMF));
NUMF.MakeReverse();
msg.MakeReverse();

EXTERNAL =3D msg;

msg =3D pbuf;
msg =3D msg.Left(msg.Find(NUML2));
NUMV.MakeReverse();
msg.MakeReverse();
msg =3D msg.Left(msg.Find(NUMV));
NUMV.MakeReverse();
msg.MakeReverse();
=20
VERSION =3D atoi (msg);

if (VERSION > OldVersion)
{

LOCAL.Remove(' ');
EXTERNAL.Remove(' ');

RedrawWindow(NULL,NULL,RDW_UPDATENOW);

if (GetHttpFile(EXTERNAL, LOCAL) =3D=3D TRUE)
MessageBox("It Worked!",MB_OK);

else
{
char reply6[255];
sprintf(reply6,"%s\r\n%s",LOCAL,EXTERNAL);
MessageBox(reply6,MB_OK);
}
}


msg.Format(" Local : %s\n External : %s\n Update : =
%d",LOCAL,EXTERNAL,VERSION);

GetDlgItem(IDC_File)->SetWindowText(msg);


FILENUM +=3D 1;
}

char *pFileName =3D "version.dat";
OldData.Close();
CFile::Remove(pFileName);
char *pFileName2 =3D "version.new";
NewData.Close();
CFile::Rename(pFileName2, pFileName);
}

else
{
OldVersion =3D atoi (msg);
msg.Format(" Update Patch \? Detected . . .\r\n\r\n Verifying . . . . =
.. . . . . . . . Failure!\r\n Creating Data Table . . . Failure!\r\n\r\n =
ERROR : UNKNOWN");
GetDlgItem(IDC_Status)->SetWindowText(msg);
}
}
return TRUE; // return TRUE unless you set the focus to a control
}
// If you add a minimize button to your dialog, you will need the code =
below
// to draw the icon. For MFC applications using the document/view =
model,
// this is automatically done for you by the framework.

void CUpdaterDlg::OnPaint()=20
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon =3D GetSystemMetrics(SM_CXICON);
int cyIcon =3D GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x =3D (rect.Width() - cxIcon + 1) / 2;
int y =3D (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}

// The system calls this to obtain the cursor to display while the user =
drags
// the minimized window.
HCURSOR CUpdaterDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}

bool GetHttpFile(const char *url, const char *filename)
{
bool success =3D FALSE;
TRY {
CInternetSession mysession;
CStdioFile *remotefile =3D mysession.OpenURL(url, =
1,INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);
CFile myfile (filename, CFile::modeCreate|CFile::modeWrite);
int numbytes;
while (numbytes =3D remotefile->Read(httpbuff, HTTPBUFLEN))
{
myfile.Write(httpbuff, numbytes);
}
success =3D TRUE;
}
CATCH_ALL(e)
{
success =3D FALSE;
}
END_CATCH_ALL;
return (success);
}




SCRIPT :
%MV 0

%N 9

1L Ultra BOT.exe=20

1F UltraBOT.exe=20

1V 1

2L Updater.exe=20

2F Updater.exe=20

2V 1

3L AW.DLL=20

3F AW.DLL=20

3V 1

4L Audio\DJ.mid=20

4F Audio/DJ.mid=20

4V 1

5L Audio\jeopardy.mid=20

5F Audio/jeopardy.mid=20

5V 1

6L Audio\Error.wav=20

6F Audio/Error.wav=20

6V 1

7L Audio\Logfinish.wav=20

7F Audio/Logfinish.wav=20

7V 1

8L Audio\Logstart.wav=20

8F Audio/Logstart.wav=20

8V 1

9L Audio\Startup.wav=20

9F Audio/Startup.wav=20

9V 1

%TM "Testing"



Anyway, it always returns FALSE when it tries to use Fabers little HTTP =
Function.

If need be, I'll send you the ENTIRE Project - It's VERY small, and my =
preliminary .dat structure info.



Thanks,

Andon Coleman



Senior Programmer

R&D



Nothing, Inc.


------=_NextPart_000_0008_01BEF9FC.2626BBA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>// UpdaterDlg.cpp : implementation=20
file<BR>//</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#include "stdafx.h"<BR>#include=20
"Updater.h"<BR>#include "UpdaterDlg.h"<BR>#include =
"afxinet.h"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#ifdef _DEBUG<BR>#define new =
DEBUG_NEW<BR>#undef=20
THIS_FILE<BR>static char THIS_FILE[] =3D =
__FILE__;<BR>#endif</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#define HTTPBUFLEN 1024<BR>char=20
httpbuff[HTTPBUFLEN];</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>bool GetHttpFile(const char *url, const =
char=20
*filename);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>////////////////////////////////////////////////////////////////=
/////////////<BR>//=20
CUpdaterDlg dialog</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CUpdaterDlg::CUpdaterDlg(CWnd* pParent=20
/*=3DNULL*/)<BR>&nbsp;: CDialog(CUpdaterDlg::IDD, =
pParent)<BR>{<BR>&nbsp;<A=20
href=3D"file://{{">file://{{</A>AFX_DATA_INIT(CUpdaterDlg)<BR>&nbsp;&nbsp=
;// NOTE:=20
the ClassWizard will add member initialization here<BR>&nbsp;<A=20
href=3D"file://}}">file://}}</A>AFX_DATA_INIT<BR>&nbsp;// Note that =
LoadIcon does=20
not require a subsequent DestroyIcon in Win32<BR>&nbsp;m_hIcon =3D=20
AfxGetApp()-&gt;LoadIcon(IDR_MAINFRAME);<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>void =
CUpdaterDlg::DoDataExchange(CDataExchange*=20
pDX)<BR>{<BR>&nbsp;CDialog::DoDataExchange(pDX);<BR>&nbsp;<A=20
href=3D"file://{{">file://{{</A>AFX_DATA_MAP(CUpdaterDlg)<BR>&nbsp;&nbsp;=
// NOTE:=20
the ClassWizard will add DDX and DDV calls here<BR>&nbsp;<A=20
href=3D"file://}}">file://}}</A>AFX_DATA_MAP<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>BEGIN_MESSAGE_MAP(CUpdaterDlg, =
CDialog)<BR>&nbsp;<A=20
href=3D"file://{{">file://{{</A>AFX_MSG_MAP(CUpdaterDlg)<BR>&nbsp;ON_WM_P=
AINT()<BR>&nbsp;ON_WM_QUERYDRAGICON()<BR>&nbsp;<A=20
href=3D"file://}}">file://}}</A>AFX_MSG_MAP<BR>END_MESSAGE_MAP()</FONT></=
DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>////////////////////////////////////////////////////////////////=
/////////////<BR>//=20
CUpdaterDlg message handlers</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>BOOL =
CUpdaterDlg::OnInitDialog()<BR>{</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;CDialog::OnInitDialog();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;SetIcon(m_hIcon,=20
TRUE);<BR>&nbsp;SetIcon(m_hIcon, FALSE);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;CFile NewData ("version.new",=20
CFile::modeRead);<BR>&nbsp;char pbuf[2000];<BR>&nbsp;UINT nBytesRead =3D =

NewData.Read( pbuf, 1000 );<BR>&nbsp;CString msg =3D pbuf;<BR>&nbsp;int=20
NewVersion;<BR>&nbsp;int OldVersion;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;msg =3D=20
msg.Left(msg.Find("%N"));<BR>&nbsp;msg.MakeReverse();<BR>&nbsp;msg =3D=20
msg.Left(msg.Find("VM%"));<BR>&nbsp;msg.MakeReverse();<BR>&nbsp;NewVersio=
n =3D=20
atoi (msg);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;if (1 =3D=3D =
1)<BR>&nbsp;{<BR>&nbsp;&nbsp;CFile=20
OldData ("version.dat", CFile::modeRead);<BR>&nbsp;&nbsp;char=20
pbuf2[2000];<BR>&nbsp;&nbsp;UINT nBytesRead =3D OldData.Read( pbuf2, =
1000=20
);<BR>&nbsp;&nbsp;CString msg =3D pbuf2;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;msg =3D=20
msg.Left(msg.Find("%N"));<BR>&nbsp;&nbsp;msg.MakeReverse();<BR>&nbsp;&nbs=
p;msg =3D=20
msg.Left(msg.Find("VM%"));<BR>&nbsp;&nbsp;msg.MakeReverse();<BR>&nbsp;&nb=
sp;OldVersion=20
=3D atoi (msg);<BR>&nbsp;<BR>&nbsp;&nbsp;if (NewVersion =3D=3D=20
OldVersion)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;OldVersion =3D atoi=20
(msg);<BR>&nbsp;&nbsp;&nbsp;msg.Format(" Update Patch %d Detected . . =
..\r\n\r\n=20
Verifying . . . . . . . . . . . . Failure!\r\n Creating Data Table . . . =

Failure!\r\n\r\n NO DIFFERENCE IN=20
VERSION!",NewVersion);<BR>&nbsp;&nbsp;&nbsp;GetDlgItem(IDC_Status)-&gt;Se=
tWindowText(msg);<BR>&nbsp;&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;else if (NewVersion &gt;=20
OldVersion)<BR>&nbsp;&nbsp;{</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;msg.Format(" Update =
Patch %d=20
Detected . . .\r\n\r\n Verifying . . . . . . . . . . . . Success!\r\n =
Creating=20
Data Table . . . Success!\r\n\r\n Applying Patch for %d to=20
%d",NewVersion,NewVersion,OldVersion);<BR>&nbsp;&nbsp;&nbsp;GetDlgItem(ID=
C_Status)-&gt;SetWindowText(msg);<BR>&nbsp;&nbsp;&nbsp;msg=20
=3D pbuf;<BR>&nbsp;&nbsp;&nbsp;msg =3D=20
msg.Left(msg.Find("1L"));<BR>&nbsp;&nbsp;&nbsp;msg.MakeReverse();<BR>&nbs=
p;&nbsp;&nbsp;msg=20
=3D =
msg.Left(msg.Find("N%"));<BR>&nbsp;&nbsp;&nbsp;msg.MakeReverse();</FONT><=
/DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;int FILES =3D atoi=20
(msg);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;msg =3D=20
pbuf;<BR>&nbsp;&nbsp;&nbsp;int FILENUM =3D 1;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;CString=20
LOCAL;<BR>&nbsp;&nbsp;&nbsp;CString EXTERNAL;<BR>&nbsp;&nbsp;&nbsp;int=20
VERSION;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;while (FILENUM !=3D=20
FILES)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString=20
NUML;<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString=20
NUML2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString=20
NUMF;<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString NUMV;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;NUML.Format("%dL",FILENUM);<BR>&nbsp;&nb=
sp;&nbsp;&nbsp;NUML2.Format("%dL",(FILENUM+1));<BR>&nbsp;&nbsp;&nbsp;&nbs=
p;NUMF.Format("%dF",FILENUM);<BR>&nbsp;&nbsp;&nbsp;&nbsp;NUMV.Format("%dV=
",FILENUM);<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;msg=20
=3D pbuf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;msg =3D=20
msg.Left(msg.Find(NUMF));<BR>&nbsp;&nbsp;&nbsp;&nbsp;NUML.MakeReverse();<=
BR>&nbsp;&nbsp;&nbsp;&nbsp;msg.MakeReverse();<BR>&nbsp;&nbsp;&nbsp;&nbsp;=
msg=20
=3D=20
msg.Left(msg.Find(NUML));<BR>&nbsp;&nbsp;&nbsp;&nbsp;NUML.MakeReverse();<=
BR>&nbsp;&nbsp;&nbsp;&nbsp;msg.MakeReverse();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;LOCAL =3D =
msg;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;msg =3D=20
pbuf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;msg =3D=20
msg.Left(msg.Find(NUMV));<BR>&nbsp;&nbsp;&nbsp;&nbsp;NUMF.MakeReverse();<=
BR>&nbsp;&nbsp;&nbsp;&nbsp;msg.MakeReverse();<BR>&nbsp;&nbsp;&nbsp;&nbsp;=
msg=20
=3D=20
msg.Left(msg.Find(NUMF));<BR>&nbsp;&nbsp;&nbsp;&nbsp;NUMF.MakeReverse();<=
BR>&nbsp;&nbsp;&nbsp;&nbsp;msg.MakeReverse();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;EXTERNAL =3D=20
msg;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;msg =3D=20
pbuf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;msg =3D=20
msg.Left(msg.Find(NUML2));<BR>&nbsp;&nbsp;&nbsp;&nbsp;NUMV.MakeReverse();=
<BR>&nbsp;&nbsp;&nbsp;&nbsp;msg.MakeReverse();<BR>&nbsp;&nbsp;&nbsp;&nbsp=
;msg=20
=3D=20
msg.Left(msg.Find(NUMV));<BR>&nbsp;&nbsp;&nbsp;&nbsp;NUMV.MakeReverse();<=
BR>&nbsp;&nbsp;&nbsp;&nbsp;msg.MakeReverse();<BR>&nbsp;&nbsp;&nbsp;&nbsp;=
<BR>&nbsp;&nbsp;&nbsp;&nbsp;VERSION=20
=3D atoi (msg);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;if (VERSION =
&gt;=20
OldVersion)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOCAL.Remove('=20
');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EXTERNAL.Remove(' ');</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RedrawWindow(NULL,NULL,RDW_UPDATEN=
OW);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if=20
(GetHttpFile(EXTERNAL, LOCAL) =3D=3D=20
TRUE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox("It=20
Worked!",MB_OK);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char=20
reply6[255];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sprintf(reply6,"%s\r\=
n%s",LOCAL,EXTERNAL);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox(r=
eply6,MB_OK);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nb=
sp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2><BR>&nbsp;&nbsp;&nbsp;&nbsp;msg.Format("=20
Local&nbsp;&nbsp;&nbsp;&nbsp; : %s\n External : %s\n Update&nbsp; :=20
%d",LOCAL,EXTERNAL,VERSION);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;GetDlgItem(IDC_File)-&gt;SetWindowText(m=
sg);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>&nbsp;&nbsp;&nbsp;&nbsp;FILENUM =
+=3D=20
1;<BR>&nbsp;&nbsp;&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;char *pFileName =3D=20
"version.dat";<BR>&nbsp;&nbsp;&nbsp;OldData.Close();<BR>&nbsp;&nbsp;&nbsp=
;CFile::Remove(pFileName);<BR>&nbsp;&nbsp;&nbsp;char=20
*pFileName2 =3D=20
"version.new";<BR>&nbsp;&nbsp;&nbsp;NewData.Close();<BR>&nbsp;&nbsp;&nbsp=
;CFile::Rename(pFileName2,=20
pFileName);<BR>&nbsp;&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;OldVersio=
n =3D atoi=20
(msg);<BR>&nbsp;&nbsp;&nbsp;msg.Format(" Update Patch \? Detected . . =
..\r\n\r\n=20
Verifying . . . . . . . . . . . . Failure!\r\n Creating Data Table . . . =

Failure!\r\n\r\n ERROR :=20
UNKNOWN");<BR>&nbsp;&nbsp;&nbsp;GetDlgItem(IDC_Status)-&gt;SetWindowText(=
msg);<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>&nbsp;return=20
TRUE;&nbsp; // return TRUE&nbsp; unless you set the focus to a=20
control<BR>}<BR>// If you add a minimize button to your dialog, you will =
need=20
the code below<BR>//&nbsp; to draw the icon.&nbsp; For MFC applications =
using=20
the document/view model,<BR>//&nbsp; this is automatically done for you =
by the=20
framework.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>void CUpdaterDlg::OnPaint() =
<BR>{<BR>&nbsp;if=20
(IsIconic())<BR>&nbsp;{<BR>&nbsp;&nbsp;CPaintDC dc(this); // device =
context for=20
painting</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;SendMessage(WM_ICONERASEBKGND, (WPARAM)=20
dc.GetSafeHdc(), 0);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;// Center icon in client=20
rectangle<BR>&nbsp;&nbsp;int cxIcon =3D=20
GetSystemMetrics(SM_CXICON);<BR>&nbsp;&nbsp;int cyIcon =3D=20
GetSystemMetrics(SM_CYICON);<BR>&nbsp;&nbsp;CRect=20
rect;<BR>&nbsp;&nbsp;GetClientRect(&amp;rect);<BR>&nbsp;&nbsp;int x =3D=20
(rect.Width() - cxIcon + 1) / 2;<BR>&nbsp;&nbsp;int y =3D (rect.Height() =
- cyIcon=20
+ 1) / 2;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;// Draw the=20
icon<BR>&nbsp;&nbsp;dc.DrawIcon(x, y,=20
m_hIcon);<BR>&nbsp;}<BR>&nbsp;else<BR>&nbsp;{<BR>&nbsp;&nbsp;CDialog::OnP=
aint();<BR>&nbsp;}<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>// The system calls this to obtain the =
cursor to=20
display while the user drags<BR>//&nbsp; the minimized =
window.<BR>HCURSOR=20
CUpdaterDlg::OnQueryDragIcon()<BR>{<BR>&nbsp;return (HCURSOR)=20
m_hIcon;<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>bool GetHttpFile(const char *url, const =
char=20
*filename)<BR>{<BR>&nbsp;bool success =3D FALSE;<BR>&nbsp;TRY =
{<BR>&nbsp;=20
CInternetSession mysession;<BR>&nbsp; CStdioFile *remotefile =3D=20
mysession.OpenURL(url,=20
1,INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);<BR>&nbsp; CFile =
myfile=20
(filename, CFile::modeCreate|CFile::modeWrite);<BR>&nbsp; int=20
numbytes;<BR>&nbsp; while (numbytes =3D remotefile-&gt;Read(httpbuff,=20
HTTPBUFLEN))<BR>&nbsp; {<BR>&nbsp;&nbsp; myfile.Write(httpbuff,=20
numbytes);<BR>&nbsp; }<BR>&nbsp; success =3D=20
TRUE;<BR>&nbsp;}<BR>&nbsp;CATCH_ALL(e)<BR>&nbsp;{<BR>&nbsp; success =3D=20
FALSE;<BR>&nbsp;}<BR>&nbsp;END_CATCH_ALL;<BR>&nbsp;return=20
(success);<BR>}<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SCRIPT :</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>
<P>%MV 0</P>
<P>%N 9</P>
<P>1L Ultra BOT.exe </P>
<P>1F UltraBOT.exe </P>
<P>1V 1</P>
<P>2L Updater.exe </P>
<P>2F Updater.exe </P>
<P>2V 1</P>
<P>3L AW.DLL </P>
<P>3F AW.DLL </P>
<P>3V 1</P>
<P>4L Audio\DJ.mid </P>
<P>4F Audio/DJ.mid </P>
<P>4V 1</P>
<P>5L Audio\jeopardy.mid </P>
<P>5F Audio/jeopardy.mid </P>
<P>5V 1</P>
<P>6L Audio\Error.wav </P>
<P>6F Audio/Error.wav </P>
<P>6V 1</P>
<P>7L Audio\Logfinish.wav </P>
<P>7F Audio/Logfinish.wav </P>
<P>7V 1</P>
<P>8L Audio\Logstart.wav </P>
<P>8F Audio/Logstart.wav </P>
<P>8V 1</P>
<P>9L Audio\Startup.wav </P>
<P>9F Audio/Startup.wav </P>
<P>9V 1</P>
<P>%TM "Testing"</P>
<P>&nbsp;</P>
<P>Anyway, it always returns FALSE when it tries to use Fabers little =
HTTP=20
Function.</P>
<P>If need be, I'll send you the ENTIRE Project&nbsp;- It's VERY small,=20
and&nbsp;my preliminary .dat structure info.</P>
<P>&nbsp;</P>
<P>Thanks,</P>
<P>Andon Coleman</P>
<P>&nbsp;</P>
<P>Senior Programmer</P>
<P>R&amp;D</P>
<P>&nbsp;</P>
<P>Nothing, Inc.</P></FONT></DIV></FONT></BODY></HTML>

------=_NextPart_000_0008_01BEF9FC.2626BBA0--

aaron hill

Oct 11, 1999, 11:39pm
This is a multi-part message in MIME format.

------=_NextPart_000_0037_01BF1417.FFAA08C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Have you looked into Flex/Bison to doing the parsing for you? Using =
these tools you can spend more time on the more important code in your =
program.

If the project is VC, I could take a look. (I have VC6.) Send it to =
serac at lightmail.com.

P.S. If you are interested in Flex/Bison, I highly suggest you buy the =
O'Reilly & Associates, Inc. book "Lex & Yacc" -- Levine, Mason & Brown =
(ISBN 1-56592-000-7). And Delorie (creator of DJGPP) has Flex and Bison =
ports for DOS. There is a little bit of work to get VC to automatically =
run them. Flex does have support for a C++ lexical analyzer. However, =
I've not been able to find a reliable C++ version of the Bison parser. =
But remember that all C code runs along side C++, so you could probably =
get along with using the C versions of both.
[View Quote] Now my only problem is the downloaded update files come out =
corrupt, perhaps you could take a look at the project file? (It's only =
24KB Compiled, so it's not large by ANY means).

------=_NextPart_000_0037_01BF1417.FFAA08C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>Have you looked into&nbsp;Flex/Bison&nbsp;to doing the parsing for=20
you?&nbsp; Using these tools you can spend more time on the more =
important code=20
in your program.</DIV>
<DIV>&nbsp;</DIV>
<DIV>If the project is VC, I could take a look.&nbsp; (I have =
VC6.)&nbsp; Send=20
it to <A =
href=3D"mailto:serac at lightmail.com">serac at lightmail.com</A>.</DIV>
<DIV>&nbsp;</DIV>
<DIV>P.S. If you are interested in Flex/Bison, I highly suggest you buy =
the=20
O'Reilly &amp; Associates, Inc. book "Lex&nbsp;&amp; Yacc" -- Levine, =
Mason=20
&amp; Brown (ISBN 1-56592-000-7).&nbsp; And Delorie (creator of DJGPP) =
has Flex=20
and Bison ports for DOS.&nbsp; There is a little bit of work to get VC =
to=20
automatically run them.&nbsp; Flex does have support for a C++ lexical=20
analyzer.&nbsp; However, I've not been able to find a reliable C++ =
version of=20
the Bison parser.&nbsp; But remember that all C code runs along side =
C++, so=20
you&nbsp;could probably get along with using the C versions of =
both.</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV>Andon M. Coleman &lt;<A=20
href=3D"mailto:gizmo98 at earthlink.net">gizmo98 at earthlink.net</A>&gt; =
wrote in=20
message <A =
href=3D"news:38016db3.0 at homer">news:38016db3.0 at homer</A>...</DIV>
<DIV><FONT face=3DArial>&nbsp;&nbsp;&nbsp; Actually, my problem was in =
my=20
"Parsing Code" . . . I simply added some more code to strain the =
data&nbsp;to=20
the Left 4 Bytes in the CString (Since through my formatting / testing =
I have=20
added many more bytes) . . . And voila, it worked :)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial>&nbsp;&nbsp;&nbsp; Now my only problem is the =
downloaded=20
update files come out corrupt, perhaps you could take a look at the =
project=20
file? (It's only 24KB Compiled, so it's not large by ANY=20
means).</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0037_01BF1417.FFAA08C0--

andon m. coleman

Oct 13, 1999, 6:02pm
This is a multi-part message in MIME format.

------=_NextPart_000_0013_01BF1594.6BA9DAA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Actually, I fixed every single bug :)

For some reason attempting to put my HTTP Get File function into a =
Thread of its own was a bad idea . . . So, I moved the ENTIRE Process =
into its own thread, now it works great . . . You can move the window =
around while its downloading, and the Progress indicators work =
perfectly.

But thanks for the help originally . . .

Andon M. Coleman

Senior Programmer
R&D

Nothing, Inc.
[View Quote] If the project is VC, I could take a look. (I have VC6.) Send it to =
serac at lightmail.com.

P.S. If you are interested in Flex/Bison, I highly suggest you buy the =
O'Reilly & Associates, Inc. book "Lex & Yacc" -- Levine, Mason & Brown =
(ISBN 1-56592-000-7). And Delorie (creator of DJGPP) has Flex and Bison =
ports for DOS. There is a little bit of work to get VC to automatically =
run them. Flex does have support for a C++ lexical analyzer. However, =
I've not been able to find a reliable C++ version of the Bison parser. =
But remember that all C code runs along side C++, so you could probably =
get along with using the C versions of both.
[View Quote] Now my only problem is the downloaded update files come out =
corrupt, perhaps you could take a look at the project file? (It's only =
24KB Compiled, so it's not large by ANY means).

------=_NextPart_000_0013_01BF1594.6BA9DAA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial>Actually, I fixed every single =
bug&nbsp;:)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial>&nbsp;&nbsp;&nbsp; For some reason attempting to =
put my=20
HTTP Get File function into a Thread of its own was a bad idea . . . So, =
I moved=20
the ENTIRE Process into its own thread, now it works great . . . You can =
move=20
the window around while its downloading, and the Progress indicators =
work=20
perfectly.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial>But thanks for the help originally . . =
..</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial>Andon M. Coleman</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial>Senior Programmer</FONT></DIV>
<DIV><FONT face=3DArial>R&amp;D</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial>Nothing, Inc.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV>Aaron Hill &lt;<A=20
href=3D"mailto:serac at lightmail.com">serac at lightmail.com</A>&gt; wrote =
in message=20
<A href=3D"news:380291fc at homer">news:380291fc at homer</A>...</DIV>
<DIV>Have you looked into&nbsp;Flex/Bison&nbsp;to doing the parsing =
for=20
you?&nbsp; Using these tools you can spend more time on the more =
important=20
code in your program.</DIV>
<DIV>&nbsp;</DIV>
<DIV>If the project is VC, I could take a look.&nbsp; (I have =
VC6.)&nbsp; Send=20
it to <A =
href=3D"mailto:serac at lightmail.com">serac at lightmail.com</A>.</DIV>
<DIV>&nbsp;</DIV>
<DIV>P.S. If you are interested in Flex/Bison, I highly suggest you =
buy the=20
O'Reilly &amp; Associates, Inc. book "Lex&nbsp;&amp; Yacc" -- Levine, =
Mason=20
&amp; Brown (ISBN 1-56592-000-7).&nbsp; And Delorie (creator of DJGPP) =
has=20
Flex and Bison ports for DOS.&nbsp; There is a little bit of work to =
get VC to=20
automatically run them.&nbsp; Flex does have support for a C++ lexical =

analyzer.&nbsp; However, I've not been able to find a reliable C++ =
version of=20
the Bison parser.&nbsp; But remember that all C code runs along side =
C++, so=20
you&nbsp;could probably get along with using the C versions of =
both.</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; =
MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV>Andon M. Coleman &lt;<A=20
href=3D"mailto:gizmo98 at earthlink.net">gizmo98 at earthlink.net</A>&gt; =
wrote in=20
message <A =
href=3D"news:38016db3.0 at homer">news:38016db3.0 at homer</A>...</DIV>
<DIV><FONT face=3DArial>&nbsp;&nbsp;&nbsp; Actually, my problem was =
in my=20
"Parsing Code" . . . I simply added some more code to strain the=20
data&nbsp;to the Left 4 Bytes in the CString (Since through my =
formatting /=20
testing I have added many more bytes) . . . And voila, it worked=20
:)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial>&nbsp;&nbsp;&nbsp; Now my only problem is =
the=20
downloaded update files come out corrupt, perhaps you could take a =
look at=20
the project file? (It's only 24KB Compiled, so it's not large by ANY =

means).</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0013_01BF1594.6BA9DAA0--

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn