Click here to Skip to main content
16,004,919 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionAny good books?? Pin
ptr2void12-Mar-08 2:22
ptr2void12-Mar-08 2:22 
AnswerRe: Any good books?? Pin
Paul Conrad12-Mar-08 5:39
professionalPaul Conrad12-Mar-08 5:39 
AnswerRe: Any good books?? Pin
Christian Graus12-Mar-08 14:57
protectorChristian Graus12-Mar-08 14:57 
GeneralRe: Any good books?? Pin
ptr2void12-Mar-08 19:30
ptr2void12-Mar-08 19:30 
GeneralRe: Any good books?? Pin
led mike13-Mar-08 4:08
led mike13-Mar-08 4:08 
AnswerRe: Any good books?? Pin
Member 454227212-Mar-08 18:19
Member 454227212-Mar-08 18:19 
QuestionExplicit casting and System::Collections::Generic::IEnumerable<t> ^</t> [modified] Pin
Member 454227211-Mar-08 18:31
Member 454227211-Mar-08 18:31 
GeneralRe: Explicit casting and System::Collections::Generic::IEnumerable ^ Pin
Mark Salsbery12-Mar-08 6:18
Mark Salsbery12-Mar-08 6:18 
It's really difficult to decipher your post, but I'll take a crack at Q1.

The error messages pretty much explain the errors.  You can't convert an Int32 to an enum^.
You also can't switch on an enum^.
You can't use the nullptr keyword in the enumeration.

Use your enumeration like an enumeration - you don't create handles to them on the GC heap.

Maybe this is what you wanted:
enum class Instruction {sit, sleep, jog};

ref class DataPack
{
public: 
    Instruction xxx;
    DataPack(array<Byte>^ data)
    {
        this->xxx = safe_cast<Instruction>(BitConverter::ToInt32(data, 0));
    }
};


Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Explicit casting and System::Collections::Generic::IEnumerable ^ Pin
Member 454227212-Mar-08 17:31
Member 454227212-Mar-08 17:31 
GeneralRe: Explicit casting and System::Collections::Generic::IEnumerable ^ Pin
Mark Salsbery12-Mar-08 17:37
Mark Salsbery12-Mar-08 17:37 
GeneralListBox Duplicacy.. Pin
ptr2void11-Mar-08 18:17
ptr2void11-Mar-08 18:17 
GeneralPost Duplicacy.. Pin
Giorgi Dalakishvili11-Mar-08 21:08
mentorGiorgi Dalakishvili11-Mar-08 21:08 
GeneralRe: Post Duplicacy.. Pin
ptr2void12-Mar-08 1:41
ptr2void12-Mar-08 1:41 
Questiontree Pin
rose19611-Mar-08 15:27
rose19611-Mar-08 15:27 
GeneralPinning Pointer (System::Array to BYTE[]) Pin
Jeffrey Walton10-Mar-08 18:10
Jeffrey Walton10-Mar-08 18:10 
GeneralRe: Pinning Pointer (System::Array to BYTE[]) Pin
Jeffrey Walton10-Mar-08 18:29
Jeffrey Walton10-Mar-08 18:29 
GeneralRe: Pinning Pointer (System::Array to BYTE[]) Pin
Mark Salsbery11-Mar-08 8:20
Mark Salsbery11-Mar-08 8:20 
GeneralRe: Pinning Pointer (System::Array to BYTE[]) Pin
Jeffrey Walton12-Mar-08 17:57
Jeffrey Walton12-Mar-08 17:57 
GeneralRe: Pinning Pointer (System::Array to BYTE[]) Pin
Mark Salsbery12-Mar-08 18:08
Mark Salsbery12-Mar-08 18:08 
GeneralRe: Pinning Pointer (System::Array to BYTE[]) Pin
Jeffrey Walton12-Mar-08 19:00
Jeffrey Walton12-Mar-08 19:00 
QuestionCan I reuse C/C++ Code in .Net application? Pin
jamilkhan0079-Mar-08 6:15
jamilkhan0079-Mar-08 6:15 
GeneralRe: Can I reuse C/C++ Code in .Net application? Pin
Giorgi Dalakishvili9-Mar-08 9:26
mentorGiorgi Dalakishvili9-Mar-08 9:26 
GeneralRe: Can I reuse C/C++ Code in .Net application? Pin
Mark Salsbery9-Mar-08 14:25
Mark Salsbery9-Mar-08 14:25 
GeneralRe: Can I reuse C/C++ Code in .Net application? Pin
jamilkhan0079-Mar-08 20:04
jamilkhan0079-Mar-08 20:04 
GeneralRe: Can I reuse C/C++ Code in .Net application? Pin
Mark Salsbery9-Mar-08 21:14
Mark Salsbery9-Mar-08 21:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.