Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyneu committed Oct 24, 2017
1 parent c5bf025 commit c7db011
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 31 deletions.
Binary file modified Release/tool3.exe
Binary file not shown.
Binary file removed tool3.suo
Binary file not shown.
44 changes: 26 additions & 18 deletions tool3/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ struct triggerblock


VOID c(VOID *)
{ CStringA X7,X8;
{

CWin32Heap stringHeap(HEAP_NO_SERIALIZE, 0, 0);

CAtlStringMgr M(&stringHeap);

CStringA X7(&M),X8(&M);
triggerblock z2,z={};
int p[3];
ZeroMemory(p,sizeof(p));
Expand All @@ -192,12 +198,12 @@ VOID c(VOID *)
DWORD numberofbyteswritten;
DWORD dwRead;
DWORD totalbytesavailable;
char output_cmd[400001];
char output_cmd[500001];
int h,c,ferrum=0,tm=400;
BYTE w=0;
CStringA t,bear;
CStringA t(&M),bear(&M);
SETTEXTEX fw;
fw.flags=4;
fw.flags=0;
fw.codepage=CP_THREAD_ACP;
int monte=0;
char reserve;
Expand All @@ -209,24 +215,24 @@ VOID c(VOID *)

if(totalbytesavailable)
{
ReadFile(stdoutRd, output_cmd, min(400000,totalbytesavailable), &dwRead, NULL);
h = min(400000,totalbytesavailable);
ReadFile(stdoutRd, output_cmd, min(500000,totalbytesavailable), &dwRead, NULL);
h = min(500000,totalbytesavailable);
output_cmd[h]='\0';
t=output_cmd;
if(monte) bear.SetAt(monte-2,reserve);
monte=monte+h;
bear=bear + t;
if(w++ > 11) {bear=bear.Right(monte=min(monte,3504));w=0;}
if(w++ > 9) {bear=bear.Right(monte=min(monte,3200));w=0;}
reserve=bear[monte-2];
bear.SetAt(monte-2,'\0');
SendMessage(hc,EM_SETTEXTEX,(WPARAM)&fw,(LPARAM)(LPCSTR)bear);
PostMessage(hc, WM_VSCROLL, SB_BOTTOM, 0);
SendMessage(hc, WM_VSCROLL, SB_BOTTOM, 0);


c=t.Find("Synced");
if(c != -1)
{
tm=2140;
tm=2240;
z2.block[2]=z.block[2];
z2.q=z.q;

Expand All @@ -248,15 +254,15 @@ VOID c(VOID *)

t=t.Right(h-c-7);
t.Truncate(h-c-11);
sscanf_s(t,"%d/%d",&p[1],&p[2]);
r=sscanf_s(t,"%d/%d",&p[1],&p[2]);
dc->SetPos(100*p[1]/p[2]);
bhr->SetProgressValue(hz,p[1],p[2]);
if(!(z.ptrigger)) { z.block[1]=p[1]; z.ptrigger=-8;}
if(!(z.ptrigger)&&r==2) { z.block[1]=p[1]; z.ptrigger=-8;}
if(z.tb==2)
{
z.block[2]=p[1];
z.q=60.0*((z.block[2] - z.block[1]))/(z.b - z.t);
if(z.tp==0) { z.x= 7.0*z.q; z.tp++; }
if(z.tp==0) { z.x= 7.8*z.q; z.tp++; }
t7->SetPos(140*z.q/z.x);
}
else z.tb=2;
Expand All @@ -271,7 +277,7 @@ VOID c(VOID *)
{
X7.Format(" %.2f block/m",z2.q);
z.outofthis=(p[2] - z2.block[2])/(z2.q*1440);
if(z2.q) X8.Format("\\qr\\ri800\\fs30 days to go %.1f \\par\\ri0\\fs33\n",z.outofthis);
if(z.q) X8.Format("\\qr\\ri800\\fs30 days to go %.1f \\par\\ri0\\fs33\n",z.outofthis);

dc->SetState(PBST_PAUSED);
bhr->SetProgressState(hz,TBPF_PAUSED);
Expand Down Expand Up @@ -327,8 +333,8 @@ void CMainFrame::tr()


SECURITY_ATTRIBUTES sa={sizeof(SECURITY_ATTRIBUTES), NULL, true};
CreatePipe(&stdinRd, &stdinWr, &sa, 1000);
CreatePipe(&stdoutRd,&stdoutWr, &sa,400000);
CreatePipe(&stdinRd, &stdinWr, &sa, 10000);
CreatePipe(&stdoutRd,&stdoutWr, &sa,500000);

STARTUPINFO si;
ZeroMemory(&si,sizeof(si));
Expand Down Expand Up @@ -360,7 +366,7 @@ void CMainFrame::tr()
return;
}
bren=0;
rew= AfxBeginThread((AFX_THREADPROC)c,NULL);
AfxBeginThread((AFX_THREADPROC)c,NULL,0,2097152);
}

void CMainFrame::w()
Expand Down Expand Up @@ -449,7 +455,8 @@ void CMainFrame::OnClose()
ExpandEnvironmentStrings(L"%USERPROFILE%\\Documents\\fold.",w,130);
xf=_wfopen(w,L"w");
fwprintf(xf,L"%s",t->f);
fwprintf(xf,L"\n%s",&remmi[1]);
if(remmi[0]==L' ')fwprintf(xf,L"\n%s",&remmi[1]);
else fwprintf(xf,L"\n%s",remmi);
fclose(xf);
}

Expand All @@ -469,7 +476,8 @@ void CMainFrame::OnClose()
ExpandEnvironmentStrings(L"%USERPROFILE%\\Documents\\fold.",w,130);
xf=_wfopen(w,L"w");
fwprintf(xf,L"%s",t->f);
fwprintf(xf,L"\n%s",&remmi[1]);
if(remmi[0]==L' ')fwprintf(xf,L"\n%s",&remmi[1]);
else fwprintf(xf,L"\n%s",remmi);
fclose(xf);
}
CWnd::OnClose();
Expand Down
6 changes: 2 additions & 4 deletions tool3/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
#include <fstream>
#include "targetver.h"
#include <iostream>

// turns off MFC's hiding of some common and often safely ignored warning messages
#define _AFX_ALL_WARNINGS

#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions

#include <afxdisp.h> // MFC Automation classes
//#include <afxdisp.h> // MFC Automation classes

#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
Expand All @@ -28,7 +26,7 @@
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

#include <afxcontrolbars.h> // MFC support for ribbons and control bars
//#include <afxcontrolbars.h> // MFC support for ribbons and control bars
#include <Shobjidl.h>


Expand Down
27 changes: 18 additions & 9 deletions tool3/tool3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand All @@ -73,10 +75,10 @@
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down Expand Up @@ -126,16 +128,17 @@
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>false</FunctionLevelLinking>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<StructMemberAlignment>Default</StructMemberAlignment>
<BufferSecurityCheck>false</BufferSecurityCheck>
<OmitFramePointers>true</OmitFramePointers>
<OmitFramePointers>false</OmitFramePointers>
<ErrorReporting>None</ErrorReporting>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -144,6 +147,8 @@
<OptimizeReferences>true</OptimizeReferences>
<LinkErrorReporting>NoErrorReport</LinkErrorReporting>
<TargetMachine>MachineX86</TargetMachine>
<LargeAddressAware>false</LargeAddressAware>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
Expand All @@ -161,23 +166,25 @@
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>false</FunctionLevelLinking>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN64;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<StructMemberAlignment>Default</StructMemberAlignment>
<BufferSecurityCheck>false</BufferSecurityCheck>
<OmitFramePointers>true</OmitFramePointers>
<OmitFramePointers>false</OmitFramePointers>
<ErrorReporting>None</ErrorReporting>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>false</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LinkErrorReporting>NoErrorReport</LinkErrorReporting>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
Expand All @@ -202,7 +209,9 @@
<ClInclude Include="tool3.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="MainFrm.cpp" />
<ClCompile Include="MainFrm.cpp">
<WholeProgramOptimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</WholeProgramOptimization>
</ClCompile>
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
Expand Down
Binary file modified x64/Release/tool3.exe
Binary file not shown.

0 comments on commit c7db011

Please sign in to comment.