I'm trying to set up unit testing with code coverage in VS2008, for a C++/CLI DLL which is compiled with /clr (not /clr:safe or /clr:pure - it has to be /clr because it uses MFC).
The unit tests work perfectly but the coverage information only works if I compile with /clr:safe or /clr:pure. For /clr the Code Coverage Results window show...
C++/CLI is very powerful language. It's the only CLR language where you can seamlessly combine managed and unmanaged code. How many software developers (on this site) are using this language? In what kind of projects do you use it? Is it an adapting of legacy code or creation of an original software? Can you compare old Managed C++ wit...
I've read somewhere on MSDN that the equivalent to C#'s "is" keyword would be dynamic_cast, but that's not really equivalent: It doesn't work with value types or with generic parameters. For example in C# I can write:
void MyGenericFunction<T>()
{
object x = ...
if (x is T)
...;
}
If I try the "equivalent" C++/CLI:
ge...
I have two projects in a solution, one is a C# library and the other is a C++/CLI library.
I have added a reference in the C++/CLI project using the references menu to the c# library. I then add the
#using <assembly.name.dll>
and try to reference the assembly with
using namespace namspace.subnamespace;
But i get the error that t...
Hi,
I have a C++/CLI class library project in VS2005 that i am having some problems with. I have defined a class called Languages which is a an enum class. which looks like this:
"Language.cpp"
namespace Company
{
namespace product
{
public eunm class Languages : int
{
English = 1,
German...
In C#, you can decorate function return values with attributes, as follows:
[return: MarshalAs(UnmanagedType.IUnknown)]
object LoadStuff();
My question is, how can I do this in C++/CLI? I have this:
[return: MarshalAs(UnmanagedType::IUnknown)]
Object^ LoadStuff();
but the compiler is erroring with 'return' : unknown attribute quali...
Hi
i am usnig visual studio2003 and windows platform sdk2008. ihave to migrate from SQLDMO to SQLSMO in c++. do i need any header files for this to use sqlsmo in c++.
can any body help me in this regard.
Thanks in advance.
...
How do I make use of the .NET framework namespaces from C++?
...
Folks,
I just created my first C++/CLI project (Visual Studio 2008), it's a Library to allow my C# app access an point of sale tally printer.
My library builds well and trivial functions work when called from a C# exe.
However as soon as I include a WinGDI call (DeleteObject in this case), the linker complains with “unresolved token” ...
When I use a GUI in C++ the text fields are stored as managed strings, i think. I need a way to convert them to standard ints, floats and strings. Any help?
...
public __gc class test :public MarshalByValueComponent,IListSource,ISupportInitialize,ISerializable
can any one help me plz....
...
Hi i am creating a Datatable in C++ as follows
when i try to create the instance i am getting a compile time error as cannot creating instance for abstract class. here i am not usng any abstract keyword.
#include "stdio.h"
#include "conio.h"
#using <mscorlib.dll>
using namespace System::Data;
using namespace System::ComponentModel;
usi...
Hi
i want to implement IListSource interface from c++. It contains 1 method GetList() and one property called ContainsListCollection.
How can i do this.how to set the property to false/true in c++
...
Hi in the second line while trying to convert from object to String array it shows compile time error as
'System::String ^' : a native array cannot contain this managed type
'initializing' : cannot convert from 'System::String ^' to 'System::String ^[]'
code:
RegistryKey ^rk = Registry::LocalMachine->OpenSubKey("SOFTWARE\\Micros...
Hi
i am trying to findout the location of where SQLSERVER datafiles(mdf) logfiles(ldf) installed using SMO.
How to do this. i Need to find for both for named instance and default instance and for sqlexpress also
can any body help me inthis regard....
Thanks in advance.
...
Hi
Microsoft provided some header files for c++ to work with DMO.
Likewise to work with SQLSMO in c++ is such type of any header files are provided???
using managed c++ code is the only way to work with SMO in c++??
Plz Help me....
...
I have a C++ DLL (no code) that I want to expose to .NET applications.
After pondering all the options I have/know of/could find (COM, P/Invoke, SWIG, etc.), I'm writing a .NET Class Library (in C++/CLI). Now the resulting DLL (class library) requires the original DLL and its dependencies, too. My problem lies in automagically keeping t...
I have a native C DLL being invoked by a C++/CLI object which is the ViewModel for a WPF progam in C#. I want to set breakpoints in the C DLL. When I try to set them they are grayed out and the help balloon says the breakpoint will not currently be hit. No symbols have been loaded for this document.
To get the program to run OK I had to...
Hi how to add data to the datatable which has 5columns.
...
I've written a custom control (an immediate child of Forms.Control) in C++/CLI that will offload most of its processing and all of its painting to a separate legacy-ish MFC control. I'm wrapping this control in a C# application. I need to be able to drag items onto the C++/CLI control from a UserControl on the same form in the applicat...