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. A problem

A problem

Scheduled Pinned Locked Moved Managed C++/CLI
c++helptutorialquestion
3 Posts 2 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

    J 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

      J Offline
      J Offline
      Jonathan Darka
      wrote on last edited by
      #2

      Please post on the correct form, you are much more likely to get an answer.


      Jonathan Wilkes Darka[Xanya.net]

      M 1 Reply Last reply
      0
      • J Jonathan Darka

        Please post on the correct form, you are much more likely to get an answer.


        Jonathan Wilkes Darka[Xanya.net]

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

        I move the code in mythread.cpp to mythread.h. Then it works. I think I had the problem before just because I dont understand how to create my own header file completely. -- modified at 6:43 Thursday 25th October, 2007

        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