[Lazarus] Fw: new important message

2016-03-18 Thread Sascha.Hestermann
Hello!

 

New message, please read 

 

sascha.hesterm...@gmx.de

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] ActiveX in Lazarus and classic ASP

2016-03-18 Thread Michael Van Canneyt



On Fri, 18 Mar 2016, Marcos Douglas wrote:


Hi Michael,

On Fri, Mar 18, 2016 at 6:00 AM, Michael Van Canneyt
 wrote:


As far as I know, the only thing you need to do is create a class that
implements IDispatch. You hardly need a wizard for that, I think ?


Well, using Delphi 7 I click in 'New'>'ActiveX'>'Active Server Object'.
After type the "CoClass Name" -- TFooClass for example -- and choose
some parameters, the IDE creates:
1. An unit contents a pre-implementation of my class:
uses
 ComObj, ActiveX, AspTlb, Project1_TLB, StdVcl;
type
 TFooClass = class(TASPObject, IFooClass)
 protected
   procedure OnEndPage; safecall;
   procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
 end;

2. A file like "project_TLB.pas" that have, between others things:
 IFooClass = interface;
 IFooClassDisp = dispinterface;
...
 CoFooClass = class
   class function Create: IFooClass;
   class function CreateRemote(const MachineName: string): IFooClass;
 end;
...
class function CoFooClass.Create: IFooClass;
begin
 Result := CreateComObject(CLASS_FooClass) as IFooClass;
end;

class function CoFooClass.CreateRemote(const MachineName: string): IFooClass;
begin
 Result := CreateRemoteComObject(MachineName, CLASS_FooClass) as IFooClass;
end;

3. An "wizard" to insert new methods to simplify, I think, and a
"Text" is created on demand like that:
FooClass = coclass(IFooClass [default] )
 [ uuid '{E984E6AF-C43A-4B34-BF96-E03B43AC6A3E}',
   version 1.0,
   helpstring 'FooClass Object' ];

But I don't know if is relevant... anyway.


So, how an new FPC programer should know these things to make a ActiveX?


By studying ActiveX maybe ?


I could be wrong, but I don't think just implement IDispatch is enough, do you?


Maybe I was a bit short on details in my reply :-)

Yes, you can of course write a wizard that does all this. 
It's just generating text, after all.


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] ActiveX in Lazarus and classic ASP

2016-03-18 Thread Marcos Douglas
On Fri, Mar 18, 2016 at 11:57 AM, Michael Van Canneyt
 wrote:
> By studying ActiveX maybe ?
>

ActiveX is a Microsoft technology. Only study it does not mean that
you can implement
using FPC — I'm not saying does't possible — or it will be simple to implement.

See the Delphi 7 implementation.
The units below are needed to create a simple ActiveX class:

ComObj, ActiveX, AspTlb, StdVcl;

> Maybe I was a bit short on details in my reply :-)
>
> Yes, you can of course write a wizard that does all this. It's just
> generating text, after all.

Code is about text, after all. :)

I do not need a Wizard at all, just wondering if there is some
documentation to create an
ActiveX in the same way that Delphi 7 does.

Code like below is not about the ActiveX technology, but how Delphi
implemented this
technology:

  IFooClass = interface;
  IFooClassDisp = dispinterface;

  CreateComObject(CLASS_FooClass) as IFooClass;

  CreateRemoteComObject(MachineName, CLASS_FooClass) as IFooClass;

Doesn't matter, for me, if the code will be created by hand or by a
Wizard. But I would
like to know if this technology was fully implemented and documented.
Do you know?

Regards,
Marcos Douglas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus