I am trying to find a way to use Open Cascade(www.opencascade.org) - 3D Modeling Technology in one of our software which is written in Delphi.
I did manage top find an ActiveX which supports Open Cascade, but on trying it I did not like the visual quality of rendered images. The ActiveX lib can be found here (www.ewcad.com).
I am not able to locate any VCL for this nor can I find any import declarations for this on internet.
What makes you think that the visual output quality would be higher if you had a native VCL wrapper? The underlying library is C++, not C, so import libraries are not going to be enough. A "C++ class to VCL wrapper" interface for such a large project would be years of work.
Have you looked at GLScene? http://glscene.sourceforge.net/wikka/HomePage
W
I am using OCC from Delphi through a DLL exporting ANSI C functions. It was not required to export all of the more then 12000 Objects, just a set of wrapper functions to initialize, add geometry, modify it and store it to Disk.
I started with one of sample Applications provided with the OCC package and converted it to my personal DLL, wich is loaded at runtime.
It took me about 2 weeks for the first working sample.
Related
I have written a framework for Android and Windows, and got some tool that draw the forms and scripting that run on both enviroments. Just another solution like thousands.
What I want to do now is using Delphi (Xe2 in my case) to write an IDE like Delphi itself. That I could manage source files in a project and have forms. I have much of it already on DevExpress components. But I was wondering if there is anything that I could reuse to not invent the wheel again.
Certanly the drawing form should be necessary to have changes for my particular case, however it being capable of drawing forms with buttons, text, those common controls we find in majority of the platforms.
Right now I am using Balsamiq Mockup to draw and export xml to my compiler to integrate on the framework, it is nice, because it is a great drawing product, howeve there is a need to have all that IDE properties integrated and the need to put events on each control, for that an IDE all in one solution is better.
TMS Scripter -> I have found this commercial package, that comes with basically everything I need, scripting (I need VB but with different flavor, I believe it could be changed), form designer, project management, etc... It is very nice indeed. However I would like to hear of open source solutions
How about Lazarus? I think that's free, and it certainly has an extensive IDE.
http://www.lazarus.freepascal.org/
It's not a Delphi Open Source IDE, but I think it is free for use and feature rich:
MS Visual Studio Shell
what-is-the-visual-studio-shell-standalone-shell-good-for
RemObject use it for there tools. So it fits also for Delphi.
I was wanting to learn OpenGL using Delphi But never added an library to Delphi or even sure if this is what you need to do? Anyone give some steps on how i would add openGL to delphi so i could call it in the uses section?
You need a wrapper for the OpenGL dlls that declare the types and functions needed, and then you call those functions from your Delphi code. The VCL includes a somewhat limited (and generic) wrapper in OpenGL.pas, but there are better ones available.
One of the popular wrappers for Delphi is the Open Source GLScene, which includes demos and wrapper units. It also includes visual components that you drop on your form just like any other Delphi components. The link above is for the SourceForge project; the GLScene web site has more information, including documentation and FAQs.
Can anyone recommend a FIX Engine (commercial or open source) for use with Delphi?
Is it possible to use QuickFIX with Delphi?
Take a look at B2BITS FIX Antenna. There are two possible options:
FIX Antenna C++ has ANSI C interface that can be used in Delphi (there is a sample in the package)
http://www.b2bits.com/trading_solutions/fix_engines/fix_engine_cpp.html
FIX Antenna .NET can be used in Delphi .NET (there is again a sample in the package; also programmer's guide contains Delphi.NET samples)
http://www.b2bits.com/trading_solutions/fix_engines/fix_enginenet.html
Feel free to contact me directly if you need more details.
QuickFix is a C++ project.
Both Python and Ruby use SWIG to expose the C++ classes as native Python and Ruby classes.
The .NET wrapper sounds like a mix of C++ and C# code.
It's not possible to import C++ classes within Delphi directly. You'll have to use a "flat API" conversion, exposing all C++ methods as plain C declarations, in order to import external structures and functions in a Delphi unit.
To my knowledge, there is no such "flat API" of QuickFIX available, and no SWIG version able to generate Delphi code. You'll have to write your own wrapper in C++, or perhaps write your own FIX implementation in Delphi.
The only FIX library I know for Delphi is the one from http://www.b2bits.com - it did exist some years ago, but I'm not sure it's still sold/maintained - they seems to maintain only a DotNet version. Worth asking them for pricing and availability, in all cases.
One way to integrate the protocol with Delphi would be building a .Net or Java bridge, for example:
use the .Net C# implementation to build a small application to communicate with the FIX side
then expose methods (and maybe even the objects) of this .Net app over SOAP web services
use Delphi's web service client code generator to import the SOAP WSDL
access the web service from the Delphi side
This is probably more of a hack than anything else, but you could use the Python QuickFIX bindings in Delphi, via python4delphi. That's a lot of layers though (Delphi to Python to C++).
Python is an easy language to use, and learn, and it's easy to invoke and create python objects (or native C wrappers that pretend to be python objects) and invoke them directly from the Python4Delphi API.
Barring that, it might be very little work for you to build a procedural (flat) API as ABouchez said. Instead of writing a million functions I would write only the ones I needed, and then implement these simple functions inside a VC++ DLL:
QuickFixInit;
QuickFixCleanup;
handle := QuickFixLoadFile(filename)
QuickFixSaveFile(handle)
handle2 := QuickFixGetObjectHandle(handle,index,...);
QuickFixModifyObjectProperty(handle2, propertyname, propertyvalue );
QuickFixExecuteSomeAction( handle2, actionname, param1,param2,param3 );
The above are just to give you the flavor. I know nothing about the internal API, but what I'm showing you above is that you don't need to conform 100% to the API to write a wrapper. You could probably (if you know C/C++) write a functional wrapper that does what you need, and export it, link it into a DLL, and then import QuickFix.dll into Python with very little (2-4 hours of an expert's time) work, if you know Visual C++ well enough to write a few simple C-style (non OOP) functions that instantiate C++ classes, and invoke C++ methods.
It might be possible to expose the C++ APIs to Delphi via a C++Builder package (BPL) containing QuickFIx, but (a) some source modifications would be required, and (b) the C++ code in QuickFix, or its dependencies, might not build in C++Builder without significant modifications.
I'm trying to generate _TLB import units for Outlook 2003, 2007 and 2010 (and also other OLE servers) analogous to the ones bundled with Delphi for Outlook 2000 and 2002. However, I couldn't get the type library importer to also generate the code for capturing events from the OLE servers that is found in the bundled units. The option to "Generate component wrappers" only creates wrappers for servers that are directly instantiatable but not for objects that are only returned via methods of other objects like TInspector, TExplorer, etc.
I could of course create the event handling code myself but that would be really tedious work.
Does anyone know if the importer contained with Delphi 2010 (tlibimp.exe) can be tweaked to generate that code? I really doubt that back in the day Borland created the existing Outlook2000.pas and OutlookXP.pas units manually...
Are there maybe any other tools around that can do this?
Good question! I never noticed that those components were not created (I only use Word_TLB). After playing a bit with tlibimp I found out that you need the -Yc+ flag. Probably all ignore flags are default on.
NB: this is on Delphi 7 with tlibimp.exe version 7.0.4.453
In the company that i work, we develop all the GUI in C#, but the application kernel is mainly developed in Delphi 5 (for historical reasons), with a lot of components made in COM+. Related to this very specific sort of application a I two questions:
Experienced guys in Delphi and/or COM, do you have any workrounds to work with the buggy TLB interface ?
Some of the bugs are: IDE crashing during edition of a large TLB, lost of methods IDs, TLB corruption, etc.
Here, we haven't found any good solution. Actually we tried do upgrade do the new 2007 version. But the new IDE TLB interface has the same bugs that we found before.
How do you control TLBs versions ? The TLB file is in a binary format and conflict resolutions are very hard to do. We tried to do it exporting the interfaces descriptions to IDL and commiting into CVS, but we didn't found any good way to generate TLBs from IDL using Delphi. Additionaly, the MIDL tool provided by Microsoft, didn't parse correctly the IDL files that we exported from delphi.
I think you should have a good look at Delphi 2009.
Delphi 2009 has changes to the COM support, including a text-based replacement for the binary TLB files.
You can read more on Chris Bensen's blog.
In the distant past (before I started working for CodeGear) I gave up on the odd Delphi-ized IDL language that the IDE presented, and wrote my own IDL and compiled it using MS midl. This largely worked; the only catch, IIRC, was making sure dispids (id attribute) were correct on automation interfaces (dispinterfaces) for property getters & setters - there was some invariant that tlibimp expected but midl didn't guarantee.
However, now that Delphi 2009 uses a safe subset of midl syntax, and includes a compiler for this midl in the box and integrated into the IDE, these problems should be a thing of the past.
We have also just installed Delphi 2009 and it does seem to have improved the support for Typelibraries. However I have worked with COM and type libraries for quite some time and here are my general gotchas that I have found over the years. I would agree its pretty buggy and is all the way up to Delphi 2006 (our version prior to using 2009).
Always have every file writeable before opening. This may sound obvious, but when working with source control sometimes we forget to do this and try to remove readonly flag after opening a file - Delphi cant deal with this. Ensure tlb is writable before opening.
If editing a standalone typelibrary you MUST have a project open. For some reason if you open a type library on its own it will not save. Create a blank project and then open your typelibrary. For some reason this allows the type library to be saved.
If your type library is used by an application or COM+ ensure that application is shut down or COM+ disabled before opening the type library. Any open apps will prevent the type library from being saved.
However I think your best solution is probably an upgrade. You get Unicode support too.
Using Delphi 2009 has greatly taken much of the pain out of huge TLB files, and conversion of our existing objects was painless, but our com objects don't use any third party libraries.
We will be migrating our gui applications over once the library vendors release supported versions.
Same experience with the TLB interface here: we simply stopped using it.
We work with several separate IDL files (hand-build) for different parts of our framework, making use of the #include construct to include them into the IDL of the actual application, then generate the single tlb using MIDL and tlibimp it. If the application has no IDL of it's own, pre-compiled version of the different framework TLB files are available.
Whenever the framework enters a new version, a script is run to re-generate the GUIDS on all necessary interfaces in the IDL files.
This has served us well for many years, and for us to move over the new Delphi 2009 IDL/TLB toolset will have to be not only integrated into the IDE, but also versatile when it comes to automated builds and whatnot. Can't wait to get my hands dirty with some experiments!