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

Managed C++/CLI

 
GeneralRe: Working with date_t and time_t Pin
for study24-Sep-16 0:11
for study24-Sep-16 0:11 
GeneralRe: Working with date_t and time_t Pin
Richard MacCutchan24-Sep-16 0:29
mveRichard MacCutchan24-Sep-16 0:29 
GeneralRe: Working with date_t and time_t Pin
for study24-Sep-16 0:37
for study24-Sep-16 0:37 
GeneralRe: Working with date_t and time_t Pin
Richard MacCutchan24-Sep-16 0:48
mveRichard MacCutchan24-Sep-16 0:48 
GeneralRe: Working with date_t and time_t Pin
for study25-Sep-16 19:18
for study25-Sep-16 19:18 
QuestionAdding gtkmm lib to visual studio 2015 Pin
Osikwemen12-Sep-16 23:04
Osikwemen12-Sep-16 23:04 
AnswerRe: Adding gtkmm lib to visual studio 2015 Pin
Alexandre Bencz23-Sep-16 8:53
Alexandre Bencz23-Sep-16 8:53 
QuestionMFC CDialogBar drawing issue on High DPI screen Pin
Taiming J4-Sep-16 23:06
Taiming J4-Sep-16 23:06 
NewsMicrosoft wants to hear about issues C++/CLI devs are having Pin
John Schroedl23-Aug-16 8:28
professionalJohn Schroedl23-Aug-16 8:28 
SuggestionRe: Microsoft wants to hear about issues C++/CLI devs are having Pin
Richard Deeming23-Aug-16 8:31
mveRichard Deeming23-Aug-16 8:31 
GeneralRe: Microsoft wants to hear about issues C++/CLI devs are having Pin
John Schroedl23-Aug-16 8:34
professionalJohn Schroedl23-Aug-16 8:34 
GeneralRe: Microsoft wants to hear about issues C++/CLI devs are having Pin
Richard Deeming23-Aug-16 8:50
mveRichard Deeming23-Aug-16 8:50 
Questionpin_ptr versus interior_ptr Pin
John Schroedl23-Aug-16 8:04
professionalJohn Schroedl23-Aug-16 8:04 
AnswerRe: pin_ptr versus interior_ptr Pin
Jon McKee31-Oct-16 16:29
professionalJon McKee31-Oct-16 16:29 
GeneralRe: pin_ptr versus interior_ptr Pin
John Schroedl1-Nov-16 1:58
professionalJohn Schroedl1-Nov-16 1:58 
QuestionIs it possible to create something invisible to a human eye Pin
MCSIDevelopers18-Aug-16 10:39
MCSIDevelopers18-Aug-16 10:39 
AnswerRe: Is it possible to create something invisible to a human eye Pin
Richard MacCutchan18-Aug-16 22:29
mveRichard MacCutchan18-Aug-16 22:29 
GeneralRe: Is it possible to create something invisible to a human eye Pin
MCSIDevelopers19-Aug-16 1:43
MCSIDevelopers19-Aug-16 1:43 
GeneralRe: Is it possible to create something invisible to a human eye Pin
Richard MacCutchan19-Aug-16 1:57
mveRichard MacCutchan19-Aug-16 1:57 
GeneralRe: Is it possible to create something invisible to a human eye Pin
MCSIDevelopers20-Aug-16 12:46
MCSIDevelopers20-Aug-16 12:46 
GeneralRe: Is it possible to create something invisible to a human eye Pin
Richard MacCutchan20-Aug-16 20:41
mveRichard MacCutchan20-Aug-16 20:41 
QuestionString concatenation using operator overloading Pin
kinderu4-Aug-16 0:32
kinderu4-Aug-16 0:32 
QuestionRe: String concatenation using operator overloading Pin
Richard MacCutchan4-Aug-16 1:17
mveRichard MacCutchan4-Aug-16 1:17 
AnswerRe: String concatenation using operator overloading Pin
KarstenK29-Nov-16 5:58
mveKarstenK29-Nov-16 5:58 
QuestionNeed help with managed C++ dll so unmanaged C++ program can use third party c# dll Pin
garyflet18-Jul-16 10:46
garyflet18-Jul-16 10: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.
C#
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

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.