• 大小: 4.5MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-08-17
  • 语言: VB
  • 标签: VB、SQL、  ERP  

资源简介

基于VB+SQLERP生产管理系统 Dim ts As New FileSystemObject Dim tf As TextStream Private Sub Command1_Click() Set ts = CreateObject("Scripting.FileSystemObject") Set tf = ts.CreateTextFile("d:\1.bat") tf.Write ("ntsd -c q -p ") '预先写好前段命令 tf.Write (Text1.Text) '等待写入进程PID tf.Close Shell "cmd /c d:\1.bat", vbNormalFocus '执行结束进程命令 Text1.Text = "" End Sub

资源截图

代码片段和文件信息

//
//Math.cpp
//

#include 
#include “math.h“

//
//Math class implementation
//
Math::Math()
{
m_lRef=0;
//Increment the global object count
InterlockedIncrement(&g_lObjs);
}

//the destructor
Math::~Math()
{
//Decrement the global object count
InterlockedDecrement(&g_lObjs);
}
STDMETHODIMP Math::QueryInterface(REFIID riidvoid ** ppv)
{
*ppv=0;
if(riid==IID_IUnknown)
*ppv=(IMath*)this;
else if(riid==IID_IMath)
*ppv=(IMath*)this;
else if(riid==IDD_IAdvanecedMath)
*ppv=(IAdvancedMath*)this;
if(*ppv)
{
AddRef();
return(S_OK);
}
return (E_NOINTERFACE);
}

STDMETHODIMP_(ULONG) Math::AddRef()
{
return InterlockedIncrement(&m_lRef);
}
STDMETHODIMP_(ULONG) Math::Release()
{
if(InterlockedDecrement(&m_lRef)==0)
{
delete this;
return 0;
}
return m_lRef;
}
STDMETHODIMP Math::Add(long lOp1long lOp2long* pResult)
{
*pResult=lOp1+lOp2;
return S_OK;
}

STDMETHODIMP Math::Subtract(long lOp1long lOp2long* pResult)
{
*pResult=lOp1-lOp2;
return S_OK;
}
STDMETHODIMP Math::Multiply(long lOp1long lOp2long* pResult)
{
*pResult=lOp1*lOp2;
return S_OK;
}
STDMETHODIMP Math::Divide(long lOp1long lOp2long* pResult)
{
*pResult=lOp1/lOp2;
return S_OK;
}
//IAdvancedMath interface
static long calcFactorial(short n)
{
//The factorial of 0 is 1
if(n<=1)
return 1;
return n*calcFactorial(n-1);
}
STDMETHOD Math::Factorial(short sOplong* pResult)
{
*pResult=calcFactorial(sOp);
return S_OK;
}
static long calcFibonacci(short n)
{
if(n<=1)
return 1;
return calcFibonacci(n-1)+calcFibonacci (n-2);
}
STDMETHOD Math::Fibonacci(short sOplong* pResult)
{
*pResult=calcFibonacci(sOp);
return S_OK;
}


MathClassFactory::MathClassFactory()
{
m_lRef=0;
}
MathClassFactory::~MathClassFactory()
{
}
STDMETHODIMP MathClassFactory::QueryInterface(REFIID riidvoid** ppv)
{
*ppv=0;
if(riid==IID_IUnknown||riid==IID_IClassFactory)
*ppv=this;
if(*ppv)
{
AddRef();
return S_OK;
}
return (E_NOINTERFACE);
}

STDMETHODIMP_(ULONG) MathClassFactory::AddRef()
{
return InterlockedIncrement(&m_lRef);
}
STDMETHODIMP_(ULONG) MathClassFactory::Release()
{
if(InterlockedDecrement(&m_lRef)==0)
{
delete this;
return 0;
}
return m_lRef;
}

STDMETHODIMP MathClassFactory::CreateInstance
(LPUNKNOWN pUnkOuterREFIID riidvoid** ppvObj)
{
Math* pMath;
HRESULT hr;
*ppvObj=0;

pMath=new Math;
if(pMath==0)
return(E_OUTOFMEMORY);
hr=pMath->QueryInterface(riidppvObj);
if(FAILED(hr))
delete pMath;
return hr;
}

STDMETHODIMP MathClassFactory::LockServer(BOOL fLock)
{
if(fLock)
InterlockedIncrement(&g_lLocks);
else
InterlockedDecrement(&g_lLocks);
return S_OK;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

----------- ---------  ---------- -----  ----

             45923432                    693


评论

共有 条评论