| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1753 人关注过本帖
标题:【急求助】程序中出现missing ';' before 'PCH creation point'错误信息是怎 ...
只看楼主 加入收藏
lixuanalex
Rank: 1
等 级:新手上路
帖 子:42
专家分:0
注 册:2008-4-23
收藏
 问题点数:0 回复次数:0 
【急求助】程序中出现missing ';' before 'PCH creation point'错误信息是怎么回事?
程序中出现missing ';' before 'PCH creation point'错误信息是怎么回事?
各位大虾帮忙!

源码:
//factory.cpp文件
#include "Factory.h"
#include "Math.h"

extern ULONG    g_LockNumber;
extern ULONG    g_MathNumber;

CMathFactory::CMathFactory()
{
    m_Ref=0;
}

CMathFactory::~CMathFactory()
{
}

HRESULT CMathFactory::QueryInterface(const IID& iid,void **ppv)
{
    if(iid==IID_IUnknow)
    {
        *ppv=(IUnknow*)this;
        ((IUnknow*)(*ppv))->AddRef();
    }
    else if(iid==IID_IClassFactory)
    {
        *ppv=(IAdd*)this;
        ((IClassFactory*)(*ppv))->AddRef();
    }
    else
    {
        *ppv=NULL;
        return E_NOINTERFACE;
    }
    return S_OK;
}

ULONG CMathFactory::AddRef()
{
    return (ULONG) (++m_Ref);
}

ULONG CMathFactory::Release()
{
    
    if(--m_Ref==0)
    {
        delete this;
        return 0;
    }
    return (ULONG) m_Ref;
}

HRESULT CMathFactory::CreateInstance(IUnknown *pUnknownOuter,const IID &iid,void **ppv)
{
    CMath* pObj;
    HRESULT hr;
    
    *ppv=NULL;
    hr=E_OUTOFMEMORY;
    if(NULL!=pUnknownOuter)
        return CLASS_E_NOAGGREGATION;
    pObj=new CMath();
    if(NULL==pObj)
        return hr;
    hr=pObj->QueryInterface(iid,ppv);
    if(hr!=S_OK)
    {
        g_MathNumber--;
        delete pObj;
    }
    return hr;
}

HRESULT CMathFactory::LockServer(BOOL block)
{
    if(block)
        g_LockNumber++;
    else
        g_LockNumber--;
    return NOERROR;
}

factory.h文件
#ifndef __MATH_FACTORY__
#define __MATH_FACTORY__

#include "Unknwn.h"

class CMathFactory:public IClassFactory
{
protected:
    ULONG m_Ref;
public:
    CMathFactory();
    ~CMathFactory();

    HRESULT __stdcall QueryInterface(const IID& iid,void **ppv);
    ULONG __stdcall AddRef();
    ULONG __stdcall Release();

    HRESULT __stdcall CreateInstance(IUnknown *,const IID& iid,void **ppv);
    HRESULT __stdcall LockServer(BOOL block);
};
#endif;
搜索更多相关主题的帖子: PCH 错误信息 程序中 creation point 
2008-05-21 08:31
快速回复:【急求助】程序中出现missing ';' before 'PCH creation point'错误信 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022049 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved