Ingreso rápido:  

Forum: VirtualDJ Plugins

Tema: Compiling a new VDJ C++ project in MS Visual Studio - Page: 1

Esta parte del tópico es antigua y puede contener información incorrecta para la nueva versión.

Well I got a plugin project almost done using Code::Blocks GUI for C++ but that doesn't create a separte GUI. Now I'm willing to try learning MS Visual Studio Community 2015 for Win for the GUI. Anyhow I just installed it (2015 Community) and I'm still not getting how the whole thing comes together. Was hoping someone who is familiar with creating a small quick video on Jing/Camstudio or any other screen recording software can create a minute video of putting all this code http://www.virtualdj.com/wiki/Plugins_SDKv8_Example4.html into a new project and getting that GUI to compile.

Maybe the sample video can get some old rusty developers into making more plugins for VDJ.

Thanks for any video volunteers.
 

Mensajes Sun 26 Feb 17 @ 2:38 am
I think I figured it out a little more but then stuck once again. Digging around it seems I added the PNG resource now VS2015 asks for what is the resource type and for the PNG it was BITMAP but in the VS2015 gui there is no option for XML so for XML it is wanting to use a Custom Resource Type and it's asking me for the type which I could only guess is HTML after I tried typing in XML as the type which came up with a hexeditor. After choosing HTML as the type for the XML resource it showed a rudimentary html editor with the xml code in it.. Thinking I was closer, visual studio crashed.. Now when I got back into VS, it had a red X icon on the resource and I then figured I'd remove the resource and recreate it and now when I try to recreate it it says the operation could not be completed unspecified error.. Sheesh... Still working on it...

OK erased some files associated with the resource in the root of the project folder and got it to compile but no GUI is showing up. Hmmm if I do figure this out I'm going to have to make a video on how to compile a VDJ project with a GUI. I do actually hope someone beats me to it so I can get some help with this. :)

I bet I'm soooo close.
 

Mensajes Sun 26 Feb 17 @ 3:36 pm
I might be the only programmer working on the VDJ plugins that constantly gets the error after a good compile "This plugin does not seem compatible with VirtualDJ"..OK that's after erasing the whole project and starting fresh with the source files. Everything seems to have went real smooth creating the project.... The plot thickens...

OK got that figured out when I deleted the project I forgot to set the target directory to the plugin folder inside My Docs.

Still no GUI...

 

Mensajes Sun 26 Feb 17 @ 4:01 pm
You need to add your xml and png files as RCDATA and deal with them that way.
 

Mensajes Sun 26 Feb 17 @ 6:11 pm
VS 2015 allows me to import a custom type for the file XML and let me set it to RCDATA but as soon as I try to import the PNG as custom it automatically marks it as an image as type PNG and doesn't allow me to change it.
 

Mensajes Sun 26 Feb 17 @ 8:04 pm
That should be ok because png is just a name. When you are loading it just use "PNG" as the resource type in FindResource.

Sometimes rather than screwing with import I just edit the rc file itself. You just need to be careful with resource.h file when doing that. I had to add about 800 emoticons once and wrote a program generate the necessary resource links. I was not about to use add resource for that and needed to sure about the ids for them. Sometimes add resource can be flaky as well in VS.
 

Mensajes Sun 26 Feb 17 @ 8:58 pm
Thanks @Don. I bet this is such a simple task but I still don't get it. Here is my .rc file for that sample project. Assuming I want to compile it 'as-is' without making any changes.


// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// PNG
//
IDR_SKINPNG PNG "FX_GUI.png"
/////////////////////////////////////////////////////////////////////////////
//
// HTML
//
IDR_SKINXML HTML "FX_GUI.xml"
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED


Still hoping there is someone who has a moment to do a quick rundown in maybe a youtube video on how to get that sample file to compile with the GUI skin.
 

Mensajes Sun 26 Feb 17 @ 11:37 pm
 

Mensajes Mon 27 Feb 17 @ 12:41 am
Show what you are doing in OnGetUserInterface (...).... no need to waste time with videos. show code instead. If you are using same code as in original sample then still best to show what you are doing to be sure. I have not looked at that sample much but it does not matter.
 

Mensajes Mon 27 Feb 17 @ 1:11 am
I copied the example code verbatim as is. All I wanted was to see how to start the plugin where it opens up a gui with a single knob and text box. From that I can modify what's necessary after I can see how it all comes together.
 

Mensajes Mon 27 Feb 17 @ 1:21 am
First learn to follow instructions and then maybe someone can help you.
 

Mensajes Mon 27 Feb 17 @ 1:55 am
I'm sorry. What instructions?
I copied each code block to separate files. Added them to a new dll project in MS studio and then added the 2 resource files in the ms studio IDE. Rc contents i posted above. Then i compiled it.
 

Mensajes Mon 27 Feb 17 @ 1:59 am
Don Moir wrote :
Show what you are doing in OnGetUserInterface (...).... no need to waste time with videos. show code instead. If you are using same code as in original sample then still best to show what you are doing to be sure. I have not looked at that sample much but it does not matter.


I have chased things around too much with some one saying that nothing has changed or are identical.

Have you put a break point at OnGetUserInterface to see if everything is ok with that ?

From some of your past post, you may be doing something unexpected. I assume though for now you are allowing VDJ to call OnGetUserInterface without trying to do it in script yet.

 

Mensajes Mon 27 Feb 17 @ 2:12 am
I normally don't create DLLs so I never had an opportunity to create a breakpoint inside one. With creating an exe you run it inside the IDE. How do you run an dll inside an IDE.
 

Mensajes Mon 27 Feb 17 @ 2:19 am
In VisualStudio properties for your project under Linker/General/Output file set it too: C:\Users\<you>\Documents\VirtualDJ\Plugins\SoundEffect\your.dll I think you are doing an audio effect... if not then use proper folder instead.

Set that for both the debug and release configuration and the following as well.

Under configuration properties select Debugging.

Command: C:\Program Files (x86)\VirtualDJ\virtualdj8.exe

Then when you click play or play with debug, it will automatically run VDJ. If you have a break point set for your plugin it will interrupt into VS when triggered assuming you have run in Debug mode.

These are the first things you should have done and then you have a way to Debug in a proper way. I am using VS 2009. I used VS 2013 for awhile but thought it a mess and did not like the new dependencies so went back to 2009.
 

Mensajes Mon 27 Feb 17 @ 2:35 am
OK you've given me something to work with. Also just want to make clear again i am using the example provided from virtual dj link above so yes I set the example as an audio sound effect that does nothing while it's activated but display the knob position.
 

Mensajes Mon 27 Feb 17 @ 2:41 am
I think there could be better more complete samples but ok to use as a template of sorts. Then when you make it your own things are going to change so I assume it is not identical. I can't speak to if they work out of the box either but you should consider it a learning experience and not something verbatim. Any one thing out of place can be a problem as you probably know. Once you get set up as I suggested you will have a way to trace thru and maybe make some headway.
 

Mensajes Mon 27 Feb 17 @ 2:50 am
OK from this

I set it as so below


Then setting my breakpoint.

Gave me an error when running debug (F5) as so LNK1168 cannot open ..\..\Users\user\Documents\VirtualDJ\Plugins\SoundEffect\PluginGUIskin.dll for writing.

I fixed that since I noticed when I used the IDE to pick the working directory it gave a relative path. I went back and modified that to the hard path C:\Users\user\Documents\VirtualDJ\Plugins\SoundEffect\ and it compiled and attached to the process.

Nice thanks for the tip it seems the debugger is functioning now through VirtualDJ. Now I have to figure out this debugger.

BTW where can I get another real basic fully working GUI example project? I couldn't find anything else but that one.
 

Mensajes Mon 27 Feb 17 @ 4:13 am
So the debugger isn't reaching OnGetUserInterface. Hmmm when or how (what part of the code) is it supposed to be called. Possibly have to figure out if it's even being called. Maybe the example didn't even call the GUI..
 

Mensajes Mon 27 Feb 17 @ 4:18 am
When the plugin is selected on a deck, click the '+' button (or cog button in drop down list)... That will cause VDJ to call OnGetUserInterface. If that is not called then you have some other problem.

BTW where can I get another real basic fully working GUI example project? I couldn't find anything else but that one.

I don't know :) so write one yourself... it is part of the process and you will learn and understand better by going thru the steps yourself. Once you get to a certain point you can worry about something more advanced later. Make sure you know what the calls do and how and when they are invoked in it's simplest form first. That is just allow VDJ to call them. This is easy by just setting a break point on every major plugin call. When you get the basics down people will be able to help you more. You probably have a basic thing so just build on it.
 

Mensajes Mon 27 Feb 17 @ 4:35 am
69%