Log in

View Full Version : SimpleSample 1.7 in VC++2008?


tin3tin
26th February 2009, 09:20
After several years of just beeing a avisynth user, I would like to try to code plugins(I have not c++ experience).

So far I've installed: Visual C++ 2008 Express Edition with SP1
and followed these instructions:

* Start VC++2005.
* Menu: fiIe -> Create new project.
* Select Win32 console appication.
* Enter name of your new project and press OK.
* You will in Win32 Appcilation Wizard. Press Application Settings (left panel).
* Select Application Type as DLL (but it may be console too).
* At Additional options select "Empty project"
* Copy files to project folder with Explorer.
* Add header file avisynth.h to the project: Menu Project -> Add existent item. Also add existant (e.g. simplesample.cpp) or create new CPP files by Project -> Add new item.
* Go to menu Build -> Configuration Manager, Set active solution configuration to Release (or Debug if you want firsly debug it).
* Make some changes (edit) of source codes to implement your algorithm. See SimpleSample or some other open source plugin source code and Avisynth Filter SDK for details.
* Go to Build -> Build Solution (F7) to compile and create plugin SimpleSample.dll

I've added avisynth.h and windows.h to the project folder and copy/pasted simplesample 1.7 into a cpp file.

When debugging it compiles okay and I'm able to make a release dll. Now I try to use the SimpleSample plugin in an avisynth script.
colorbars()
Loadplugin "SimpleSample.dll"
SimpleSample()
AvsP says invalids arguments to function "SimpleSample".

What am I doing wrong?

Is there a clever way to set VC++08 up so one fast can test if an avs plugin is working?

Gavino
26th February 2009, 11:06
SimpleSample 1.7 (unlike the other examples) takes two clips as arguments.

tin3tin
26th February 2009, 11:49
Oh, stupid me! :p It's actually running without any complaints now(with two clips).

I can't believe that it wasn't more troublesome to get VC++2008 to work and compile an avisynth plugin correct. It has scared me away from plugin coding for years.

Are there any hints on where to look for a quick start on c++ plugin coding? (I know nothing about c++ coding so far)

And is there a clever way to set VC++08 up so one fast can test if an avs plugin is working?

Guest
26th February 2009, 14:58
Are there any hints on where to look for a quick start on c++ plugin coding? (I know nothing about c++ coding so far) http://neuron2.net/www.math.berkeley.edu/benrg/avisynth-extensions.html

http://avisynth.org/mediawiki/Filter_SDK

And is there a clever way to set VC++08 up so one fast can test if an avs plugin is working? Your question is not clear, which is why nobody answered it the first time.

SledgeHammer_999
26th February 2009, 15:51
(I know nothing about c++ coding so far)

http://www.cplusplus.com/doc/tutorial/

If you already know another programming language then you will finish the tutorial in a day or two.

tin3tin
26th February 2009, 19:30
Thank you for those great links. Nice looking tutorial. :)

I mean when coding a plugin in Visual C++ 2008 Express is there a way to set it up so it automatically after a compile runs an Avisynth script which loads and uses the newly compiled plugin?
(I mean instead of manually running the plugin in AvsP)

Leak
26th February 2009, 20:01
I mean when coding a plugin in Visual C++ 2008 Express is there a way to set it up so it automatically after a compile runs an Avisynth script which loads and uses the newly compiled plugin?
(I mean instead of manually running the plugin in AvsP)
That's what you configure in the "Debugging" page of your project's properties - you can add a program to run and it's command line there and it'll build & run if you hit F5 to debug or CTRL-F5 to just run it.

Just make a script that loads your plugin from the folder it's getting compiled to and set up the debug program to load that script automatically.

np: Carl Craig & Moritz von Oswald - Movement 5 (Recomposed)

Gavino
26th February 2009, 20:10
What I do is just have AvsP open on a script that tests the plugin.
Before recompiling, do "Video - Release all videos from memory" to free the dll. Then recompile in your IDE and press F5 in AvsP.

That way you can tweak the test script as you go along. It's pretty effortless and I've never felt the need to make it more 'automatic'.