🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
9 messages
9 total messages Started by Chris Sun, 20 Apr 2003 23:27
Further to long question
#16917
Author: Chris
Date: Sun, 20 Apr 2003 23:27
16 lines
1413 bytes
I know this is a real cheek but:

I have BCB4 Ent and have downloaded the Context Menu Shell Extension using
COM (http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=15503)
sample but cannot get it to load (Project rule missing).

I have tried to create my own by following the instructions at
http://bdn.borland.com/article/0,1410,26650,00.html, it compiles but does
not work.

Has anyone else managed to get the sample to work in BCB4 by following the
example?  If so, did you have to do anything in addition?

Cheers

Chris
Re: Further to long question
#16922
Author: Remy Lebeau (TeamB)
Date: Mon, 21 Apr 2003 04:59
22 lines
1758 bytes
"Chris" <chris@chrischfmouseyREMOVE.karoo.co.uk> wrote in message
news:3ea32cdc@newsgroups.borland.com...

> I have BCB4 Ent and have downloaded the Context Menu Shell Extension using
> COM
(http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=15503)
> sample but cannot get it to load (Project rule missing).

The source is meant for BCB5 specifically, not BCB4.  You will need to
create a new project and copy the source code over to it.

> I have tried to create my own by following the instructions at
> http://bdn.borland.com/article/0,1410,26650,00.html, it compiles
> but does not work.

Just saying "it doesn't work" says nothing at all about the actual problems
you're seeing.  Please always be more specific about the actual symptoms
you're experiencing.


Gambit
Re: Further to long question
#16926
Author: Chris
Date: Mon, 21 Apr 2003 10:35
65 lines
3038 bytes
"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3ea37a64$1@newsgroups.borland.com...
>
> Just saying "it doesn't work" says nothing at all about the actual
problems
> you're seeing.  Please always be more specific about the actual symptoms
> you're experiencing.
>

You're right, when I say it doesn't work I mean it doesn't do anything.  I
don't know if it's an issue in the BCB code or in the registry.

I don't know how to debug an in-process server in BCB so for the moment I
have just entered "ShowMessage("In somewhere") in every routine.  It shows
three messages when being first registered with regsvr32 (which is
successful)  the messages indicate that it is loading, registering and then
loading again?

It never shows any messages when I right click a cpp file (as per the
example)

As this lead me to believe that I must be making a mistake in the registry I
did the following:

I have a VB sample that works, it comes with a REG file to register the
handler against OCX files.  I change the GUID in the reg file to mine and it
still does not work.  (I include the registry text at the bottom).

Any help would be great,

Thanks,

Chris







[HKEY_CLASSES_ROOT\.OCX]
@="ActiveX_File"

[HKEY_CLASSES_ROOT\ActiveX_File]
@="Windows ActiveX Controls"

[HKEY_CLASSES_ROOT\ActiveX_File\shellex\ContextMenuHandlers]
@="ActiveX_FileMenu"

; ***---modify the Clasid entry below---***
; replace {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} with a valid Clasid
entry...
; ***-----------------------------------***
[HKEY_CLASSES_ROOT\ActiveX_File\shellex\ContextMenuHandlers\ActiveX_FileMenu
]
@="{A65AD1B6-B38A-4391-974E-669D9B1C8200}"

; ***---modify the Clasid entry below---***
; replace {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} with a valid Clasid
entry...
; ***-----------------------------------***
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
Extensions\Approved]
"{A65AD1B6-B38A-4391-974E-669D9B1C8200}"="ActiveX File Extension"
Re: Further to long question
#16927
Author: user
Date: Mon, 21 Apr 2003 11:48
50 lines
2952 bytes
Chris wrote:
> 
> I have a VB sample that works, it comes with a REG file to register the
> handler against OCX files.  I change the GUID in the reg file to mine and it
> still does not work.  (I include the registry text at the bottom).
> 
<snip>
> 
> [HKEY_CLASSES_ROOT\.OCX]
> @="ActiveX_File"
> 
> [HKEY_CLASSES_ROOT\ActiveX_File]
> @="Windows ActiveX Controls"
> 
> [HKEY_CLASSES_ROOT\ActiveX_File\shellex\ContextMenuHandlers]
> @="ActiveX_FileMenu"
> 
> ; ***---modify the Clasid entry below---***
> ; replace {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} with a valid Clasid
> entry...
> ; ***-----------------------------------***
> [HKEY_CLASSES_ROOT\ActiveX_File\shellex\ContextMenuHandlers\ActiveX_FileMenu
> ]
> @="{A65AD1B6-B38A-4391-974E-669D9B1C8200}"
> 
> ; ***---modify the Clasid entry below---***
> ; replace {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} with a valid Clasid
> entry...
> ; ***-----------------------------------***
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
> Extensions\Approved]
> "{A65AD1B6-B38A-4391-974E-669D9B1C8200}"="ActiveX File Extension"
> 
> 
Although this sample agrees with the description in the article, both 
differ from the Microsoft Platform SDK documentation, not to mention 
entries in my registry. According to those sources the CLSID should be a 
subkey (not the default value) of the following key:
HKEY_CLASSES_ROOT\Program ID\shellex\ContextMenuHandlers\
where "Program ID" would be "ActiveX_FileMenu" in your example.

You can see the docs at one of the following urls, or look at working 
examples in your own registry by searching for the word 
"ContextMenuHandlers".

ms-help://MS.PSDK.1033/shellcc/platform/shell/programmersguide/
shell_int/shell_int_extending/extensionhandlers/
contextmenuhandlers.htm#registering

http://tinyurl.com/9yhw
Re: Further to long question
#16928
Author: Remy Lebeau (TeamB)
Date: Mon, 21 Apr 2003 17:02
21 lines
1839 bytes
"Chris" <chris@chrischfmouseyREMOVE.karoo.co.uk> wrote in message
news:3ea3c967$1@newsgroups.borland.com...

> I don't know how to debug an in-process server in BCB

In-process servers in general are easy to debug - just load the project into
the IDE and then "Attach to Process".  Shell extensions, on the other hand,
are a little different, though, because they are running insids the shell
itself and not directly debuggable.  However, Microsoft anticipated that
scenerio ahead of time and created a way for debuggers to be able to debug
shell extensions as well.  I've tested this approach with Builder, it does
work:

    Debugging with the Shell

http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersgu
ide/shell_basics/shell_basics_programming/debugging.asp


Gambit
Re: Further to long question
#16929
Author: Chris
Date: Mon, 21 Apr 2003 18:07
32 lines
1879 bytes
Eureka!!!!

Finally it works.

It turns out that I was getting confused with GUIDs.  I was using the GUID
as provided by OleView (MS Tool).  This looked to be right because the
sample VB used the GUID as reported by OleView.

i.e. GUID given directly by Ole View
{A65AD1B6-B38A-4391-974E-669D9B1C8200}

The one I actually needed is given by Ole View if you look into the Type
Library a bit deeper:

interface IMyContextMenuExtention : IUnknown {
    };

    [
      uuid(C7C41DC0-40C6-43B3-AF10-8DC5C35794FB),
      version(1.0),

Interestingly, I can't find this number in any of the source files, so I
don't know where it comes from?

This is also true for the example that quotes
0ABC22EB-602A-449D-A2D2-0D847869F67D .  This number is not in any of the
source files?

Anyway, thanks to all for your help, now all I have to do is modify the
example so that it does what I want it to do (gulp)!

Chris
Re: Further to long question
#16830
Author: Chris
Date: Mon, 21 Apr 2003 18:12
23 lines
2026 bytes
<user@domain.invalid> wrote in message > >

> Although this sample agrees with the description in the article, both
> differ from the Microsoft Platform SDK documentation, not to mention
> entries in my registry. According to those sources the CLSID should be a
> subkey (not the default value) of the following key:
> HKEY_CLASSES_ROOT\Program ID\shellex\ContextMenuHandlers\
> where "Program ID" would be "ActiveX_FileMenu" in your example.
>
> You can see the docs at one of the following urls, or look at working
> examples in your own registry by searching for the word
> "ContextMenuHandlers".
>
> ms-help://MS.PSDK.1033/shellcc/platform/shell/programmersguide/
> shell_int/shell_int_extending/extensionhandlers/
> contextmenuhandlers.htm#registering
>
> http://tinyurl.com/9yhw
>

Thanks.  I'm still trying to get my head around most of this and must
confess that I am struggling at the moment, but thanks and I look forward to
working it all out.
Re: Further to long question
#16831
Author: Chris
Date: Mon, 21 Apr 2003 18:24
22 lines
1798 bytes
> In-process servers in general are easy to debug - just load the project
into
> the IDE and then "Attach to Process".  Shell extensions, on the other
hand,
> are a little different, though, because they are running insids the shell
> itself and not directly debuggable.  However, Microsoft anticipated that
> scenerio ahead of time and created a way for debuggers to be able to debug
> shell extensions as well.  I've tested this approach with Builder, it does
> work:
>
>     Debugging with the Shell
>
>
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersgu
> ide/shell_basics/shell_basics_programming/debugging.asp
>

Thanks for the link, I would never have though of this.

Cheers

Chris
Re: Further to long question
#16832
Author: Remy Lebeau (TeamB)
Date: Mon, 21 Apr 2003 18:53
17 lines
1487 bytes
"Chris" <chris@chrischfmouseyREMOVE.karoo.co.uk> wrote in message
news:3ea43354$1@newsgroups.borland.com...

> Interestingly, I can't find this number in any of the source files.

It's not supposed to be...

> so I don't know where it comes from?

You're supposed to be using YOUR OWN guid, as generated by the type library
you declared your interfaces in.  Or, if you're not using a type library at
all (yes, it's possible to write shell extensions without a type library),
by pressing CTRL+SHIIFT+G in the IDE.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads