Login
`
Templates, Tools and Utilities
|
||
Icetips Article
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
COM: Example 2004-01-16 -- Carl Barnes Newsgroups: sv.clarion.documentation
For completeness I'll report Andy I's public post and attach some shell COM
files he generated and attached
---------------------------
>From Carl Barnes on the SV Discuss Box:
Hi Carl,
I do not have access to the NG where you asked for my help. I will respond
here without knowing what it is you need from me in entirety.
>FWIW attached is my example of using the SVCom to Add a Shortcut. It's
>Alexey's code converted. I enhanced to wrap it all in a Class and
encapsulated all
>interface calls into class methods. It's not really polished and finished,
I
>got it working and tried to use as many SV equates as I could.
>While this works fine for me I'm not sure if I have handled the COM object
>correctlty. Maybe if AndyI is in this group he could take a look.
Ok. Code looks reasonable albeit that the save method is not native as it
takes only one param which is a variant. Without seeing what they are doing
in some of the calls, there is no way to know for sure if the code is
correct. But if it works, I guess it must be. Incidently, COMIniter is COM
(CoInitialize) not OLE (OleInitialize). OLE goes way beyond COM. The Objects
will auto clean on destruct so in principle it looks fine.
>A few reflections:
>1. It's a damn lot of work. Some auto gen of the code would help. My
>wrapping it all in a Class mainly takes care of type conversions.
Attached. That's why we have helpers. Then it's a lot less work. For
example....
sz = 'c:\winnt\calc.exe'
hr = ShellLink.put_Path(_bstr(sz))
if hr ~= S_OK
message(hr)
return
end
Not too difficult at all.
>2. The SVCOM looks like it's based on Plugware com with some of the names
>changed.
Yes, I wrote it, albeit an old obsolete copy that still has quite a few
bugs.
>3. At ThinkData are the docs to OutlookFUSe that provide some useful
>overview of the COM classes but more is needed
I have a doc somewhere but I lost a fair amount when my dev machine crashed.
The only thing we never lost were the sources in source control. Russ has
the best docs at this time on COM in clarion both from our ETC presentations
and one of his classes.
Regards
Andy
Attachment: shell32.clw (30 KB)
Attachment: shell32.inc (23 KB)
Attachment: shl32def.inc (4,997 bytes)
Attachment: shl32iid.inc (10 KB)
Attachment: shl32int.inc (14 KB)
Download andyipost.zip
softvelocity.public.clarion6 (softvelocity.public.clarion6) - Subject: Re:Att Carl Barnes From: Carl Barnes Today is November 21, 2024, 4:00 am This article has been viewed 35513 times. Google search has resulted in 263 hits on this article since January 25, 2004.
|
|