Is it possible to combine Pascal with Visual Basic? At least I would like to read a variable from one language in the other.There are multiple ways you can achieve this:
Is it possible to combine Pascal with Visual Basic? At least I would like to read a variable from one language in the other.There are multiple ways you can achieve this:I tested neither of these, so you'll have to find the best approach yourself.
- Use two processes and communicate between them using an IPC mechanism (for example pipes)
- Put your Pascal code into a library and P/Invoke that from your VB code
- Decorate your VB classes as ComVisible and import them as a type library in your Pascal code (you might want to check JclDotNet (https://github.com/project-jedi/jcl/blob/master/jcl/source/windows/JclDotNet.pas) for this, though I don't know how FPC compatible it is)
- Host (https://code.msdn.microsoft.com/CppHostCLR-e6581ee0) the .NET runtime in your Pascal code
Afaik .NET assemblies, while having .DLL extension are not compatible with normal win32 DLLs, so no.
Afaik .NET assemblies, while having .DLL extension are not compatible with normal win32 DLLs, so no.
There are different types of libraries like Framework, Universal, etc... Supposedly there's a type of library that works cross-platform
Afaik .NET assemblies, while having .DLL extension are not compatible with normal win32 DLLs, so no.
There are different types of libraries like Framework, Universal, etc... Supposedly there's a type of library that works cross-platform
Much what I know of .NET is from 2005 when I briefly had a .NET job, but it looks like all variants of .NET, except "Windows universal" which are Windows 10 Apps, which is native but afaik com based (?), but anyway, the missing is the one that you need, Winapi apps aka win32/win64.
So no, those links don't help at all. It only shows .NET fragmentation.
You really need to research Sven's recommendations.
Again, a vb.net "dll" and a FPC ".dll" are not the same, even though they have the same extension.
Again, a vb.net "dll" and a FPC ".dll" are not the same, even though they have the same extension.
Sure. But then again, that is why I am asking about interop. I'm just considering that in the end every code becomes 1011.. and maybe I can find a way to exchange data between two processes which use different languages. I'm also thinking about how other programs written in Delphi access and communicate with C++ programs, even though most of them are "hacks". About the Winapi thing that you mentioned, I am under the impression that I have seen it in vb6 code. Could you explain it a bit more?
Is it possible to combine Pascal with Visual Basic? At least I would like to read a variable from one language in the other.
Is it possible to combine Pascal with Visual Basic? At least I would like to read a variable from one language in the other.