|
Hi Mark, thanks for this detailed suggestion. Luc's advice however solved the problem easily and for the time being I'll stick with it. I'll definitely look into your solution if a similar problem happens in the future. Cheers
|
|
|
|
|
Use #include "atlstr.h" or #include "afx.h" header file.
|
|
|
|
|
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?
|
|
|
|
|
hi all
i need to mae a client to server chat .. just like the ivoclize
https://www.ivocalize.com/[^]
this project .. well be baseb on web admin control panels ... and the the web admin will e able to creat , edit , delete rooms and users
the client contains text chat , voice chat , white board , web browser , and power point presentation
this is the room image
any one can help me to creat this ... ? and what it willcoast me ?
http://photos4.hi5.com/0068/804/671/w8Zjnx804671-02.jpg[^]
|
|
|
|
|
Member 3983764 wrote: any one can help me to creat this ... ? and what it willcoast me ?
I can help you for US $75 per hour.
|
|
|
|
|
Hello guys,
I've a big problem with VC++2008. Till now it was working fine, than I created a new project tried to compile it and I get the error message:
fatal error c1902: error in program database manager. check installation.
I didn't change anything within my IDE I just tried to compile a project.
I already tried to reinstall the IDE but this didn't help, I still get this error.
I'll try de-installing VC++2008 and deleting all components, maybe than a reinstallation will work.
At the same time I got this problem with my VC++2005. Same error but I tried to recompile an old project when it occured.
However, my VS2003.NET is still working fine. But I need VC++2008 for a special project.
Does anyone have an idea about this?
Thanks and best wishes,
Manfred
|
|
|
|
|
According to MS and several forums you have to place a file called mspdb80.dll in \WINDOWS\system32\ if this error occurs. I already added this file becuase I needed it in another project. However, there was another version of this file too called mspdb60.dll. I deleted the 80-version and my IDE workes again.
|
|
|
|
|
When I put ultraGrid on my form and I compile the program I have an error:
UltraGrid is not member of Infragistics::Win
And when I Write namespace Infragistics::Win::UltraWinGrid, I have the same error on this line.
What to do so to use Infragistics components in Visual C++ NET 2005
|
|
|
|
|
I'm using CWinFormControl to create instances of .Net UserControls.
CWinFormsControl<myproject::mycontrol xmlns:myproject="#unknown"> m_control;
m_control.CreateManagedControl( WS_CHILD | WS_VISIBLE, rect, this, IDC_HOSTCONTROL );
This works fine. The problem occurs when I try to destroy the control. I need a deterministic call to the 'MyControl' finalizer, so I wrote the following:
m_control.DestroyWindow();
System::GC::Collect();
This code does not cause the Finalize\Dispose code to be called on 'MyControl'. In fact, 'MyControl' sticks around in memory until the MFC app closes. What am I doing wrong here?
Thanks,
Aaron
|
|
|
|
|
astibich2 wrote: I need a deterministic call to the 'MyControl' finalizer
Then why are you using a Garbage Collection system? Ever heard of the word "Contradiction"?
led mike
|
|
|
|
|
Hi
yesterday I was trying to build a program but i had a problem ...!
the problem was that when I put space (" ") in the string, it finishes the string aoutomatically , so what canI do to fix the problem?
notice that i cant use a array of characters in that solution
|
|
|
|
|
sajjy wrote: the problem was that when I put space (" ") in the string, it finishes the string aoutomatically
How? Some sample code would help!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: How?
Probably using the space in his head.
led mike
|
|
|
|
|
Space....the final frontier....
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Space....the final frontier
We kunt do it kaptin, we just dunt have the power!
led mike
|
|
|
|
|
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
sajjy wrote: the problem was that when I put space (" ") in the string, it finishes the string aoutomatically
Huh? As Mark suggested, please provide a snippet of the code that is causing this problem.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi, I am new to CLI-Windows Forms programming and I need to perform this simple task:
1) Allow the user to enter a value in a Text Box (textBox1)
2) Assign such value to a variable of type double (variable1)
[I am having difficulties casting the string to double]
3) Perform computations on that variable
[I should be able to do this once it's a double]
4) Display the resulting value in another Text Box (textBox2)
Can someone be so kind to help me with the correct syntax I should use for each step?
Many thanks.
|
|
|
|
|
|
Thanks for the advice, it works. But I obviously get a crash when I leave the text box empty or I enter a non numerical value.
Here is the code I use to assign the value entered in the text box (as string) to a type double variable:
//
variable1 = double::Parse(textBox1->Text);
//
How can I solve this? Thanks!
|
|
|
|
|
J_E_D_I wrote: But I obviously get a crash when I leave the text box empty or I enter a non numerical value.
Use TryParse().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have tried:
//
double number;
variable1 = double::TryParse(textBox1->Text, number);
//
With the code above it's better and the program does not crash anymore.
However the problem is not completely solved because when I leave the text box empty or enter a character different from a number, the result of variable1 is zero, which causes an error in the calculation that follows.
How can I show an "Error" message when this has happened?
Alternatively, is there any way that I could make the textBox accept only numerical values and display an error in the other cases?
|
|
|
|
|
TryParse returns a bool.
double variable1;
if (double::TryParse(textBox1->Text, variable1))
{
}
else
{
}
Did your Visual Studio not come with MSDN library?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
This is a fantastic answer! Thank you so much, it solved the problem.
Mark Salsbery wrote: Did your Visual Studio not come with MSDN library?
Probably you guys super expert programmers manage to find what you are looking for in MSDN. I program in my spare time just for fun and I do not find them helpful AT ALL!! They seriously lack of simple examples for beginners like me and they take too much for granted. Regarding TryParse there was no specific example for c++.
Cheers!
|
|
|
|
|
J_E_D_I wrote: there was no specific example for c++
Hint: Use the C# examples. For most examples of using .NET framework classes, the only
difference will be
'->' in c++ instead of '.' in c#
gcnew in c++ instead of new in c#.
Cheers!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|