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

Managed C++/CLI

 
GeneralRe: Getting HDD serial No in C++/CLI environment Pin
J_E_D_I7-Dec-08 19:21
J_E_D_I7-Dec-08 19:21 
GeneralRe: Getting HDD serial No in C++/CLI environment Pin
Luc Pattyn7-Dec-08 23:06
sitebuilderLuc Pattyn7-Dec-08 23:06 
QuestionRe: Creating Registry Key Values in C++/CLI environment Pin
J_E_D_I13-Dec-08 7:56
J_E_D_I13-Dec-08 7:56 
GeneralRe: Creating Registry Key Values in C++/CLI environment Pin
Luc Pattyn13-Dec-08 8:26
sitebuilderLuc Pattyn13-Dec-08 8:26 
GeneralRe: Getting HDD serial No in C++/CLI environment Pin
Mark Salsbery7-Dec-08 6:12
Mark Salsbery7-Dec-08 6:12 
GeneralRe: Getting HDD serial No in C++/CLI environment Pin
J_E_D_I7-Dec-08 19:24
J_E_D_I7-Dec-08 19:24 
AnswerRe: Getting HDD serial No in C++/CLI environment Pin
adi099016-Apr-11 0:27
adi099016-Apr-11 0:27 
QuestionUnmanged library printing to debug and then killing application Pin
coder2555-Dec-08 18:59
coder2555-Dec-08 18:59 
I am using an unmanaged library made by Valve in a wrapper.

When this line of code executes:

if ( fileSystem->Init() != INIT_OK ) throw gcnew Exception(fileSystemDllName + " IFileSystem::Init failed.");

No exception is thrown. Instead the function prints this message to the debug output:

SteamStartup() failed: SteamStartup(0xf,0x06C9EAA0) failed with error 1: failed to take master pipe connection lock

Immediately after, the main thread exits. I KNOW why this is happening and I know how to fix it. That is not my question. What I need to know is how I can get my wrapper DLL to trap debug output, and at least put up a message box repeating the error, such as the one above.

I made a new class - .h and .cpp combined for brevity:

ref class SteamDebugListener : public System::Diagnostics::TraceListener
{
public:
    SteamDebugListener(void)
    {
    }

    virtual void Write(String^ Message) override
    {
        if (message->Contains("Steam") && message->Contains("error"))
        {
            MessageBox::Show(message->Trim());
        }
    }

    virtual void WriteLine(String^ Message) override
    {
        if (message->Contains("Steam") && message->Contains("error"))
        {
            MessageBox::Show(message->Trim());
        }
    }
};


And added this:
SteamDebugListener^ errorCatch = gcnew SteamDebugListener();
System::Diagnostics::Debug::Listeners->Add(errorCatch);
System::Diagnostics::Trace::Listeners->Add(errorCatch);

before the failing call, and set a breakpoint in the Write function, but it is not being called. What is the correct way to do all this?
Questioni need client to server chat Pin
Member 39837645-Dec-08 6:35
Member 39837645-Dec-08 6:35 
AnswerRe: i need client to server chat Pin
Richard Andrew x6413-Dec-08 10:36
professionalRichard Andrew x6413-Dec-08 10:36 
QuestionFatal error C1902 Pin
Manfr3d3-Dec-08 12:51
Manfr3d3-Dec-08 12:51 
AnswerRe: Fatal error C1902 Pin
Manfr3d4-Dec-08 11:32
Manfr3d4-Dec-08 11:32 
QuestionInfragistics ultraGrid Pin
mikobi3-Dec-08 2:44
mikobi3-Dec-08 2:44 
QuestionDestroying controls created by CWinFormControl Pin
astibich230-Nov-08 11:43
astibich230-Nov-08 11:43 
QuestionRe: Destroying controls created by CWinFormControl Pin
led mike1-Dec-08 5:17
led mike1-Dec-08 5:17 
Questionspace in a string ! Pin
sajjy30-Nov-08 10:19
sajjy30-Nov-08 10:19 
AnswerRe: space in a string ! Pin
Mark Salsbery30-Nov-08 14:31
Mark Salsbery30-Nov-08 14:31 
GeneralRe: space in a string ! Pin
led mike2-Dec-08 4:31
led mike2-Dec-08 4:31 
GeneralRe: space in a string ! Pin
Mark Salsbery2-Dec-08 6:16
Mark Salsbery2-Dec-08 6:16 
GeneralRe: space in a string ! Pin
led mike2-Dec-08 6:49
led mike2-Dec-08 6:49 
GeneralRe: space in a string ! Pin
Paul Conrad2-Dec-08 6:57
professionalPaul Conrad2-Dec-08 6:57 
AnswerRe: space in a string ! Pin
Paul Conrad30-Nov-08 18:00
professionalPaul Conrad30-Nov-08 18:00 
QuestionTextBox: Conversion from String to Double Pin
J_E_D_I25-Nov-08 9:31
J_E_D_I25-Nov-08 9:31 
AnswerRe: TextBox: Conversion from String to Double Pin
Mark Salsbery25-Nov-08 11:51
Mark Salsbery25-Nov-08 11:51 
GeneralRe: TextBox: Conversion from String to Double Pin
J_E_D_I26-Nov-08 2:00
J_E_D_I26-Nov-08 2:00 

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.