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. C / C++ / MFC
  4. A problem

A problem

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
6 Posts 4 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.
  • M Offline
    M Offline
    minihotto
    wrote on last edited by
    #1

    Hello, I create a "MFC application" project in MSVC 2005. But I want to add a class ref from tThread. For example, public ref class tThread { public: XXXXXXXXXXXXX }; I add this code in the Form1.h. But it has a default class From1. I create a new header file to include. #include "mythread.h" But it come some errors. This is mythread.h /////////////////////////// #ifndef MYTHREAD_H #define MYTHREAD_H public ref class tThread { public: static void Threadsend(); } #endif ///////////////////////////// This is mythread.cpp #include "mythread" using namespace System::Threading; static void Threadsend(){ Thread::Sleep( 0 ); } What's wrong with my code or are there better method to do it? Appreciate your reply. Thank you. Jane

    B 1 Reply Last reply
    0
    • M minihotto

      Hello, I create a "MFC application" project in MSVC 2005. But I want to add a class ref from tThread. For example, public ref class tThread { public: XXXXXXXXXXXXX }; I add this code in the Form1.h. But it has a default class From1. I create a new header file to include. #include "mythread.h" But it come some errors. This is mythread.h /////////////////////////// #ifndef MYTHREAD_H #define MYTHREAD_H public ref class tThread { public: static void Threadsend(); } #endif ///////////////////////////// This is mythread.cpp #include "mythread" using namespace System::Threading; static void Threadsend(){ Thread::Sleep( 0 ); } What's wrong with my code or are there better method to do it? Appreciate your reply. Thank you. Jane

      B Offline
      B Offline
      baerten
      wrote on last edited by
      #2

      Hi, i never heared about a "ref class", but google lists some sites about it. What do you like to do exactly? Greetz

      H 1 Reply Last reply
      0
      • B baerten

        Hi, i never heared about a "ref class", but google lists some sites about it. What do you like to do exactly? Greetz

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        We have ref class and value class (on the CLI/C++) its better I write of MSDN A ref class or ref struct can inherit from zero or more managed interfaces and zero or one ref types. A value class or value struct can only inherit from zero or more managed interfaces.

        public ref class Items
        {
        private : int size;
        ....
        };

        public value class differ
        {
        private:
        String^ str;
        ....
        };

        J 1 Reply Last reply
        0
        • H Hamid Taebi

          We have ref class and value class (on the CLI/C++) its better I write of MSDN A ref class or ref struct can inherit from zero or more managed interfaces and zero or one ref types. A value class or value struct can only inherit from zero or more managed interfaces.

          public ref class Items
          {
          private : int size;
          ....
          };

          public value class differ
          {
          private:
          String^ str;
          ....
          };

          J Offline
          J Offline
          jhwurmbach
          wrote on last edited by
          #4

          Hamid. wrote:

          We have ref class and value class (on the CLI/C++)

          Seems as if you are in the wrong Forum... Try your question in theManaged C++-Forum[^]


          Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
          George Orwell, "Keep the Aspidistra Flying", Opening words

          H 1 Reply Last reply
          0
          • J jhwurmbach

            Hamid. wrote:

            We have ref class and value class (on the CLI/C++)

            Seems as if you are in the wrong Forum... Try your question in theManaged C++-Forum[^]


            Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
            George Orwell, "Keep the Aspidistra Flying", Opening words

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            But I dont have any question.

            M 1 Reply Last reply
            0
            • H Hamid Taebi

              But I dont have any question.

              M Offline
              M Offline
              minihotto
              wrote on last edited by
              #6

              There is no problem@@. It works.

              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