Hello there!
I need some help with programming a very basic kind of plugin for the purpose of displaying the currently played songs corresponding "Dance-Name" (I work for a dancing school :) ).
I have been searching around a lot how to do this and I just can't find any help yet. My problem is, that I'm just a student of electronics engineering and only had one semester of C++. The real problem though is, that I just don't even understand how to create my own .dll for the plugin and how to use it correctly afterwards.
If somebody could give me some more basic instructions about producing my own plugin and then getting the "get_filepath" - Verb running, I would be very grateful. I just need the path of the currently playing song to read out the corresponding folder (I already compiled a very well defined structure for all the different dances so it is all "well organized") and the rest will be relatively easy I think.
Currently I'm trying to get it to work with Visual Studio 2010 and put the corrent output folder in. Also I already have some .dll created, but no idea if it works and also no idea how to test that. Sorry if all of that sounds very stupid to you. :D
Thanks in Advance! :)
I need some help with programming a very basic kind of plugin for the purpose of displaying the currently played songs corresponding "Dance-Name" (I work for a dancing school :) ).
I have been searching around a lot how to do this and I just can't find any help yet. My problem is, that I'm just a student of electronics engineering and only had one semester of C++. The real problem though is, that I just don't even understand how to create my own .dll for the plugin and how to use it correctly afterwards.
If somebody could give me some more basic instructions about producing my own plugin and then getting the "get_filepath" - Verb running, I would be very grateful. I just need the path of the currently playing song to read out the corresponding folder (I already compiled a very well defined structure for all the different dances so it is all "well organized") and the rest will be relatively easy I think.
Currently I'm trying to get it to work with Visual Studio 2010 and put the corrent output folder in. Also I already have some .dll created, but no idea if it works and also no idea how to test that. Sorry if all of that sounds very stupid to you. :D
Thanks in Advance! :)
geposted Thu 22 Mar 18 @ 9:45 am
If you are a student you school probably has a MSDN account or even gave one to you. So I suggest to Upgrade to a more up to date version of VS. Preferably 15 or 17.
Did you already read this site(s)?
https://virtualdj.com/wiki/PluginSDK8.html
Did you already read this site(s)?
https://virtualdj.com/wiki/PluginSDK8.html
geposted Thu 22 Mar 18 @ 1:54 pm
Yes I have read it and I also used all the files there, but sadly I just don't get to the point of knowing how to debug the .dll (I need quite some time to program something correctly so it's hard to just let it create the .dll and it usually says "can't run the .dll" afterwards).
I would need some kind of basic strategy guide for it. :D
I would need some kind of basic strategy guide for it. :D
geposted Thu 22 Mar 18 @ 6:43 pm
I myself do have very little experience with developing VDJ plugins as such.
But IIRC you have to attache the VDJ process to your visual studio debugger.
Have a look at here (and please use the English version. The German translation is horrible)
https://msdn.microsoft.com/de-de/library/3s68z0b3.aspx
But IIRC you have to attache the VDJ process to your visual studio debugger.
Have a look at here (and please use the English version. The German translation is horrible)
https://msdn.microsoft.com/de-de/library/3s68z0b3.aspx
geposted Thu 22 Mar 18 @ 10:31 pm
King it is hard to say what you did. At one point you said you have some well structured thing that you compiled. Then you said you looked at the sample plugin code and included the files for that, etc. You say something says the dll cannot run. Who says that? VDJ or are you trying to run the DLL by itself.. no one is going to know without you providing details. I think VDJ will say something like incompatible if it is having a problem.
First thing is to compile the sample and see if that comes up in VDJ. I am not sure the sample is complete. It may need an XML PNG, etc. Not sure about all that currently. But anyway get that sample compiled first so you have at least some basis of knowledge. If it is missing something then ask about it or resolve that.
You can post your code here if you want. Just do first things first and don't skip the details when you ask for help. What version of VDJ? Assuming it is 8.
The dll should be placed in the correct VDJ plugins folder. That depends on what kind of plugin (audio,video,etc) it is to a certain extent.
When you get past square one then if something is not working then you can try and debug it but before that give more details.
First thing is to compile the sample and see if that comes up in VDJ. I am not sure the sample is complete. It may need an XML PNG, etc. Not sure about all that currently. But anyway get that sample compiled first so you have at least some basis of knowledge. If it is missing something then ask about it or resolve that.
You can post your code here if you want. Just do first things first and don't skip the details when you ask for help. What version of VDJ? Assuming it is 8.
The dll should be placed in the correct VDJ plugins folder. That depends on what kind of plugin (audio,video,etc) it is to a certain extent.
When you get past square one then if something is not working then you can try and debug it but before that give more details.
geposted Thu 22 Mar 18 @ 11:39 pm
Ah here we go.
Don knows what he's talking about. Better listen to him. I'm out :D
Don knows what he's talking about. Better listen to him. I'm out :D
geposted Fri 23 Mar 18 @ 12:07 am
Ok first let me apologize again for being so vague. :)
My current situation is the following: I have build a very detailed and well sorted folder structure on the target laptop for making music in the dancing school. It has every possible dance in it's folder-path-name and in these folders, there are the corresponding audio files (for example there is a song "Coldplay - Viva la Vida" in the folder called "Tango").
What I want to do with the plugin is actually just reading out the folder path (via get_filepath) and possibly writing it into a textfile or saving it otherwise (however it works out). I want to use that information later then to cut out the interesting part of it (the folder name which then is also the dance-name e.g. Tango) and let that be displayed on a screen on our dancing parties.
Until now I have downloaded the required files like the vdjPlugin8.h Header file, and all 3 code files on this page: https://www.virtualdj.com/wiki/Plugins_SDKv8_Example.html
I connected them in Visual Studio via an "Emptry Project" first but found out (via googling), that I need a "Win32 Console Project" to get a .dll as output. Please correct me if this is bullshit^^
As I build the project, I can find a .dll file in the specified Output-Folder (which I set to "...\Documents\VirtualDJ\Plugins\AutoStart" and I assume that is right^^). The problem of it is, I neither have an idea how to debug and try some things in the main-function now as my compiler says "The programm "C:\Users\......\VirtualDJ\Plugins\AutoStart\Tanzname.dll\ can not be run." or call this .dll in VirtualDJ (Version 8.2 btw).
If you need any more details please tell me, I tried my best to summarize correctly^^
My current situation is the following: I have build a very detailed and well sorted folder structure on the target laptop for making music in the dancing school. It has every possible dance in it's folder-path-name and in these folders, there are the corresponding audio files (for example there is a song "Coldplay - Viva la Vida" in the folder called "Tango").
What I want to do with the plugin is actually just reading out the folder path (via get_filepath) and possibly writing it into a textfile or saving it otherwise (however it works out). I want to use that information later then to cut out the interesting part of it (the folder name which then is also the dance-name e.g. Tango) and let that be displayed on a screen on our dancing parties.
Until now I have downloaded the required files like the vdjPlugin8.h Header file, and all 3 code files on this page: https://www.virtualdj.com/wiki/Plugins_SDKv8_Example.html
I connected them in Visual Studio via an "Emptry Project" first but found out (via googling), that I need a "Win32 Console Project" to get a .dll as output. Please correct me if this is bullshit^^
As I build the project, I can find a .dll file in the specified Output-Folder (which I set to "...\Documents\VirtualDJ\Plugins\AutoStart" and I assume that is right^^). The problem of it is, I neither have an idea how to debug and try some things in the main-function now as my compiler says "The programm "C:\Users\......\VirtualDJ\Plugins\AutoStart\Tanzname.dll\ can not be run." or call this .dll in VirtualDJ (Version 8.2 btw).
If you need any more details please tell me, I tried my best to summarize correctly^^
geposted Fri 23 Mar 18 @ 2:41 pm
Your application type should be win32 application and your application settings should be DLL. All that can be changed anytime. Actually, win32 application or console application are irrelevant when you are creating a dll as a dll is not a stand alone application as the other implies.
For debugging: When you are debugging a DLL, you need to run an application that will load the DLL since you cannot run a DLL by itself and is the reason you see that 'cannot run' error.
In configuration properties under debugging, set the command line to: C:\Program Files (x86)\VirtualDJ\virtualdj8.exe This is good to use for both release and debug since you can just run VDJ that way and is convenient. You can use the path macros as well but used C:\Program Files (x86)... for clarification but that works too.
When you are running the debug version, you can set a break point anywhere in your DLL, when your plugin is loaded or otherwise and that break point is hit, it will stop there and be in your dev studio debugging environment. This is of course if you have clicked the 'start debugging' button in dev studio and you have set break points that can be triggered.
What you ultimately want to do is not relevant to these first steps but of course will be relevant later. By the way, I can use any dev studio I want. They are all available to me at no charge. I used 13 for awhile but it sucked so bad I went back to the 2009 version. I told MS what I though of 2013 as well :) At least 2008 or later is needed for 64 bit compilation which is important to me but not for VDJ. 2013 or later is needed if you want to use C99 and it's variants but should not be relevant to you. I have not tried using more recent versions because what I have works fine for most everything I want to do and when I went to using 2013 it was just a big waste of time. Just use whatever you are comfortable with. It does not matter so much otherwise but beware that when using some of the later versions, that you may need to install the runtime for those versions if you are passing your DLL out to others.
For debugging: When you are debugging a DLL, you need to run an application that will load the DLL since you cannot run a DLL by itself and is the reason you see that 'cannot run' error.
In configuration properties under debugging, set the command line to: C:\Program Files (x86)\VirtualDJ\virtualdj8.exe This is good to use for both release and debug since you can just run VDJ that way and is convenient. You can use the path macros as well but used C:\Program Files (x86)... for clarification but that works too.
When you are running the debug version, you can set a break point anywhere in your DLL, when your plugin is loaded or otherwise and that break point is hit, it will stop there and be in your dev studio debugging environment. This is of course if you have clicked the 'start debugging' button in dev studio and you have set break points that can be triggered.
What you ultimately want to do is not relevant to these first steps but of course will be relevant later. By the way, I can use any dev studio I want. They are all available to me at no charge. I used 13 for awhile but it sucked so bad I went back to the 2009 version. I told MS what I though of 2013 as well :) At least 2008 or later is needed for 64 bit compilation which is important to me but not for VDJ. 2013 or later is needed if you want to use C99 and it's variants but should not be relevant to you. I have not tried using more recent versions because what I have works fine for most everything I want to do and when I went to using 2013 it was just a big waste of time. Just use whatever you are comfortable with. It does not matter so much otherwise but beware that when using some of the later versions, that you may need to install the runtime for those versions if you are passing your DLL out to others.
geposted Fri 23 Mar 18 @ 3:37 pm
Okay, everything you said made a lot of sense to me and I tried around with your idea now. Sadly it now says "No debugging information can be found - Can not open or find PDB File".
Was Project Properties --> Debugging --> Command the correct thing to change yeah?
Also: is there a way in VirtualDJ to see if the plugin was loaded? Or do I Just now go and program some stuff in hope of it working? :D
Was Project Properties --> Debugging --> Command the correct thing to change yeah?
Also: is there a way in VirtualDJ to see if the plugin was loaded? Or do I Just now go and program some stuff in hope of it working? :D
geposted Fri 23 Mar 18 @ 5:07 pm
KingValorian wrote :
Was Project Properties --> Debugging --> Command the correct thing to change yeah?
YES
KingValorian wrote :
Also: is there a way in VirtualDJ to see if the plugin was loaded? Or do I Just now go and program some stuff in hope of it working? :D
You will need to find the autostart menu in VDJ. Autostart will activate you when VDJ is loaded. If your plugin is selected or activated it has been loaded. That is still jumping the gun though since you still don't have a setup that works for you. There is no need to go racing around looking for things until you have something that you can do from your dev environment. Since just knowing if you are loading or not is not going to help you at all when the real things you need to know are not working. So I am not even going to bother to tell you how to find the autostart menu.
Under properties for the project, what does your linker output file say?
Take a small screen shot of your dev environment so I can look at that like I did here:
geposted Fri 23 Mar 18 @ 5:21 pm
Okay. :)
Linker Output File says: $(OutDir)$(TargetName)$(TargetExt)
Edit: https://ibb.co/iuyqaS
It looks pretty much like this: https://ibb.co/h6g1FS
P.S: I'm sorry that all of it is in german :D
Linker Output File says: $(OutDir)$(TargetName)$(TargetExt)
Edit: https://ibb.co/iuyqaS
It looks pretty much like this: https://ibb.co/h6g1FS
P.S: I'm sorry that all of it is in german :D
geposted Fri 23 Mar 18 @ 5:32 pm
That is ok now show me the linker output file as I put in above. Hard code it to be sure it is going to the right place. I mean PDB, DLL, Also under linker and debugging make sure you have it set to create the PDB files To debug your dll you need to have the dll and pdb file in the right place. Nothing else is terribly relevant except the you of course must be running the VDJ.exe which I believe you have done. Does not matter if that has debug symbols in it or not and only matters for the thing you are trying to debug which is your DLL.
geposted Fri 23 Mar 18 @ 5:36 pm
So it also has to be the path of the virtualdj8.exe ?
Creating is activated I think. :)
Edit: https://ibb.co/csxSN7
Creating is activated I think. :)
Edit: https://ibb.co/csxSN7
geposted Fri 23 Mar 18 @ 5:42 pm
No that is fine. Your linker output file path should take care of that but can say for sure with your version 10. I would think that would be the same though. Do what I said and hard code your linker output file path as above. That will either work or at the very least take that out of the picture as a possible problem.
EDIT: Another thing to do is to simply look for the PDB file and DLL and make sure they are where you expect them to be. This should be automated but if you continue to have a problem then simple put them in the right place.
EDIT2: None of it should be the path of the VDJ.exe except the command line path.. The thing that has to run. The other paths are .../Plugins/... (in your case autostart) which is where your plugin is going to run from.
EDIT: Another thing to do is to simply look for the PDB file and DLL and make sure they are where you expect them to be. This should be automated but if you continue to have a problem then simple put them in the right place.
EDIT2: None of it should be the path of the VDJ.exe except the command line path.. The thing that has to run. The other paths are .../Plugins/... (in your case autostart) which is where your plugin is going to run from.
geposted Fri 23 Mar 18 @ 5:47 pm
Okay so it looks like this in my plugins folder: https://ibb.co/cuBq9n
I am not really sure why it did not refresh the 'change time' but the files are where they should be. (The .txt file was made by me manually so don't care about it^^)
Additionally: it always opens VirtualDJ when I try to debug the dllmain.c, so at least that is going well I think. :)
I am not really sure why it did not refresh the 'change time' but the files are where they should be. (The .txt file was made by me manually so don't care about it^^)
Additionally: it always opens VirtualDJ when I try to debug the dllmain.c, so at least that is going well I think. :)
geposted Fri 23 Mar 18 @ 5:58 pm
Yep it should open VDJ and start your plugin which you should be able to trace thru. VDJ has to run since it is the application that is going to run your DLL and DLLs cannot run by themselves. The debugger needs to know where your DLL and PDB files are and needs to know what application to run since you are trying to debug a DLL. For a normal application this DLL consideration is not needed.
geposted Fri 23 Mar 18 @ 6:01 pm
Kay so as before I have this warning popping up everytime I try to debug: https://ibb.co/kztqaS
And it does not grip any breakpoints I add yet^^
And it does not grip any breakpoints I add yet^^
geposted Fri 23 Mar 18 @ 6:14 pm
Just click Don't ask again and ignore.. You already know that our version of VDJ does not have debug symbols in it and is irrelevant to debugging your DLL.
I don't want the VDJ source code, but if I at least had something to debug it with, things would get fixed faster for VDJ. Just saying and don't really have the time for that but it is something I do a lot with other foreign code under non-disclosure agreements.
I don't want the VDJ source code, but if I at least had something to debug it with, things would get fixed faster for VDJ. Just saying and don't really have the time for that but it is something I do a lot with other foreign code under non-disclosure agreements.
geposted Fri 23 Mar 18 @ 6:16 pm
>Removed<
geposted Fri 23 Mar 18 @ 7:18 pm
I will not be down loading it and doubt any one else would either. No one knows what working is supposed to mean, what damage it might do, and you are not supposed to be uploading plugins without approval on VDJ website which is in part to protect end users. Also as a new programmer who does not know about simple procedures and is a home user you have not gained anyone's trust. As a home user your link should be removed and doubt you will ever get official approval.
geposted Fri 23 Mar 18 @ 7:44 pm