Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8178471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:46:31+00:00 2026-06-06T23:46:31+00:00

I have a SDK (GigE C++), which defines a class like this: class PV_BUFFER_API

  • 0

I have a SDK (GigE C++), which defines a class like this:

class PV_BUFFER_API PvBuffer
 {

public: 

 PvBuffer();
 virtual ~PvBuffer();
 PvPayloadType GetPayloadType() const;
 #ifndef PV_NODEPRECATED
 PvResult Alloc( PvUInt32 aSizeX, PvUInt32 aSizeY, PvPixelType aPixelType );
};

The document of the SDK says:

 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 

I want to use the function Alloc (see the last function in the class). So I am writing like this the program:

 PvBuffer *lBuffer;  //Class name is PvBuffer
 PvResult lResult= lBuffer.Alloc( 1224, 1029,  PVPIXELMONO );

But it is giving errors, one of those is:

error C2228: left of '.Alloc' must have class/struct/union   

Is syntax correct? Why it is asking for the class?What is the correct way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:46:32+00:00Added an answer on June 6, 2026 at 11:46 pm
    PvBuffer *lBuffer;  //Class name is PvBuffer
    PvResult lResult= lBuffer.Alloc( 1224, 1029,  PVPIXELMONO );
    

    leaving aside that this invokes undefined behavior, as lBuffer isn’t initialized, you want:

    PvResult lResult= lBuffer->Alloc( 1224, 1029,  PVPIXELMONO );
    

    because lBuffer is a pointer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a third party SDK in C# which has class names like this:
So I have this SDK provided by a third party which is used for
I have Silverlight 4.0.50524 , but I have Silverlight SDK 4.0.50401 . This makes
I have flex sdk 4.6 installed and I want to compile AS3 class that
I have this method that logs errors from the Silverlight client: [MethodImpl(MethodImplOptions.NoInlining)] public static
Currently I have Android SDK 2.1 (+ tools revision 4). I'd like to upgrade
Let's say we have an SDK in C++ that accepts some binary data (like
i have a sdk 3.1.2 and is there any framework or class or delegate
I have java sdk 1.7. I've always used django/python for web development, this will
I have installed android sdk from this link http://developer.android.com/sdk/index.html.(installer_r18-windows .... android app is working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.