May 05, 2024, 10:22:01 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Delphi Controls

Started by Steven Picard, April 19, 2006, 08:49:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Steven Picard

I'm curious (and I'm probably going to sound like an idiot because I know almost anything about Delphi) but how hard would it be to use Delphi's 'T' controls?  From what I understand they are compiled directly into the executable so there are no dependencies like ActiveX would create.  My guess is they are just Delphi object files.  I thought I saw an example from sapero on the other forum at one time for using a 'T' control (I'll have to go look it up.)  The reason why I am asking is I have seen some really nice 3rd party controls for Delphi but they only ever work with Delphi and C++ Builder.

BTW, I call them 'T' controls because their names always start with 'T' but I'm sure they have a different name.  ;D  Hopefully I don't sound too foolish.

Parker

It's like how MS and Aurora use the 'C' prefix, Borland always uses 'T'. No idea why.

The example from sapero was a custom made thing, not something built for C++ Builder or Delphi. The problem with using other compilers' classes is the mangling that they apply. Currently Aurora uses the simple ClassName@MethodName syntax, but C++ compilers add tons of decorations to the name because of overloading, classes and namespaces, and other C++ features. And they don't always use the @ symbol, and VC++ (2003) if I remember correctly orders it MethodName@ClassName.

Actually ActiveX would be more compatible, even though it's hard to code, it's more possible. So if you own C++ Builder or Delphi and can recompile a COM component, someone will be able to help you get COM controls working with Aurora I think.

Steven Picard

Thanks for the reply, Parker.  I primarily use ActiveX but I came across some real nice 3rd party controls.  Just wondering if there was some way to use them in Aurora.  I pretty much figured "no" but just remembered something sapero had done.  I don't use Delphi or C++ Builder so I couldn't even wrap them in ActiveX if I wanted to.  :)

sapero

roger, the T was only a custom name, was it TButton? ;D
Delphi controls compiled as dll , always are exporting a resource typelibrary where we can see what classes and methods are exported to end user.
If a interface is dual (opt dispatch + standard class) you can call all methods directly;
Just extract the typelib, convert to aurora readable include file, find guids
(coclass = CLSID, interface or dispinterface = IID).
Use exescope, oleview (best) or any never resource viewer supporting typelib.
I have posted some Sean COM Articles on previous forum, based on Sean stuff you can build your own typelib viewer

Steven Picard

Thanks for the reply, Sapero!

Zen

If you are after using some custom controls, it is relativly simple to make then in Aurora and the "other" language. You can make them in a source file, DLL or static library and use them in any of your programs.

Lewis

Steven Picard

sapero,

I was going through the articles that you posted the link to and I didn't know whether to laugh or cry at some of the VB bashing:

QuoteWhat's the deal with Visual Basic?  VB is by no means a powerful or elegant language.  The people who use it certainly aren't mental giants.  So why are Visual Basic programmers often so darn productive?  The answer is simple my friends; you've suspected it all along.  They mooch off the hard work of C++ programmers like you and I.

But this was funny:

QuoteAs C++ programmers, isn't it in our best interest to stop this cycle of code reuse before it gets out of hand?  Actually no, and our reason is two fold.  First there is a humanitarian concern: if we stop providing functionality to VB programmers in the form of Automation servers, they'll lose their jobs and turn to drug addiction and chronic welfare.  The tax burden of rehabilitating and supporting these once-developers would be overwhelming.  The second reason to continue providing Visual Basic-compatible Automation servers is in the interest of greed: in some parts of the country VB programmers outnumber mosquitoes.  This is a huge marketplace, ready and willing to shell out big bucks for whatever cool objects they can incorporate in their projects.  C++ developers who recognize this emerging marketplace will have no trouble lining their pockets.  Imagine what you can buy with all of this cash: Italian sports cars, winter homes in Melbourne, and platinum toilet paper dispensers.

Thanks for the links, though!  I got a lot to learn about the inner working of COM and ActiveX.

sapero

April 21, 2006, 11:13:59 AM #7 Last Edit: April 21, 2006, 02:05:46 PM by sapero
Now try to convert some of typelib examples to aurora language. Get it run! ;D

(spoiler attached, reuploaded)

Steven Picard

Okay. :) I won't download your spoiler unless I just can't figure it out.

JR

I have modified a TypeLib Browser that I made with PowerBASIC to generate interface definitions for Aurora.


Ionic Wind Support Team

Ionic Wind Support Team

Steven Picard


Steven Picard

In my efforts to understand as much about COM as possible I am going through the tutorial sapero linked to and also this one:
http://www.thecodeproject.com/com/COM_from_scratch_1.asp

This is probably all very basic stuff for most of you but I have either fortunately or unfortunately been shielded from this through VB (although I have been quite productive mooching off the skills of C++ programmers as that one articles states ;D)  But I am determined to understand COM so thoroughly that I will be able to program my way into complete world domination!! Mwahahahaha!  Okay, I'm letting this get to my head, better get back to work.   ;D

Parker

Wow, that's a great utility! ;D
One suggestion though: Surround types (struct) with #ifdef somestruct...#endif, because some are defined in the 2D headers I think.

Bruce Peaslee

Aren't these newbies something else?ÂÃ,  ÂÃ, ;)
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

JR

Quote from: Parker on April 22, 2006, 02:12:51 PM
Wow, that's a great utility! ;D
One suggestion though: Surround types (struct) with #ifdef somestruct...#endif, because some are defined in the 2D headers I think.
Thanks for the suggestion. I wasn't aware that #ifdef/#endif worked also with structs.

I will also change the remaining &H for 0x and add some missing *.

I will need a full list of reserved words. Currently I have identified the following:

ALIAS AS BREAK BYTE CASE CONST DECLARE DELETE DO DOUBLE
DSTRING ENUM EXPORT EXTERN FALSE FLOAT FOR GLOBAL IF
IMPORT INT INTERFACE INT64 LABEL NEW POINTER PRINT RETURN
SHORT STRING STRUCT SUB TRUE UNION UNSIGNED UNTIL VIRTUAL
VOID WHILE WORD

I also want to add an option to generate classes for events sink.

I have encountered a problem with string constants and float values, apparently not supported by #define. Is there a way to define them?

Parker

Unfortunately, const and #define only accept integer constants.

As for a list of keywords, I found this (alphabetical) list in the developers section:
alias
and
as
baselen
break
byref
byte
byval
case
cdecl
class
const
declare
def
default
delete
dim
do
double
dstring
else
else
export
extern
FALSE
float
for
global
goto
heap
if
import
int
int64
interface
len
new
not
null
opt
or
pointer
print
return
select
sprint
string
struct
sub
switch
this
TRUE
union
unsigned
until
va_start
virtual
void
while
word
xor

#asm
#autodefine
#define
#else
#emit
#endasm
#endif
#ifdef
#ifndef
#include
#typedef
#undeclare
#use

JR

April 22, 2006, 10:22:11 PM #17 Last Edit: April 23, 2006, 06:34:27 PM by José Roca
Thanks for the list. Its needed to avoid name conflicts with variable names and method names. I check every name and, if it is in the list, add an underscore to the name.

BTW be aware that there is an issue with BYVAL Variants. See:
http://www.ionicwind.com/forums/index.php?topic=548.0

Parker

BYVAL is recognized as a keyword (separate token, not identifier) but for some reason does nothing.