次のようなクラスを定義する SDK (GigE C++) があります。
class PV_BUFFER_API PvBuffer
{
public:
PvBuffer();
virtual ~PvBuffer();
PvPayloadType GetPayloadType() const;
#ifndef PV_NODEPRECATED
PvResult Alloc( PvUInt32 aSizeX, PvUInt32 aSizeY, PvPixelType aPixelType );
};
SDK のドキュメントには次のように書かれています。
PvResult PvBuffer::Alloc ( PvUInt32 aSizeX,
PvUInt32 aSizeY,
PvPixelType aPixelType
)
Allocates memory for this PvBuffer.
Parameters:
[in] aSizeX The width of the image, in pixels. See GetWidth.
[in] aSizeY The height of the image, in pixels. See GetHeight.
[in] aPixelType The GEV pixel type from which the pixel depth is extracted. For
supported pixel types, see PvPixelType.h.
Returns:
Includes:
PvResult::Code::OK
PvResult::Code::NOT_ENOUGH_MEMORY
関数 Alloc を使用したい (クラスの最後の関数を参照)。だから私はこのようにプログラムを書いています:
PvBuffer *lBuffer; //Class name is PvBuffer
PvResult lResult= lBuffer.Alloc( 1224, 1029, PVPIXELMONO );
しかし、エラーが発生しています。そのうちの1つは次のとおりです。
error C2228: left of '.Alloc' must have class/struct/union
構文は正しいですか? なぜクラスを求めているのですか?正しい方法は何ですか?