Is there any way to convert C++ program into ASP.NET? - asp.net

Is there any way to convert C++ program into ASP.NET?

No there is not.
You have some options though:
You can create a managed C++ / CLI DLL from your C++ code.
You can create a C++ Win32 DLL and use p/invoke to import the DLL functions into your ASP.NET page.
Re-write your code in C# or another .Net language.

No this is not at all possible. It's like converting an apple to a television.

Related

Are .ui files from qt compatible with both python and c++?

I have been working with QT UIs and python for a while now. I have been wondering, if the .ui files that are generated when using the qt-creator or qt-designer are compatible with both python and c++? I mean it is just some simple xml syntax right?
Yes, both are simple xmls. The differences could be generated in the tools that convert that xml to C++ or Python (uic for C++ and currently for PySide2, pyuic for PyQt5) since that code interprets the attributes.
So the answer, that I was looking for: Yes .ui files are compatible. They are simple xml syntax files and simply contain the structure of your designed user interface.
Depending on your programming lagnuage, the xml file is parsed, so that you can use it.

How to generate compile_commands.json with QT project?

I'm not familiar with QT but have to work with a QT project(.pro) recently. I hope to generate a compile_commands.json for this project, so I can read codes inside emacs's lsp mode. Unfortunately, I cannot find any way.
Build/Generate Compilation Database for "yourprojectname"

System.Data.SQLite in UNMANAGED C++

I want to use SQLite as a database for my C++ project. I also need the ability to password protect the database. I got the standard SQLite from SQLite.org working - but I need to password/encrypt the database and they don't do that - they just stub the interface for it to be done with
SQLITE_API int sqlite3_key( sqlite3 *db, const void *pKey, int nKey);
After researching on the web how to do this, I came across System.Data.SQLite. It claims to do all I need quite easily, but I need to do it from unmanaged C++ project in Visual Studio 2008. I tried their project - but I can't get my unmanaged C++ project to allow the DLL to work - it squawks about dll not being safe/clr:safe compile - which I can't set in the System.Data.SQLite project and compile.
Can anyone help me with this or point me to a good resource on how to do this? I have been thrown into a C++ project (hadn't touched C/C++ since college (97-98), so I am really struggling with this when it comes to the linker/libs/modules. Java and .NET have spoiled me!
Thanks,
Mike
You can't use a managed DLL from unmanaged code like that, they're different systems. Just use the normal unmanaged SQLite build and read the docs on how to use keys.
Recently, I've faced a similar problem like Mike and resolved it.
I would like to post my solution here in case anyone need.
I have two programs:
One is in C# to create encrypted sqlite database files using System.Data.SQLite.
The other one is in C++ to read the file created by the C# program.
After googling with no result, I looked at source code of System.Data.SQLite to figured out how System.Data.SQLite encrypts a database file.
I recognized that System.Data.SQLite uses SQLite.Interop.dll wrapping native sqlite with additional features such as encryption.
Therefore I used that native source code to build a static library. Then I use the library to read the encrypted database files.
You can find the source code at the following link:
https://github.com/OpenDataSpace/System.Data.SQLite/tree/master/SQLite.Interop/src
Update 2020/04/11
You can find a step by step guide at the following link:
https://wordpress.com/post/nguyenduyanhsite.wordpress.com/71

Play sound file on Qt+Mac

I need to play sounds under Qt with control of volume and panning. QSound doesn't do it, phonon may be too much for only this so I thought I'd try the native api.
eeermm, in Mac I have no idea, is there some simple interface to invoke on c++? (I've seen all this NSSound stuff but I am not familar with Objective C and I am not sure if it's possible to mix code (under QtCreator)) my idea would be to a module with simple native api calls to system features not found on Qt.
Thanks!
Qt AudioEngine in Qt5 will do this.
If you're using Qt4, making a single 'Objective-C++' file (extension .mm) which can be called from Qt, but makes NSFoo calls, is easy and works well. The header file should be plain C++, and everything will work together.

Compiling code directly into MSIL

Is there a way to complie code directly into Native Code instead of MSIL so that we can bypass JIT while executing the code on machine. If its possible. Please let me know the technique also.
Thanks
Compiling MSIL to Native Code Ngen.exe
SUMMARY:
The runtime supplies another mode of
compilation called install-time code
generation. The install-time code
generation mode converts MSIL to
native code just as the regular JIT
compiler does, but it converts larger
units of code at a time, storing the
resulting native code for use when the
assembly is subsequently loaded and
run. When using install-time code
generation, the entire assembly that
is being installed is converted into
native code, taking into account what
is known about other assemblies that
are already installed.
Take look at - How to compile a .NET application to native code?
In the .NET languages I'm familiar with, the source is compiled directly to MSIL. What the JIT does is subsequently compile the IL code to native code.

Resources