C++建造者问题

发布于 2024-11-16 18:20:05 字数 3509 浏览 2 评论 0原文

我在 Borland C++ 5.0 中安装了 BusinessSkin 包,工作正常,两天后我看到它只是从 \VLC\Clipboard.hpp 和 Borland C++ 5.0 标头打开一个标头,它给了我一个错误声明 Termied incoretly

#ifndef ClipbrdHPP
#define ClipbrdHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Graphics.hpp> // Pascal unit
#include <Classes.hpp>  // Pascal unit
#include <Messages.hpp> // Pascal unit
#include <Windows.hpp>  // Pascal unit
#include <SysInit.hpp>  // Pascal unit
#include <System.hpp>   // Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Clipbrd
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TClipboard;
class PASCALIMPLEMENTATION TClipboard : public Classes::TPersistent 
{
    typedef Classes::TPersistent inherited;

private:
    int FOpenRefCount;
    HWND FClipboardWindow;
    bool FAllocated;
    bool FEmptied;
    void __fastcall Adding(void);
    void __fastcall AssignGraphic(Graphics::TGraphic* Source);
    void __fastcall AssignPicture(Graphics::TPicture* Source);
    void __fastcall AssignToBitmap(Graphics::TBitmap* Dest);
    void __fastcall AssignToMetafile(Graphics::TMetafile* Dest);
    void __fastcall AssignToPicture(Graphics::TPicture* Dest);
    AnsiString __fastcall GetAsText();
    int __fastcall GetFormatCount(void);
    Word __fastcall GetFormats(int Index);
    void __fastcall SetAsText(const AnsiString Value);
    void __fastcall SetBuffer(Word Format, void *Buffer, int Size);
    void __fastcall WndProc(Messages::TMessage &Message);

protected:
    virtual void __fastcall AssignTo(Classes::TPersistent* Dest);

public:
    virtual void __fastcall Assign(Classes::TPersistent* Source);
    void __fastcall Clear(void);
    void __fastcall Close(void);
    Classes::TComponent* __fastcall GetComponent(Classes::TComponent* Owner, Classes::TComponent* Parent
        );
    unsigned __fastcall GetAsHandle(Word Format);
    int __fastcall GetTextBuf(char * Buffer, int BufSize);
    bool __fastcall HasFormat(Word Format);
    void __fastcall Open(void);
    void __fastcall SetComponent(Classes::TComponent* Component);
    void __fastcall SetAsHandle(Word Format, unsigned Value);
    void __fastcall SetTextBuf(char * Buffer);
    __property AnsiString AsText = {read=GetAsText, write=SetAsText};
    __property int FormatCount = {read=GetFormatCount, nodefault};
    __property Word Formats[int Index] = {read=GetFormats};
public:
    #pragma option push -w-inl
    /* TPersistent.Destroy */ inline __fastcall virtual ~TClipboard(void) { }
    #pragma option pop

public:
    #pragma option push -w-inl
    /* TObject.Create */ inline __fastcall TClipboard(void) : Classes::TPersistent() { }
    #pragma option pop

};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE Word CF_PICTURE;
extern PACKAGE Word CF_COMPONENT;
extern PACKAGE TClipboard* __fastcall Clipboard(void);
extern PACKAGE TClipboard* __fastcall SetClipboard(TClipboard* NewClipboard);

}   /* namespace Clipbrd */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Clipbrd;
#endif
#pragma option pop  // -w-
#pragma option pop  // -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif  // Clipbrd

我继续前进另一台电脑上有 c++ builder 5.0 和 2009,我刚刚安装了该库,它给出了类似的错误,但在其他单元中,为什么?

该库在 Delphi 中运行。最初我编译了大约有 50-60 个单元的库,并且可以在安装时运行。

I installed the package BusinessSkin, in Borland C++ 5.0 and i works fine, and after 2 days i see it just open a header from \VLC\Clipboard.hpp and Borland C++ 5.0 header and it give me an error Declaration Terminated incoretly

#ifndef ClipbrdHPP
#define ClipbrdHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Graphics.hpp> // Pascal unit
#include <Classes.hpp>  // Pascal unit
#include <Messages.hpp> // Pascal unit
#include <Windows.hpp>  // Pascal unit
#include <SysInit.hpp>  // Pascal unit
#include <System.hpp>   // Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Clipbrd
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TClipboard;
class PASCALIMPLEMENTATION TClipboard : public Classes::TPersistent 
{
    typedef Classes::TPersistent inherited;

private:
    int FOpenRefCount;
    HWND FClipboardWindow;
    bool FAllocated;
    bool FEmptied;
    void __fastcall Adding(void);
    void __fastcall AssignGraphic(Graphics::TGraphic* Source);
    void __fastcall AssignPicture(Graphics::TPicture* Source);
    void __fastcall AssignToBitmap(Graphics::TBitmap* Dest);
    void __fastcall AssignToMetafile(Graphics::TMetafile* Dest);
    void __fastcall AssignToPicture(Graphics::TPicture* Dest);
    AnsiString __fastcall GetAsText();
    int __fastcall GetFormatCount(void);
    Word __fastcall GetFormats(int Index);
    void __fastcall SetAsText(const AnsiString Value);
    void __fastcall SetBuffer(Word Format, void *Buffer, int Size);
    void __fastcall WndProc(Messages::TMessage &Message);

protected:
    virtual void __fastcall AssignTo(Classes::TPersistent* Dest);

public:
    virtual void __fastcall Assign(Classes::TPersistent* Source);
    void __fastcall Clear(void);
    void __fastcall Close(void);
    Classes::TComponent* __fastcall GetComponent(Classes::TComponent* Owner, Classes::TComponent* Parent
        );
    unsigned __fastcall GetAsHandle(Word Format);
    int __fastcall GetTextBuf(char * Buffer, int BufSize);
    bool __fastcall HasFormat(Word Format);
    void __fastcall Open(void);
    void __fastcall SetComponent(Classes::TComponent* Component);
    void __fastcall SetAsHandle(Word Format, unsigned Value);
    void __fastcall SetTextBuf(char * Buffer);
    __property AnsiString AsText = {read=GetAsText, write=SetAsText};
    __property int FormatCount = {read=GetFormatCount, nodefault};
    __property Word Formats[int Index] = {read=GetFormats};
public:
    #pragma option push -w-inl
    /* TPersistent.Destroy */ inline __fastcall virtual ~TClipboard(void) { }
    #pragma option pop

public:
    #pragma option push -w-inl
    /* TObject.Create */ inline __fastcall TClipboard(void) : Classes::TPersistent() { }
    #pragma option pop

};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE Word CF_PICTURE;
extern PACKAGE Word CF_COMPONENT;
extern PACKAGE TClipboard* __fastcall Clipboard(void);
extern PACKAGE TClipboard* __fastcall SetClipboard(TClipboard* NewClipboard);

}   /* namespace Clipbrd */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Clipbrd;
#endif
#pragma option pop  // -w-
#pragma option pop  // -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif  // Clipbrd

I moved on a different PC there i had c++ builder 5.0 and 2009, i just installed the library and it give a similary error but in other unit, why?

The library works in Delphi. Initialy i compiled the library that have about 50-60 units, and works, also on installing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文