Click here to Skip to main content
14,693,912 members
Home » Discussions » Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Is it possible to create something invisible to a human eye Pin
MCSIDevelopers19-Aug-16 2:43
MemberMCSIDevelopers19-Aug-16 2:43 
GeneralRe: Is it possible to create something invisible to a human eye Pin
Richard MacCutchan19-Aug-16 2:57
mveRichard MacCutchan19-Aug-16 2:57 
GeneralRe: Is it possible to create something invisible to a human eye Pin
MCSIDevelopers20-Aug-16 13:46
MemberMCSIDevelopers20-Aug-16 13:46 
GeneralRe: Is it possible to create something invisible to a human eye Pin
Richard MacCutchan20-Aug-16 21:41
mveRichard MacCutchan20-Aug-16 21:41 
QuestionString concatenation using operator overloading Pin
kinderu4-Aug-16 1:32
Memberkinderu4-Aug-16 1:32 
QuestionRe: String concatenation using operator overloading Pin
Richard MacCutchan4-Aug-16 2:17
mveRichard MacCutchan4-Aug-16 2:17 
AnswerRe: String concatenation using operator overloading Pin
KarstenK29-Nov-16 6:58
mveKarstenK29-Nov-16 6:58 
QuestionNeed help with managed C++ dll so unmanaged C++ program can use third party c# dll Pin
garyflet18-Jul-16 11:46
Membergaryflet18-Jul-16 11:46 
Using Windows 7 and VS 2010 (soon 2015).
I’m writing a C++ managed code dll (managed.dll)which will be an intermediary between our unmanaged C++ code (program.exe) and a third party C# driver dll (tcbDriver.dll).
I don’t have access to the code for tcbDriver.dll. However, in the following example of managed.dll code, I use a TcbDriver class which accesses the tcbDriver.dll. So program.exe calls "__declspec(dllexport) int ConnectTCB()" in managed.dll, which in turns calls Connect() in tcbDriver.dll.
It works.
The problem is, I don’t know how get the managed.dll code to preserve the same instance of "work" or "tcb" for other methods that program.exe will call.
For example, in this case tcbDriver.dll will eventually make tcb.Initialized equal to "true", indicating it is done initializing the hardware.
However, managed.dll needs to use the same instance of "work" or "tcb" in another exposed function that it used to call Connect().
The exposed function "__declspec(dllexport) bool IsInitialized()" makes a new instance, so tcbDriver.dll doesn't ever make tcb.Initialized equal to "true", even after TcbDriver is done initializing.
namespace ManagedTCB 
{          
  public ref class DoWork
  {
       TcbDriver::TCB tcb;          
        public:int ConnectTCB()
       {                                              
           try
           {
                tcb.Connect();
           }
               catch(...)
           {
                return 0;
           }
           return 1;
       }
       public:bool IsInitialized()
       {    
            return tcb.Initialized;
       }
  };
}


__declspec(dllexport) int ConnectTCB()
{
    ManagedTCB::DoWork work;     
    return work.ConnectTCB();         
}
__declspec(dllexport) bool IsInitialized()
{
    ManagedTCB::DoWork work;     
    return work.IsInitialized();           
}

How do I use the same instance of the tcb class in different exported functions? Thanks for any help,
Gary
AnswerRe: Need help with managed C++ dll so unmanaged C++ program can use third party c# dll Pin
garyflet19-Jul-16 6:58
Membergaryflet19-Jul-16 6:58 
QuestionInheritance classes Pin
kinderu16-Jul-16 11:10
Memberkinderu16-Jul-16 11:10 
AnswerRe: Inheritance classes Pin
Richard MacCutchan16-Jul-16 22:18
mveRichard MacCutchan16-Jul-16 22:18 
Questionextract audio from video Pin
Member 1223658412-Jul-16 3:38
MemberMember 1223658412-Jul-16 3:38 
AnswerRe: extract audio from video Pin
Richard MacCutchan12-Jul-16 6:28
mveRichard MacCutchan12-Jul-16 6:28 
QuestionIn Microsoft Visual C++ how to use sub threads to achieve similar CListCtrl ? Pin
zhaoshan313@163.com29-Jun-16 4:50
Memberzhaoshan313@163.com29-Jun-16 4:50 
QuestionI need the quick response on the AES code in C++ Pin
Member 1221638017-Jun-16 6:56
MemberMember 1221638017-Jun-16 6:56 
Rant[REPOST] I need the quick response on the AES code in C++ Pin
Richard Deeming17-Jun-16 13:39
mveRichard Deeming17-Jun-16 13:39 
GeneralRe: [REPOST] I need the quick response on the AES code in C++ Pin
Member 1221638018-Jun-16 22:38
MemberMember 1221638018-Jun-16 22:38 
GeneralRe: [REPOST] I need the quick response on the AES code in C++ Pin
Richard MacCutchan19-Jun-16 22:36
mveRichard MacCutchan19-Jun-16 22:36 
GeneralRe: [REPOST] I need the quick response on the AES code in C++ Pin
Member 122163806-Jul-16 4:40
MemberMember 122163806-Jul-16 4:40 
GeneralRe: [REPOST] I need the quick response on the AES code in C++ Pin
Richard MacCutchan6-Jul-16 5:00
mveRichard MacCutchan6-Jul-16 5:00 
AnswerRe: I need the quick response on the AES code in C++ Pin
Taiming J5-Sep-16 0:11
MemberTaiming J5-Sep-16 0:11 
QuestionAES code implementation in C++ Pin
Member 122163806-Jun-16 2:56
MemberMember 122163806-Jun-16 2:56 
AnswerRe: AES code implementation in C++ Pin
Jochen Arndt6-Jun-16 3:10
professionalJochen Arndt6-Jun-16 3:10 
GeneralRe: AES code implementation in C++ Pin
Member 122163806-Jun-16 3:33
MemberMember 122163806-Jun-16 3:33 
GeneralRe: AES code implementation in C++ Pin
Jochen Arndt6-Jun-16 3:42
professionalJochen Arndt6-Jun-16 3:42 

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.