How can I import a VS2005 DLL in Borland C++ Builder?
We have an VS2005 DLL with many legacy code that will not be easily compiled in C++ Builder, and we have a client using Borland C++.
There is any way to build this DLL using OMF format?
Related
I have recently installed VS2015. Yay! \o/
However, one of my C++/CLI projects showed this message when upgrading from VS2013:
The following project(s) uses an earlier version of the Visual C++ compiler and libraries. The project(s) will be upgraded to use the Microsoft Visual Studio 2015 compiler and libraries. Any managed or native code project(s) using C++/CLI extensions will be automatically upgraded to target .NET Framework 4.5.2. Note: If you do not upgrade the project(s), building your project(s) will require the corresponding version of Visual Studio to be installed.
I ok'd the warning, but now code which compiled previously in VS2013 no longer compiles, for instance:
void WritePixels(array<unsigned int> ^ rgbaData);
has the error
'std::array': too few template arguments
'^': cannot use this indirection on type 'std::array'
Also the project properties do not allow me to switch target .NET framework version (it is grayed out).
Is it possible for C++/CLI projects to target .NET 4.0 using Visual Studio 2015? Are there any syntax changes in C++/CLI since Visual Studio 2013 that I need to know about?
Just an update for posterities sake.
I solved this by workaround, by not using C++/CLI at all, but using the amazing, adaptable SWIG Platform Invoke Generator library.
No C++/CLI = no issues with .NET Framework versions, no issues with x64/86 bit and .NET Any CPU.
Problem Solved ...
does anyone know how I could make a number of separate assemblies out of my 50+ Unity3D scripts? My scripts are all written in JScript.Net and compiled by Unity using relatively old Mono compiler tools (v2.0 I believe).
I am a .net developer who has never touched c++. I don't want to either :)
Unfortunately, I have to work with c++ module in .net 4.0 and I am clueless.
Is there a tool that can generate a .net assembly for a given c++ module?
If not, what are my next steps to successfully call these c++ libraries?
There are many ways:
COM Interop
Tlbimp.exe (Type Library Importer)
How to: Generate Primary Interop Assemblies Using Tlbimp.exe
The Type Library Importer converts the type definitions found within a COM type library into equivalent definitions in a common language runtime assembly.
PInvoke/DllImport
Calling Native Functions from Managed Code
The common language runtime provides Platform Invocation Services, or PInvoke, that enables managed code to call C-style functions in native dynamic-linked libraries (DLLs). The same data marshaling is used as for COM interoperability with the runtime and for the "It Just Works," or IJW, mechanism.
C++/CLI
Mixed (Native and Managed) Assemblies
How To: Migrate to /clr
This is more advanced because it will most probably require the C++ module to be updated and re-compiled.
Mixed assemblies are capable of containing both unmanaged machine instructions and MSIL instructions. This allows them to call and be called by .NET components, while retaining compatibility with components that are entirely unmanaged. Using mixed assemblies, developers can author applications using a mixture of managed and unmanaged functionality. This makes mixed assemblies ideal for migrating existing Visual C++ applications to the .NET Platform.
Say,if the .dll or .lib is written in C,can it be used by other languages like PHP/Python?
A DLL is binary. As long as your language can consume a binary library (with the OS the binary was compiled for), you should be okay (see exceptions below). LIB files are for the compiler so you'll only be able to use those by C/C++ languages at compile time.
The exception to this is .NET and COM. .NET generates special assembly DLLs to be used by other .NET languages (C#, VB.NET, C++/CLI, IronPython, etc). COM generates special DLLs as well where components (specialized classes) are exposed through the DLL. Natively, C++ and VB6 support COM. .NET languages can access COM DLLs through an interop. Many other languages also support COM bindings by various means.
Go here for a discussion on this topic and more details about the differences.
i want comile a my c++ program using .NETFRAMEWORK libraries only at command prompt.how can i do this ??
Download the free Visual C++ Express tools from Microsoft and use the C++/CLI language (based on C++ but allows access to the whole .Net Framework) and go from there.
Basically, you're talking about Visual C++. As for using the command prompt, once you have a working program you should just be able to use something like:
cl MyProgram.cs /clr
with any other relevant options, and be up and running. If that doesn't help, give a more specific question.