Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-10

AW: Create an OCX with FreePascal

8 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dirk Mattes

Hi all,

Show quoted text 13 lines
Michael Van Canneyt wrote: > > I don't know what the OCX format is, if it is a simple .dll, then it should > be possible. an OCX is a DLL, which follows some special convention (exportet names etc.). Writing an ActiveX Control by hand should be possible with FPC, but it isn't trivial, as you have to implement a lot of COM interfaces. I think Visual C++ or the Platform SDK come with some examples how to write such a thing by hand, they should translate to FPC quite straightforwardly.

to write COM-Objects in FPC is possible and not difficult too much.

But an OCX (ActiveX-Control) is a problem, cause has to do with OLE-Automation. Like Michael says, you have to implement many interfaces (i.e. IDispatch for late-binding your methods, IEnumVARIANT and others), that Delphi or VC creates automaticly or Automation gives you in order to you type library. Most of your interfaces have to be comaptible with OLE-Automation. You also have to convert many Header files for constants that OLE uses (like VT_DISPATCH and many others).

So, forget about it an use Delphi or VC.

Reply by email

Marco van de Voort
to Dirk Mattes

[ Charset ISO-8859-1 unsupported, converting... ]

Show quoted text 27 lines
Hi all, > Michael Van Canneyt wrote: > > > > I don't know what the OCX format is, if it is a simple > .dll, then it should > > be possible. > > an OCX is a DLL, which follows some special convention (exportet names > etc.). Writing an ActiveX Control by hand should be possible with FPC, > but it isn't trivial, as you have to implement a lot of COM > interfaces. > I think Visual C++ or the Platform SDK come with some examples how to > write such a thing by hand, they should translate to FPC quite > straightforwardly. to write COM-Objects in FPC is possible and not difficult too much. But an OCX (ActiveX-Control) is a problem, cause has to do with OLE-Automation. Like Michael says, you have to implement many interfaces (i.e. IDispatch for late-binding your methods, IEnumVARIANT and others), that Delphi or VC creates automaticly or Automation gives you in order to you type library. Most of your interfaces have to be comaptible with OLE-Automation. You also have to convert many Header files for constants that OLE uses (like VT_DISPATCH and many others). So, forget about it an use Delphi or VC.

The headers are available on the site Jedi.

Reply by email

Dirk Mattes
Show quoted text 7 lines
Arg, that's what I doesn't want to hear. But more I read answer from my post, more I feel that's will be the final answer. I think i will go to create a DLL in FP, then write an wrapper OCX in Delphi if I found someone who have Delphi...

You can create OCX-Controls (as far as i know) with every version of Delphi since 2.0, so:
1.) Try to get an old version at ebay for few bucks or (Delphi 3 Standard ~ $15, Delphi 3 C/S ~ $200).
2.) Try to get Borland Delphi 6.0 Personal Edition. It's free for non-commercial use (but hard to download, cause its often down). I don't know, if there's something missing in Personal Edition of Delphi other than the sources of VCL (i heard some rumours about the help files, but I am not sure).

Good luck,

Dirk

Reply by email

Dirk Mattes
Show quoted text 7 lines
Arg, that's what I doesn't want to hear. But more I read answer from my post, more I feel that's will be the final answer. I think i will go to create a DLL in FP, then write an wrapper OCX in Delphi if I found someone who have Delphi...

Upps, I am sorry. Delphi Personal edition isn't free (~$99). But it's for non-commercial use only. The seems to be a
Trial (i not sure, i could not dowload it).

Reply by email

Full_Name
to Dirk Mattes: You can create OCX-Controls (as far as i know) with every version of Delphi since 2.0, so:

Quoting Dirk Mattes :

You can create OCX-Controls (as far as i know) with every version of Delphi since 2.0, so:

Yes and no. Delphi 2.0 implemented OLE Automation in a weird and now legacy fashion. It used another section in the visibility labels/sections called 'Automated'. I wouldn't touch it with a bargepole (i.e. it is not very good.) It'll be hard to find anyone who still uses this technique these days. D2 is a bit of a turkey, all in all.

1.) Try to get an old version at ebay for few bucks or (Delphi 3 Standard ~ $15, Delphi 3 C/S ~ $200).

You will need Professional or Client/Server (aka Enterprise) as no version of Delphi below pro will create ActiveX controls or allow you to import type libs etc. IIRC you don't even get the dcu's for the Units relating to this functionality.

2.) Try to get Borland Delphi 6.0 Personal Edition. It's free for non-commercial use

The personal edition does not allow commercial software development. There's no point in Thierry downloading it if he wants to do so.

I don't know, if there's something missing in Personal Edition of Delphi other than the sources of VCL (i heard some rumours about the help files, but I am not sure).

Yes, most of the functionality you are suggesting he uses. You can not create ActiveX components or do OLEAutomation with the Personal edition. Else what reason wold we have to *pay* for the Developer editions?

Further to your later email Dirk: No the Personal edition is free for personal use (after you register for free online.) If you pay Borland $99 you get a certain amount of support and CD/manuals. If you download it, you have no CD/manuals and you're 'on your own' support wise.

You may be getting confused with the Enterprise Trial. You can download this (~60mb d/l though.) You can then register for a 60 day trial.

Matt

"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." Kristian Wilson, Nintendo, Inc, 1989 -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GCS d? s+++:+ a- C++ UL+ P L++ E---- W- N+ o+ K- w O- M V PS PE-- Y PGP- t- 5-- X- R- tv+ b+ DI++ D+ G e++ h--- r+++ y+++ ------END GEEK CODE BLOCK------

Reply by email

Barry Kelly
to Dirk Mattes: Upps, I am sorry. Delphi Personal edition isn't free (~$99). But it's for non-commercial…
"Dirk Mattes" wrote 13 lines
> Arg, that's what I doesn't want to hear. But more I read > answer from my > post, more I feel that's will be the final answer. I think i > will go to > create a DLL in FP, then write an wrapper OCX in Delphi if I > found someone > who have Delphi... Upps, I am sorry. Delphi Personal edition isn't free (~$99). But it's for non-commercial use only. The seems to be a Trial (i not sure, i could not dowload it).

No, the Personal edition is a separate download too.

-- Barry

If you're not part of the solution, you're part of the precipitate. Team JEDI: http://www.delphi-jedi.org NNQ - Quoting Style in Newsgroup Postings http://web.infoave.net/~dcalhoun/nnq/nquote.html

Reply by email

Matt Emson
to Barry Kelly

Jonas, et al.

I've just got a PM 9500 180MP to run BeOS on. If I get time I'll have a look at your FPC stuff. I'd be very interested in helping out, as I plan for it to be my main computer now, and would love the BeOS port currently under way to have a PPC option ;-)

Matt

--- Don't have BeOS? Get it! - http://free.be.com/ Wanna keep BeOS alive? Save BeOS - http://www.BeFAQs.com/save/saveform.html -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GCS d? s+++:+ a- C++ UL+ P L++ E---- W- N+ o+ K- w O- M V PS PE-- Y PGP- t- 5-- X- R- tv+ b+ DI++ D+ G e++ h--- r+++ y+++ ------END GEEK CODE BLOCK------

Reply by email

Jonas Maebe
to Matt Emson
Matt Emson wrote
I've just got a PM 9500 180MP to run BeOS on. If I get time I'll have a look at your FPC stuff.

I'm glad to hear that. It's all in the 1.1 (main) branch.

I'd be very interested in helping out, as I plan for it to be my main computer now, and would love the BeOS port currently under way to have a PPC option ;-)

I don't know how processor-agnostc the BeOS port is. However, since the one Carl is doing is based on Posix, I assume the answer is "very" there. The other BeOS port may be more 80x86 specific.

Jonas

Reply by email