Use .NET dll (class library C#) in 4GL [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to use a .NET class library written in C# in the 4GL Progress OpenEdge but I did not find good, working example. Progress says it's possible to do what I want to do, but it doesn't work.

Depending on version of Progress it might be possible to call the .Net class natively in the 4GL. However there are some limits to this. Progress for instance is very single threaded and cannot handle multi threaded .Net classes (for instance if an event occurs in a second thread). Basic support was added somewhere around 10.2B but has later been increased.
You can look at these (large) documents:
GUI for .NET Primer
GUI for .NET Programming
They are mostly about GUI programming but can be used as a reference.
The first thing you need to do is set up an assemblies.xml-file to add your component/class to your environment. After that it depends on your specific class but basic OOPABL is "quite" straightforward.
DEFINE VARIABLE c AS CLASS System.Collections.ArrayList.
c = NEW System.Collections.ArrayList().

The progress knowledgebase states:
It is possible to call .Net assemblies (DLLs) from the 4GL by using
COM (ActiveX) wrappers between the 4GL and the .Net assemblies. It is
your responsibility to write the COM (ActiveX) wrapper program. Help
in implementing this is outside of the scope of Technical Support and
we strongly recommend that you utilize the resources Microsoft has
available (msdn.microsoft.com) to help you.
This article might help: Calling a .NET Component from a COM Component
Good luck!

Related

Using a C library in .NET web application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have the source code for a C library that I need to use with my C# ASP.Net application. It sounds like the way to handle this would be to create a C++ dll wrapper and DLLImport that into my C# project. I have found this to be kind of ugly as far as when it throws an exception the entire application crashes. Is this the best way to accomplish this, or is there a safer way? I am trying to do some research on how I might be able to make a COM object with the C library, but haven't really found much there. Is it possible to make a COM object and reference it as .NET managed code?
I googled my way around this. I found this great article comparing
a C# facade using with PInvoke and a lot of marshalling
a Facade into the interop layer in C++/CLI and compiling in mixed mode for consumption by C#.
Also, this MSDN citation : C++ Interop is recommended over explicit PInvoke because it provides better type safety, is typically less tedious to implement, is more forgiving if the unmanaged API is modified, and makes performance enhancements possible that are not possible with explicit PInvoke.
Also your idea(C++ COM facade) seems legit as preached by the good book with 2 advantages:
The resulting classes can be used from languages other than Visual C++.
The details of the COM interface can be hidden from the managed client code. .NET data types can be used in place of native types, and the details of data marshaling can be performed transparently inside the custom runtime callable wrappers.

Is it possible to convert a windows form application (c# , .Net) to a cross platform project? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
What are the possible ways to convert a windows form application (c# , .net) to a cross platform project?
My GOAL is have a project that can run in both Linux base os and windows.
I really like .net but it's not compatible with all OS (for example Linux) because of .Net Framework installation.
what is your suggestions?
As #paqogomez pointed out, IronPython does not take away the need for some sort of .net since, as it's stated on the website http://ironpython.net/ : "IronPython is an excellent addition to the .NET Framework, providing Python developers with the power of the .NET framework."
Since your goal is to run your existing winforms-c#-application on both, windows and linux, you might get away by just using mono (http://www.mono-project.com/).
If this doesn't work out (please refer to http://mono-project.com/Compatibility for compatability issues), you could manually rewrite your existing C# application in pure python. But then, it might well be possible to use any other unmanaged, managed or scripted language which can be used on both systems and which is either easier to translate manually or for which even automated translators exist (however, I don't know if there are any for C#).
Thinking about the last point, I did a quick websearch for "c# cross compiler" which shows some esoteric results which might be interesting for you depending on your project type.

Should I Use Tkinter, C or C# to Make a GUI in Python? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am building a quiz program which can be personalized but I want to add a GUI to it. I have seen some pieces of software which implement C and C# into Python. Should I use Tkinter to make the GUI or should I use C or C#. Can you also please tell me a good book for beginners which I can use to learn Tkinter/C/C#.
Thanks.
When writing a program, you should avoid using multiple languages unless you really need to, especially for a simple GUI program.
In this case, learning C/C# specifically for the purpose of creating a GUI seems like overkill to me -- not only would you need to learn an entirely new programming language, but you would need to learn how to use whatever GUI library is popular from within C/C#! You'd be right back where you started -- having to learn how to use some library.
Instead, Python has several great GUI libraries that you can use. Tkinter is bundled by default within the Python standard, but there are other GUI libraries that are available, like wxPython or PyQt. Here's a comparison of different Python GUI libraries.
If you want to use .NET GUI components you'll have to switch to IronPython. You cannot use the standard CPython implementation and build a .NET GUI.
With the standard CPython you can use Tkinter, but I would suggest to take a look at PySide (or PyQt4). It's much nicer to work with, and it looks better.
PyQt4 Tutorial

Making UI for console application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How can I make an interface for console applications to make them look like edit.com under Microsoft's operating systems. Target languages are C, C++ and C#.NET.
Have a look at curses:
e.g.:
http://sourceforge.net/projects/curses-sharp/
That would be based on a very simple framework which writes directly to the video to draw the underlying shadows, drop down menus, etc, not alone that, since 'Edit.com` would be written in assembler for speed in relation to drawing, this is quite ancient by today's standards, you can however take a look at PDCurses which will enable you to do this kind of thing.
The neat beauty is, PDCurses is compatible with the unix equivalent of Curses.
But, really, today, it is all about GUI and Windows....
What kind of application are you trying to do?
IIRC, from my old days, there was an object orientated framework for this using TurboVision, which has a port available with open source now, see this wikipedia entry on this TurboVision.
Today, console applications are either old DOS applications emulated more and less in Windows, or command-line interpreters.
Anyway, if you really want to do an editor, use the System.Console class in the System NameSpace and use the SetCursorPosition method to write what you want where you want
The edit.com window you are showing appear to be developed with Turbo Vision, an old console gui library written by Borland many years ago.
Borland put the software in public domain and release its C++ sources. There is also a porting to Pascal, developed by the community, called Free Vision.
Unfortunately ,I don't think there is a porting or a wrapper to dot.net, so you have to write your own. Or, at least, you can look at the sources to get inspired...

Using Java-classes with C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a project written in Java (>1.5).
Is it possible to write parts of the project with C#?
For instance the GUI and calling the methods and instantiate the classes written in java?
If yes, how?
I am author of jni4net, open source intraprocess bridge between JVM and CLR. It's build on top of JNI and PInvoke. No C/C++ code needed. I hope it will help you.
Not without something like ikvm - or using web services etc to communicate between the two sides. Basically it's likely to be much more work than either rewriting your existing project code in C# or writing the GUI in Java.
There is something called Java Language Conversion Assistant for .NET. You can convert your Java classes to c# and start coding.
There is also something called JNBridge (not free).
It seems like my solution is very limited. and apply only to specific version of java.
I probably will stay with old good C :) Can't imagine how to work without shared libraries :)
This document explain how to create a dll from java and use it in C code. I'm not C# or java expert but i'm sure that you can load external dll's in C# as well. So not a complete solution but good starting point, IMHO.
Generally dll it's a perfect way to mixing languages.
In simple way you can pack your java classes to jar file then
In C# use Process class for execute and map IO stream
I did some research on this a few years ago (2005 I believe) and I liked JNBridgePro as the best third party product to do this. Check it out here http://www.jnbridge.com/
Good luck!

Categories