Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

anyone building Photoshop/Windows plugins with CW7?

2 views
Skip to first unread message

Toby Thain

unread,
Nov 10, 2002, 3:55:11 AM11/10/02
to
Hi,

I've spent quite some time trying to track down a problem with Photoshop
plugins built for Windows. (I am running Metrowerks CodeWarrior 7 in OS
X and testing with VirtualPC 5.)

I have source to plugins which build and run perfectly under MacOS, and
build for Win32 with CW7. On invoking the plugin in Photoshop 5.0.2 for
Windows (tested on both VPC and a real PC), the plugin is entered and
exited several times as expected, after which an invalid page fault
invariably occurs in Photoshop. I have created a simple test case for
this problem and fruitlessly combed its code for bugs which might cause
this. My conclusion is that build settings are probably at fault, my
test case has a bug (the same trivial code runs perfectly under MacOS
though), or Photoshop 5.0 has a bug - I've not yet been able to test
with other versions.

Can anyone provide a complete working example of a CW7 Photoshop/Windows
plugin project?

N.B. I have read *in detail* the PS SDK docs, the sample code, and the
rare plugin sources available on the web, none of which has helped solve
this. Also, it's probably not a CodeWarrior specific problem; building
the same plugin with mingw (free GNU-based Win32 development toolset,
http://www.mingw.org/ ) produces the same result.

regards
Toby

Toby Thain

unread,
Nov 10, 2002, 6:52:04 AM11/10/02
to
In article <toby-816016.1...@news.iprimus.com.au>,
Toby Thain <to...@telegraphics.com.au> wrote:

> Hi,
>
> I've spent quite some time trying to track down a problem with Photoshop
> plugins built for Windows. (I am running Metrowerks CodeWarrior 7 in OS
> X and testing with VirtualPC 5.)

> ...


> On invoking the plugin in Photoshop 5.0.2 for
> Windows (tested on both VPC and a real PC), the plugin is entered and
> exited several times as expected, after which an invalid page fault
> invariably occurs in Photoshop. I have created a simple test case for
> this problem

The problem was due to my *mistaken* use of stdcall calling conventions
on the main function. It must NOT use stdcall! (I'm not sure where I got
the silly idea.) After removing this directive, and rebuilding, my test
plugin runs perfectly.

As a penance to USENET for this faux pas, I've published source code to
an minimal example plugin that builds with mingw* (a Photoshop SDK is
also required, this can be found on a pre-7.0 Photoshop CD):
http://www.telegraphics.com.au/sw/exporttest.zip

Toby

* mingw is a *free* toolset to build plugins - or anything - for Win32
(see http://www.mingw.org/ ). You can download Win32 binaries from
http://sourceforge.net/project/showfiles.php?group_id=2435 , or sources
which can be used to set up a Win32 cross-development environment for
Linux or UNIX.

Marc Pawliger

unread,
Nov 13, 2002, 11:50:58 AM11/13/02
to
You might want to check the alignment settings for your project and
make sure they match the ones being used for the Microsoft Visual
Studio projects that comes with the Photoshop SDK.

--marc

Vizros

unread,
Nov 13, 2002, 11:16:10 PM11/13/02
to
Marc Pawliger <use...@accend.com> wrote in message news:<131120020849219029%use...@accend.com>...

What kind of plug-in are you writing?

Tony G. Smith
Vizros - Real 3D page-curl plug-ins and more
Demo at http://www.vizros.com/vphelp/vpgallery.html

Toby Thain

unread,
Nov 16, 2002, 1:38:17 AM11/16/02
to
Marc Pawliger <use...@accend.com> wrote in message news:<131120020849219029%use...@accend.com>...

Thanks for the suggestion. Looks like my follow-up missed this group;
the problem turned out to be function calling conventions. I had
spuriously modified the entry point to use stdcall, where in fact
default Win32 calling conventions are called for.

Re: alignment,
The Photoshop APIs seem to be smothered in enough alignment-setting
pragmae to prevent this issue (even with Metrowerks). Nevertheless, I
did check structure field offsets under different alignment settings
(CodeWarrior offers 1,2,4,8,16 byte alignment) and they were always
the same, so I ruled this out as the cause.

Toby

0 new messages