c++-cli

Book about managed c++

Cound anybody recommend me a good book about managed c++? I found some but I'm not sure which one is the best.. thanks ...

Wrapping boost::function with a C++/CLI class event

I'm trying to figure out how to wrap a boost::function member (used as an event callback) of an unmanaged class with a C++/CLI class event. I do not have control over the unmanaged class. All I can do is figure out how to write the C++/CLI class properly. Here's the example unmanaged class: class X { public: boost::function<void ...

How to integrate/mix managed and unmanaged code

Hi there is project already devoloped using unmanaged code. now in a small module to use SQLSMO in C++ i hav used managed code.Now the problem is how to integrate manged code with unmaged code... can any body help me in this regard with small exampe... if u do this u help me a lot Thanks in advance.... ...

How to replace sqlDMO with SQLSMO in c++

Is Managed code is the only way to use sqlsmo. Can ay body help me ...

Unmanaged to Managed options: performance considerations

Preliminary: The caller is a native EXE that exposes a type of "plugin" architecture. It is designed to load a DLL (by name, specified as a command line arg). That DLL must be native, and export a specific function signature. The EXE is C++, which isn't too important since the EXE is a black box (cannot be modified/recompiled). The nativ...

Is AssemblyInfo.cpp necessary?

I want to remove AssemblyInfo.cpp, because of some metadata errors that sometimes come up. Is AssemblyInfo.cpp useful for anything? Or can it be removed without any problem? ...

VC2008, how to turn CLR flag off for individual files in C++/CLI project

This post says that it is possible to turn off the CLR flag for an individual .cpp file. From the post: You can set /CLR on or off in each .cpp file individually. Turn it on for the whole project,. as you have done, then turn it off for the files containing only native (unmanaged) code. When you have the VC++ procject properties dialog ...

How to convert System::IntPtr to char*

Hi can any body tell How to convert System::IntPtr to char* in managed c++ this is my main function int main(void) { String* strMessage = "Hello world"; CManagedClass* pCManagedClass = new CManagedClass();//working pCManagedClass->ShowMessage(strMessage);//working ****above said error here*** char* szMessage =...

"LNK2022: metadata operation failed" driving me insane

I have a big solution with lots of projects, using VS2008 SP1, and at least once a day I encounter the LNK2022 error. If I do a full rebuild of the solution it builds fine, but this is not fun. It happens when a dependent DLL is changed 'insignificantly' (i.e. without changing any methods or classes), and the referencing project is late...

Problems adding a UserControl referencing a C++/CLI wrapper to a unmanaged dll to a form

My UserControl references a C++/CLI wrapper to an unmanaged C++ dll. When I try to add the UserControl to a form, I get a Visual Studio error, which says "Failed to create component 'userControl'", giving a System.IO.FileNotFoundException as the cause. From what I've been able to determine, the problem stems from visual studio not copyi...

Implementing GetEnumerator in C++

In C# i have the following class and it compiles just fine: class CustomItem { } class CustomList : IList<CustomItem> { public CustomItem this[int index] { get { return null; } set { throw new NotImplementedException(); } } public void CopyTo(CustomItem[] array, int arrayIndex) { } ...

Is C++ .NET dying?

I heard somewhere that Microsoft will be focusing their efforts on C# rather than C++ for the .NET platform. I can see signs of this being true because of the GUI designer that was available for C# but not C++. So I would like to know if C++ in .NET is dying and if it will continue to be second to C# in the future. ...

Why does C++ need language modifications to be "managed"?

Why can't a compiler be written that manages what needs to be managed in C++ code (i.e. to make it "CLR compatible")? Maybe with some compromise, like prohibiting void pointers in some situations etc. But all these extra keywords etc. What's the problem that has to be solved by these additions? I have my thoughts about some aspects and...

ClickOnce Deployment for a C++/CLI Project using Visual Studio 2008

How do I publish a C++/CLI Windows Forms project for ClickOnce deployment? The properties window for C++/CLI projects does not include a "Publish" tab (like in the C# projects). ...

C++/CLI Finalizers and Operators

In the following example, I get: error C2300: 'UnmanagedClass' : class does not have a finalizer called '!SmartPointer' If I remove the operator->, this error goes away. Could someone explain why this is happening? // Unmanaged class. class UnmanagedClass { }; public ref class SmartPointer { public: SmartPointer(UnmanagedClass*...

How to convert const char* to char*

Hi can any body tell me how to conver const char* to char*? get_error_from_header(void *ptr, size_t size, size_t nmemb, void *data) { ErrorMsg *error = (ErrorMsg *)data; char* err = strstr((const char *)ptr,"550"); //error cannot convert const char** to char* if(NULL != err) { strncpy(error->data,(char*)ptr,LENGTH_...

How to use foreach in c++ cli in managed code

Hi how to use foreach loop in managed code c++ using vs2003. ...

How to compile a program using .NET Framework compilers at command line.?

Hi i want to compile a c++ program using .NET2.0 compiler. so i navigate to c:\windows\Microsoft.Netframework\2.0.57\ and uses csc compiler to compile. It shows lot of errors. But it compiles csharp file. But in visual studio it compiles. so i think that in visual studio c++ copiler installed i think so. filename test.cpp using name...

How to Mix different compiler versions programs in visualstudio:?

HI our total project had Built on vs2003.earlier they have used SQLDMO in teheir project.Now we have palnned to use SQLSMO instead which must have .NETFRAMEWORK 2.0.But as of my knowledge vs2003 runs under .netframework1.1. Now my question is how to mix these two. my thinking is in my machine i have alresdy .NETFRAMEWORK 2.0 inst...

How to compile using framework libraries?

I have wrriten a managed code for SMO application.How can i comiled it using .NETFRAMEWORK2.0. i dont wnat to use visulastudio due to certain limitataions. how can i do this. can nay body help me in this regard. msbuild.exe TestMsBuild.sln /:t Rebuild /:p configuration=release gives error as TestMsBuild.sln : Solution file error ...