Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Some help needed with class and this pointer

Some help needed with class and this pointer

Scheduled Pinned Locked Moved Managed C++/CLI
helpcryptographylounge
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nah1337
    wrote on last edited by
    #1

    Hello , why i cant return the char* something using the class like that.

    struct random_class {

    char \*something;
    
    void \_\_thiscall classfunction (void \*pParam);
    

    };
    random_class* pParam;

    void (__thiscall* classfunction)(void *pParam );
    void __thiscall myclassfunction(void *pParam )
    {
    classfunction(pParam->something);
    }

    error C2227: left of '->crypto_buf' must point to class/struct/union/generic type 1> type is 'void *'

    G 1 Reply Last reply
    0
    • N nah1337

      Hello , why i cant return the char* something using the class like that.

      struct random_class {

      char \*something;
      
      void \_\_thiscall classfunction (void \*pParam);
      

      };
      random_class* pParam;

      void (__thiscall* classfunction)(void *pParam );
      void __thiscall myclassfunction(void *pParam )
      {
      classfunction(pParam->something);
      }

      error C2227: left of '->crypto_buf' must point to class/struct/union/generic type 1> type is 'void *'

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      nah1337 wrote:

      ->crypto_buf'

      are you sure you've posted the correct section of code ? I cant see :-

      nah1337 wrote:

      ->crypto_buf'

      anywhere in that snippet you've posted, so I dont know what relevance it has to your issue ... 'g'

      N 1 Reply Last reply
      0
      • G Garth J Lancaster

        nah1337 wrote:

        ->crypto_buf'

        are you sure you've posted the correct section of code ? I cant see :-

        nah1337 wrote:

        ->crypto_buf'

        anywhere in that snippet you've posted, so I dont know what relevance it has to your issue ... 'g'

        N Offline
        N Offline
        nah1337
        wrote on last edited by
        #3

        Yeah was mine mistake it should look like this:

        struct random_class {

        char \*crypto\_buf;
        
        void \_\_thiscall classfunction (void \*pParam);
        

        };
        random_class* pParam;

        void (__thiscall* classfunction)(void *pParam );
        void __thiscall myclassfunction(void *pParam )
        {
        classfunction(pParam->crypto_buf);
        }

        error C2227: left of '->crypto_buf' must point to class/struct/union/generic type 1> type is 'void *'

        L 1 Reply Last reply
        0
        • N nah1337

          Yeah was mine mistake it should look like this:

          struct random_class {

          char \*crypto\_buf;
          
          void \_\_thiscall classfunction (void \*pParam);
          

          };
          random_class* pParam;

          void (__thiscall* classfunction)(void *pParam );
          void __thiscall myclassfunction(void *pParam )
          {
          classfunction(pParam->crypto_buf);
          }

          error C2227: left of '->crypto_buf' must point to class/struct/union/generic type 1> type is 'void *'

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          See my answer here[^].

          txtspeak is the realm of 9 year old children, not developers. Christian Graus

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups