The MSDN documentation for WMPLIB states that syncing to device is not supported in .NET programming, only C++.
Is there, however, a simple wrapper class or DLL that can be used to interface between a .NET program and the nescessary C++ code?
Or is there a better way to sync files to a device using VB.NET? Are all devices suited/compatible with just a simple filesystem.copyfile ?
I don't know of any existing wrapper. Maybe others can help out with that.
Have you tried C++/CLI? You can write a simple C++/CLI project that can interop with C/C++, but its functions are visible from other .NET languages, just like C# or VB.NET. We've had a lot of success wrapping C++ code using C++/CLI, I recommend it.
Related
I recently added lua support in one of my c++ applications. The goal is that my application is the core and the users can access functions from my core using lua.
I have seen that it is possible to have syntax correction and auto completion like visual studio has. And that is exactly what I want to have, too.
How to I implement this feature? The lua file can be written inside a window of my application. Can I connect my c++ function pool with this lua scripting?
Any help on this would be greatly appreciated.
Fabian
Use Scintilla. It's crossplatform and is available as a library for different platforms and frameworks.
As an example, here are few links:
QScintilla for Qt4 and Qt5.
ScintillaNet for Windows Forms applications.
wxWindows has it already, and it's called wxStyledTextCtrl.
Sure, it is possible to use Scintilla even if you are not using any GUI editors and your application is pure code. It's just an external library, and can be either static (part of your binary after compilation) or dynamic (should be bundled with your application).
I'm currently working on a project in .NET that communicates with native C++ libraries through the use of a C++/CLI project. However, moving forward with this project, I would like to be able to expose specific modules of the native C++ code, preferably with as little extra implementation as possible, while maintaining re-usability and scalability.
I've done some research into both uses, but cannot work out which would be better for solving this purpose. Could someone explain which approach is best suited to this scenario, if any?
If you want to wrap native C++ code for .NET, use C++/CLI. For simple C-style API it is possible to use PInvoke.
If you want to wrap native C++ code both for .NET and COM clients (like Internet Explorer, MS Office, scripting languages etc.), use COM.
To my opinion, writing COM wrapper is more complicated task. But COM guru can have another opinion - it depends on your experience in these technologies.
Considering Simon Mourier's answer to this question:
Processing Microsoft Office Outlook 2003/2007 email messages…
I plan to use the PST File Format SDK which is written in C++.
I would take this opportunity to learn more about C++ and to renew with it, since it's been quite 15 years since the last time I used it. I have already downloaded and configured Boost 1.45 which is required to work with pstsdk.
Now, I'm currently writing a Windows Forms application using CLR C++ and plan to use the pstsdk to read from PST files.
Does it matter in any way that I'm using both CLR C++ and pure C++ altogether?
Shall I consider using it a different way, or is this okay?
If you want to use a .NET (Windows Forms, or maybe even the newer WPF) user interface, the simplest approach is to build an object model in C++/CLI, implemented in terms of the native code but having a .NET interface.
Then write the UI in C# and call the C++/CLI object model (which differs from using the .NET base class library in only one way -- you have to add a reference to the C++/CLI assembly... but the C++/CLI compiler will create all the metadata that C# uses).
You can mix managed and unmanaged code, but it will be a pain to marshal everything except the built-in types across the boundaries. It's much easier to stay with more powerful unmanaged C++. You could use CodeGear C++ Builder for example (or QT). The problem with CodeGear is compiler isn't that great, so you won't be able to compile everything from Boost, but you might not need that.
C++/CLI is intended to interop with unmanaged C++- that's pretty much it's entire purpose. However, I feel that it's probably easier to write in C# if you need .NET for, say, WPF, which is an excellent technology, and just use C++/CLI for interop.
I was reading a little into Visual Basic and it seemed a rather simple way to implement some GUI...So I was looking for a way to interface my C++ code to a Visual Basic snippet of code. For example, receive input from a Visual Basic app and send it over to C++ code to continue the logic of the program based on the input of that event.
If you are talking about VB6 then the normal way is to create COM objects in C++ and use them from VB6, however I think in the long run you would benefit from - presuming Windows/Microsoft is your platform of choice - going over to .NET. You could convert your C++ code to C++/CLI and use VB.NET or better C# as GUI language. (caveat: You may also then come to like C# so much that you write the whole app in C# in the end).
You have some options :
You could create a Visual Basic GUI and create some Dynamic link libraries (DLL) for your C++ code. In order to call the C++ code, you would have to put the necessary measures so that your GUI can communicate with the C++ code.
You can drop the idea of using Visual Basic and use C++ with a cross-platform library such as Qt.
You can drop the idea of using Visual Basic and use C++ with MFC.
Are their any libraries which provide functionality similar to mono but for the c++ language? I know boost exists, but I like mono much more than boost.
I'm looking to do more than what's available in the base library set, like play sound more easily (crossplatform), GUI, load images, time, etc. I guess I am looking for what people might consider an engine or a large library.
Mono is a .NET implementation. Mono is NOT a library.
There is NO Mono for C++. At least, not yet.
I think you want a multi-platform framework, such as Qt
If you're wanting to work with Managed C++ a la .Net, then you would just use Mono. They have a page describing how to go about it. The only catch is that you have to compile on Windows, as there is not yet any flavor of GCC that outputs .Net CLI for C++.
To be honest, though, if you're going to use Mono, you might as well move into C#. It's a much cleaner language, IMO.
CLI is only able to host C++ compiled code on all supported platforms as long as the compiled code only contains CIL not native code.
for more detail visit
http://www.mono-project.com/CPlusPlus
I'm not sure about your precise requirements, but in terms of large multi-purpose packages: Qt has been mentioned by a few folks. wxWidgets (formerly wxWindows) is another option. GTK is multiplatform.
As you use the word "engine" (often a game-related term), you might be interested in SDL, which has been used by numerous games, professional and amateur alike. SFML is an option. ClanLib is another long-lived library I've heard of, though I'll admit to knowing little about it.
Try the STL collections...Has nothing to do with .NET, but they are a nice collection of collections (lol) and make C++ life easier.
It sounds like what you are really looking for is a C++ framework that offers the kinds of functionality found in the .NET/Mono framework. Qt is a popular choice.
On the topic of C++ interoperability, Mono has recently made some pretty big strides with CXXI.
(From this posting): The short story is that the new CXXI technology allows C#/.NET developers to:
Easily consume existing C++ classes from C# or any other .NET
language
Instantiate C++ objects from C#
Invoke C++ methods in C++ classes from C# code
Invoke C++ inline methods from C# code (provided your library is compiled with -fkeep-inline-functions or that you provide a surrogate
library)
Subclass C++ classes from C#
Override C++ methods with C# methods
Expose instances of C++ classes or mixed C++/C# classes to both C# code and C++ as if they were native code.
CXXI is the result of two summers of work from Google's Summer of Code towards improving the interoperability of Mono with the C++ language.