Re: Why wont this work ?




"J French" <erewhon@xxxxxxxxxx> wrote in message
news:4410223d.709403170@xxxxxxxxxxxxxxxxxxxxxxx
On Thu, 09 Mar 2006 11:43:16 GMT, "Martin Spencer-Ford"
<tpwukdashzeroone@xxxxxxxxxxxx> wrote:

<snip>

I am getting a much better picture of your situation.

The documentation can be very confusing, one needs to 'learn' how to
use it - which is not easy.

One good trick is to distinguish beween Delphi's stuff and the Windows
Help files - which are in C notation

Yeah - I keep playing with the idea of switching to C++ or C#, but i am
struggling with Delphi, and i was told that Delphi is just as easy as basic,
and is comparable to C++ in power features.


I generally cross check things, and also check the MS web site.

AX DLLs and OCXes are really just normal DLLs containing COM objects
- to tell the world what they contain, they have to have a standard
entry point for sticking stuff in the Registry

I suggest you go to : www.sysinternals.com
and grab RegMon and FileMon, they are free, very good and do things
that very few programmers can do.

Yup i have plenty os sysinternals stuff, they are partly responsible for my
inspiration ....


It is very good news that all the PlugIns are DLLs

Most likely these DLLs simply expose a number of COM methods with
known names, astonishingly if you can get an instance of a COM thing
into an OleVariant you can invoke its methods like this :-

AnOleVariant.DoSomething

And a crude file viewer will give you some clues on the 'DoSomething'
- those things have to be plain text

Mostly I guess, you are going to have to find out how to interrogate
those DLLs, and you probably already have some ideas.

Yes I have looked at the Dll's in a hex editor and can see the functions
they contain, and i have seen documentation for probing the Dll to provide a
stringlist of the functions therein, not got round to trying that bit yet
.... one step at a time and all that.


Here is something I played with a long time ago (I think I was
checking backwards compatibility) :-

uses ComObj;

Var
V: OleVariant;
InstalledFlag :Boolean = False;

procedure TForm1.Button1Click(Sender: TObject);
begin
If InstalledFlag = False Then
Begin
InstalledFlag := True;
V := CreateOleObject('VB4DLL.Class1'); (* Create the Automation
object *)
End;
V.Test
end;

As you can see the 'object' is obtained from the internal name of the
DLL and an exposed COM Class
- the V.Test is fixed up on the fly


Now ya cooking, I didnt know you could piggy back the routines, but hell it
makes sense, my assumption of dll's are that they are basically nothing more
than an API of sorts, even if they have custom functions, fell free to scald
me if i am wrong with that assumption :)

Save frequently and be prepared for some spectacular AV's
- however guessing COM parameters is not that hard, as there are not
many of them.

Yeah - My Delphi Studio and XP dont always see eye to eye on stuff, it
frequently freezes and locks up when trying to trace through and debug, so
I figured regular saves are damned fine idea :)

Thanks J

TpwUK


.


Quantcast