Commit for development environment setup
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
using namespace System::Reflection;
|
||||
using namespace System::Runtime::CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly:AssemblyTitleAttribute("")];
|
||||
[assembly:AssemblyDescriptionAttribute("")];
|
||||
[assembly:AssemblyConfigurationAttribute("")];
|
||||
[assembly:AssemblyCompanyAttribute("")];
|
||||
[assembly:AssemblyProductAttribute("")];
|
||||
[assembly:AssemblyCopyrightAttribute("")];
|
||||
[assembly:AssemblyTrademarkAttribute("")];
|
||||
[assembly:AssemblyCultureAttribute("")];
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the value or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly:AssemblyVersionAttribute("1.1.*")];
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project directory.
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly:AssemblyDelaySignAttribute(false)];
|
||||
[assembly:AssemblyKeyFileAttribute("E:\\proms.net\\Public Key\\vlnkey.snk")];
|
||||
[assembly:AssemblyKeyNameAttribute("")];
|
||||
|
@@ -0,0 +1,31 @@
|
||||
========================================================================
|
||||
DYNAMIC LINK LIBRARY : WinExeClass Project Overview
|
||||
========================================================================
|
||||
|
||||
AppWizard has created this WinExeClass DLL for you.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your WinExeClass application.
|
||||
|
||||
WinExeClass.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
WinExeClass.cpp
|
||||
This is the main DLL source file.
|
||||
|
||||
WinExeClass.h
|
||||
This file contains a class declaration.
|
||||
|
||||
AssemblyInfo.cpp
|
||||
Contains custom attributes for modifying assembly metadata.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
@@ -0,0 +1,5 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// WinExeClass.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
@@ -0,0 +1,8 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently,
|
||||
// but are changed infrequently
|
||||
|
||||
#pragma once
|
||||
|
||||
#using <mscorlib.dll>
|
||||
|
@@ -0,0 +1,142 @@
|
||||
/*********************************************************************************************
|
||||
* Copyright 2002 - Volian Enterprises, Inc. All rights reserved.
|
||||
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
* ------------------------------------------------------------------------------
|
||||
* $Workfile: WinExeClass.cpp $ $Revision: 3 $
|
||||
* $Author: Jsj $ $Date: 12/16/03 11:59a $
|
||||
*
|
||||
* $History: WinExeClass.cpp $
|
||||
*
|
||||
* ***************** Version 3 *****************
|
||||
* User: Jsj Date: 12/16/03 Time: 11:59a
|
||||
* Updated in $/LibSource/WinExeClass
|
||||
* modified to all use in .net 1.0 and .net 1.1
|
||||
*
|
||||
* ***************** Version 2 *****************
|
||||
* User: Jsj Date: 1/06/03 Time: 9:52a
|
||||
* Updated in $/LibSource/WinExeClass
|
||||
* fixed problem of running a C# program - was returning to main process
|
||||
* before completing spawned process
|
||||
*
|
||||
* ***************** Version 1 *****************
|
||||
* User: Jsj Date: 8/23/02 Time: 2:57p
|
||||
* Created in $/LibSource/WinExeClass
|
||||
*********************************************************************************************/
|
||||
|
||||
// This is the main DLL file.
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "WinExeClass.h"
|
||||
|
||||
using namespace WinExeClass;
|
||||
|
||||
// Spawn off another process and run the passed in program.
|
||||
// Note that the documentation for WinExec() says that it's provided
|
||||
// for 16-bit windows compatibility and that applications should use
|
||||
// the CreateProcess function. So this class gives you access to
|
||||
// either the WinExe() or the CreateProcess() functions, just in case
|
||||
// one works better than the other for your current programming needs.
|
||||
|
||||
bool CLWinExec::RunWinExe(char *prgName)
|
||||
{
|
||||
bool RtnVal = false;
|
||||
RtnVal = DoWinExe(prgName);
|
||||
return RtnVal;
|
||||
}
|
||||
|
||||
bool CLWinExec::RunCreateProcess(char *prgName)
|
||||
{
|
||||
bool RtnVal = false;
|
||||
RtnVal = DoCreateProcess(prgName);
|
||||
return RtnVal;
|
||||
}
|
||||
|
||||
bool CLWinExec::RunWinExe(String *prgName)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
bool RtnVal = false;
|
||||
// UINT hInst;
|
||||
|
||||
// Grab the program name from the String class and place
|
||||
// in a NUll terminated char array.
|
||||
// Note that String uses unicode chars so not every character
|
||||
// can be convert to the char array. But this works for
|
||||
// what we currently need.
|
||||
int len;
|
||||
char *tmpstr;
|
||||
len = (prgName->get_Length)();
|
||||
tmpstr = new char(len + 1);
|
||||
ZeroMemory(tmpstr,len+1);
|
||||
for (int i=0; i < len; i++)
|
||||
tmpstr[i] = (prgName->get_Chars)(i);
|
||||
|
||||
RtnVal = DoWinExe(tmpstr);
|
||||
|
||||
return RtnVal;
|
||||
}
|
||||
|
||||
|
||||
bool CLWinExec::RunCreateProcess(String *prgName)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
bool RtnVal = false;
|
||||
// UINT hInst;
|
||||
|
||||
// Grab the program name from the String class and place
|
||||
// in a NUll terminated char array.
|
||||
// Note that String uses unicode chars so not every character
|
||||
// can be convert to the char array. But this works for
|
||||
// what we currently need.
|
||||
int len;
|
||||
char tmpstr[256];
|
||||
len = (prgName->get_Length)();
|
||||
// tmpstr = new char[len + 1];
|
||||
ZeroMemory(tmpstr,len+1);
|
||||
for (int i=0; i < len; i++)
|
||||
tmpstr[i] = (prgName->get_Chars)(i);
|
||||
|
||||
RtnVal = DoCreateProcess(tmpstr);
|
||||
|
||||
return RtnVal;
|
||||
}
|
||||
|
||||
|
||||
bool CLWinExec::DoWinExe(char *prgName)
|
||||
{
|
||||
bool RtnVal = false;
|
||||
UINT hInst;
|
||||
|
||||
hInst = WinExec(prgName,SW_NORMAL);
|
||||
if (hInst > 31){
|
||||
RtnVal = true;
|
||||
// Wait until child process exits.
|
||||
WaitForSingleObject((HANDLE)hInst,INFINITE);
|
||||
}
|
||||
return RtnVal;
|
||||
}
|
||||
|
||||
bool CLWinExec::DoCreateProcess(char *prgName)
|
||||
{
|
||||
bool RtnVal = false;
|
||||
STARTUPINFO procIn;
|
||||
PROCESS_INFORMATION procOut;
|
||||
|
||||
ZeroMemory(&procIn,sizeof(procIn));
|
||||
ZeroMemory(&procOut,sizeof(procOut));
|
||||
|
||||
procIn.dwFlags = STARTF_FORCEOFFFEEDBACK;
|
||||
procIn.cb = sizeof(STARTUPINFO);
|
||||
|
||||
// if (CreateProcess(prgName,NULL,NULL,NULL,FALSE,CREATE_SEPARATE_WOW_VDM,NULL,NULL,&procIn,&procOut))
|
||||
if (CreateProcess(NULL,prgName,NULL,NULL,FALSE,0,NULL,NULL,&procIn,&procOut))
|
||||
{
|
||||
RtnVal = true; // process completed normally
|
||||
// Wait until child process exits.
|
||||
WaitForSingleObject(procOut.hProcess,INFINITE);
|
||||
// Close process and thread handles.
|
||||
CloseHandle(procOut.hProcess);
|
||||
CloseHandle(procOut.hThread);
|
||||
}
|
||||
return RtnVal;
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
/*********************************************************************************************
|
||||
* Copyright 2002 - Volian Enterprises, Inc. All rights reserved.
|
||||
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
* ------------------------------------------------------------------------------
|
||||
* $Workfile: WinExeClass.h $ $Revision: 2 $
|
||||
* $Author: Jsj $ $Date: 12/16/03 11:59a $
|
||||
*
|
||||
* $History: WinExeClass.h $
|
||||
*
|
||||
* ***************** Version 2 *****************
|
||||
* User: Jsj Date: 12/16/03 Time: 11:59a
|
||||
* Updated in $/LibSource/WinExeClass
|
||||
* modified to all use in .net 1.0 and .net 1.1
|
||||
*
|
||||
* ***************** Version 1 *****************
|
||||
* User: Jsj Date: 8/23/02 Time: 2:57p
|
||||
* Created in $/LibSource/WinExeClass
|
||||
*********************************************************************************************/
|
||||
|
||||
// WinExeClass.h
|
||||
|
||||
#pragma once
|
||||
#include <windows.h>
|
||||
#include <atlstr.h>
|
||||
|
||||
using namespace System;
|
||||
|
||||
namespace WinExeClass
|
||||
{
|
||||
public __gc class CLWinExec
|
||||
{
|
||||
public:
|
||||
// TODO: Add your methods for this class here.
|
||||
CLWinExec(){};
|
||||
bool RunWinExe(char *prgName);
|
||||
bool RunWinExe(String *prgName);
|
||||
bool RunCreateProcess(char *prgName);
|
||||
bool RunCreateProcess(String *prgName);
|
||||
private:
|
||||
// char *tmpstr;
|
||||
bool DoWinExe(char *prgName);
|
||||
bool DoCreateProcess(char *prgName);
|
||||
};
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinExeClass", "WinExeClass.vcproj", "{3A668CA0-A3BC-11D6-8541-ACF0DF000000}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{3A668CA0-A3BC-11D6-8541-ACF0DF000000}.Debug.ActiveCfg = Debug|Win32
|
||||
{3A668CA0-A3BC-11D6-8541-ACF0DF000000}.Debug.Build.0 = Debug|Win32
|
||||
{3A668CA0-A3BC-11D6-8541-ACF0DF000000}.Release.ActiveCfg = Release|Win32
|
||||
{3A668CA0-A3BC-11D6-8541-ACF0DF000000}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="WinExeClass"
|
||||
ProjectGUID="{3A668CA0-A3BC-11D6-8541-ACF0DF000000}"
|
||||
Keyword="ManagedCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="e:\ve-proms.net\bin"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
ManagedExtensions="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/clr:initialAppDomain"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG"
|
||||
MinimalRebuild="FALSE"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/NOENTRY"
|
||||
OutputFile="$(OutDir)\WinExeClass.dll"
|
||||
LinkIncremental="2"
|
||||
ForceSymbolReferences="__DllMainCRTStartup@12"
|
||||
GenerateDebugInformation="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="E:\Ve-proms.net\BIN"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
ManagedExtensions="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/clr:initialAppDomain"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
MinimalRebuild="FALSE"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/NOENTRY"
|
||||
OutputFile="$(OutDir)/WinExeClass.dll"
|
||||
LinkIncremental="1"
|
||||
ForceSymbolReferences="__DllMainCRTStartup@12"
|
||||
GenerateDebugInformation="FALSE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
|
||||
<File
|
||||
RelativePath="AssemblyInfo.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Stdafx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="WinExeClass.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc">
|
||||
<File
|
||||
RelativePath="Stdafx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="WinExeClass.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;r">
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
Reference in New Issue
Block a user