Click here to Skip to main content
15,895,793 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: difficulty coming up with the right format. Pin
amatecki25-Jul-09 9:17
professionalamatecki25-Jul-09 9:17 
QuestionTo write in Status bar Pin
mikobi22-Jul-09 2:45
mikobi22-Jul-09 2:45 
AnswerRe: To write in Status bar Pin
led mike22-Jul-09 4:25
led mike22-Jul-09 4:25 
Questiondepth first search help.. Pin
neha_rai21-Jul-09 10:34
neha_rai21-Jul-09 10:34 
AnswerRe: depth first search help.. Pin
Adam Roderick J23-Jul-09 0:24
Adam Roderick J23-Jul-09 0:24 
QuestionHow to pass a pointer of data to the managed side on a C++ wrapper Pin
sinosoidal19-Jul-09 23:55
sinosoidal19-Jul-09 23:55 
AnswerRe: How to pass a pointer of data to the managed side on a C++ wrapper Pin
N a v a n e e t h20-Jul-09 15:25
N a v a n e e t h20-Jul-09 15:25 
AnswerRe: How to pass a pointer of data to the managed side on a C++ wrapper Pin
amatecki23-Jul-09 8:39
professionalamatecki23-Jul-09 8:39 
Hi,
You could try something like this:

// CnvBuffLib.h

#pragma once

#include <memory.h>;
#include <string.h>;

using namespace System;

namespace CnvBuffLib
{
    public __gc class ConvertBuffer
    {
        const char __nogc * const _buffer;
        static const int bsize = 256;
        
        public:
        ConvertBuffer()
        : _buffer(new char __nogc [bsize])
        {
        }
        
        ~ConvertBuffer()
        {
            delete [] _buffer;
        }
        
        int GetPacket()
        {
            // sample of source data
            char tmp[] = {'t', 'e', 's', 't'};
            int tmplen = sizeof(tmp);
            
            // clear buffer
            char __nogc * _bp = const_cast<char*>(_buffer);
            _bp = static_cast<char*>(memset(_bp, 0, bsize));

            // copy data to buffer
            memcpy(_bp, tmp, tmplen);
            
            return tmplen;
        }

        // this function copies native buffer to managed buffer (C# side)
        SByte GetData() __gc []
        {
            int rlen = strlen(_buffer);
            if(rlen == 0)
            return 0;
            
            SByte result[] = new SByte[rlen];
            char __pin * presult = &result[0];
            
            memcpy(presult, _buffer, rlen);
            
            return result;
        }
    };
}

QuestionRegarding IWshRuntimeLibrary::IFileSystem Pin
V K 219-Jul-09 22:43
V K 219-Jul-09 22:43 
AnswerRe: Regarding IWshRuntimeLibrary::IFileSystem Pin
lakshman rao13-Jun-20 3:58
lakshman rao13-Jun-20 3:58 
GeneralRe: Regarding IWshRuntimeLibrary::IFileSystem Pin
Richard MacCutchan13-Jun-20 6:28
mveRichard MacCutchan13-Jun-20 6:28 
Questionneed help with "System.Runtime.InteropServices.SEHException" error Pin
UserNameless14-Jul-09 19:36
UserNameless14-Jul-09 19:36 
AnswerRe: need help with "System.Runtime.InteropServices.SEHException" error Pin
Richard Andrew x6414-Jul-09 20:36
professionalRichard Andrew x6414-Jul-09 20:36 
GeneralRe: need help with "System.Runtime.InteropServices.SEHException" error Pin
UserNameless14-Jul-09 20:57
UserNameless14-Jul-09 20:57 
GeneralRe: need help with "System.Runtime.InteropServices.SEHException" error Pin
Richard Andrew x6414-Jul-09 21:22
professionalRichard Andrew x6414-Jul-09 21:22 
GeneralRe: need help with "System.Runtime.InteropServices.SEHException" error Pin
UserNameless14-Jul-09 21:26
UserNameless14-Jul-09 21:26 
GeneralRe: need help with "System.Runtime.InteropServices.SEHException" error Pin
Richard Andrew x6414-Jul-09 21:35
professionalRichard Andrew x6414-Jul-09 21:35 
GeneralRe: need help with "System.Runtime.InteropServices.SEHException" error Pin
UserNameless14-Jul-09 21:44
UserNameless14-Jul-09 21:44 
QuestionC++/CLI being used with VB and VC++ Pin
Shadowsoal14-Jul-09 8:45
Shadowsoal14-Jul-09 8:45 
AnswerRe: C++/CLI being used with VB and VC++ Pin
N a v a n e e t h14-Jul-09 16:12
N a v a n e e t h14-Jul-09 16:12 
GeneralRe: C++/CLI being used with VB and VC++ Pin
Shadowsoal15-Jul-09 4:13
Shadowsoal15-Jul-09 4:13 
GeneralRe: C++/CLI being used with VB and VC++ Pin
Shadowsoal15-Jul-09 5:21
Shadowsoal15-Jul-09 5:21 
GeneralRe: C++/CLI being used with VB and VC++ Pin
N a v a n e e t h15-Jul-09 17:49
N a v a n e e t h15-Jul-09 17:49 
GeneralRe: C++/CLI being used with VB and VC++ Pin
Shadowsoal15-Jul-09 17:52
Shadowsoal15-Jul-09 17:52 
GeneralRe: C++/CLI being used with VB and VC++ Pin
N a v a n e e t h15-Jul-09 18:23
N a v a n e e t h15-Jul-09 18:23 

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.