Plug In Development

Plug-ins, add-ons, skins, icons, templates and other downloads. Contributions are welcome.

Moderators: XnTriq, helmut, xnview

Post Reply
Rattenhirn
Posts: 4
Joined: Fri Oct 10, 2008 8:15 am

Plug In Development

Post by Rattenhirn »

Hi,

I have tried and failed to create a plug in for XnView, maybe one of you can help me out.

I've downloaded the XnView Plug In SDK from this site and compiled it.
Then I've put the result ("Xuser.dll") into the "PlugIns" directory of my XnView installation.

However, it doesn't show up in the "Plug-Ins Information..." dialog.

In order to diagnose the problem, I've added some OutputDebugStrings to the Xuser.dll code. DllMain gets called with DLL_PROCESS_ATTACH and with DLL_PROCESS_DETACH, but no other methods.

Also, I checked the exports of the plugins available for download here and none of those have exports that even remotely match those of the plugin created by the SDK...

So, what am I missing?

Thanks in advance,
dIdl
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Plug In Development

Post by xnview »

Rename the Xuser.dll as Xuser.usr
Pierre.
Rattenhirn
Posts: 4
Joined: Fri Oct 10, 2008 8:15 am

Post by Rattenhirn »

I tried that. Now not even DllMain gets called.

I'm using XnView 1.94.2 btw.
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

It works for me, please send me your dll
Pierre.
Rattenhirn
Posts: 4
Joined: Fri Oct 10, 2008 8:15 am

Post by Rattenhirn »

I've got it to work now.

Some info that may be interesting to some:

* .usr PlugIns don't show up in the "Plug-Ins Information..." dialog.
* If they are not registered in XnView.ini, they'll get loaded the first time you try to view an unknown picture.
* The exported function need to be pure C. C++ functions with 'extern "C"' seem to crash XnView. (At least when using VC 2003)
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Rattenhirn wrote:* .usr PlugIns don't show up in the "Plug-Ins Information..." dialog.
Yes, only in formats
* The exported function need to be pure C. C++ functions with 'extern "C"' seem to crash XnView. (At least when using VC 2003)
Strange
Pierre.
Rattenhirn
Posts: 4
Joined: Fri Oct 10, 2008 8:15 am

Post by Rattenhirn »

* The exported function need to be pure C. C++ functions with 'extern "C"' seem to crash XnView. (At least when using VC 2003)
Strange
I've tried it again and it didn't crash XnView this time. So most likely something else caused the crash. I'll drop you a line when it happens again and I can isolate the cause.
Post Reply