Interop type cannot be embedded

I am creating a web application on the .NET 4.0 framework (beta2) in C#. When I try to use a assembly called “ActiveHomeScriptLib”, I get the following error: Interop type ‘ActiveHomeScriptLib.ActiveHomeClass’ cannot be embedded. Use the applicable interface instead. When I change the framework to version 3.5, I don’t have any errors. What is an … Read more

Writing to output window of Visual Studio

I am trying to write a message to the output window for debugging purposes. I searched for a function like Java’s system.out.println(“”). I tried Debug.Write, Console.Write, and Trace.Write. It does not give an error, but it does not print anything either. “Define DEBUG constant” and “Define TRACE constant” options are checked. Menu Tools → Options … Read more

push_back vs emplace_back

I’m a bit confused regarding the difference between push_back and emplace_back. void emplace_back(Type&& _Val); void push_back(const Type& _Val); void push_back(Type&& _Val); As there is a push_back overload taking a rvalue reference I don’t quite see what the purpose of emplace_back becomes? 7 s 7 In addition to what visitor said : The function void emplace_back(Type&& … Read more

Why does changing 0.1f to 0 slow down performance by 10x?

Why does this bit of code, const float x[16] = { 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6}; const float z[16] = {1.123, 1.234, 1.345, 156.467, 1.578, 1.689, 1.790, 1.812, 1.923, 2.034, 2.145, 2.256, 2.367, 2.478, 2.589, 2.690}; float y[16]; for (int i = 0; i … Read more