Step by Step to creating DLL

Everything regarding the Power-Grid SDK can be asked and discussed here.

Step by Step to creating DLL

Postby Parkensis » 8. Jul 2016, 23:40

Hi community,

Can someone please point me in the direction of a step by step guide with the following.

1. I have installed all the program liste in the SDK but don t realy know which one to use to create a DLL.
2. How to I create a DLL? (Java or C++) to move the mouse around.

Ho ya starting from Scratch here ....

Thanks

Park
Parkensis
 
Posts: 8
Joined: 8. Jul 2016, 21:34

Re: Step by Step to creating DLL

Postby Parkensis » 10. Jul 2016, 11:14

Ok So not waiting for everyone to help, nothing beats your own investigation (Kidding)... Here are some helping sites... for C++

https://manski.net/2011/11/precompiled-headers/

and

https://msdn.microsoft.com/en-us/library/ms235636.aspx

Will keep on adding my finding during the investigation... This will turn on to be the step by step guide I need.

Park,
PS: Make sure you install the C++ version of VS2010 and not the C# which I did.... took me a few hours to find out why nothing was as it should be...
Parkensis
 
Posts: 8
Joined: 8. Jul 2016, 21:34

Re: Step by Step to creating DLL

Postby Parkensis » 10. Jul 2016, 12:22

Just hit another road block... Damm...

Ok now that I understand how to use C++ I'm ready to start my example training with QT... WRONG!!!

Installed QT 4.8.6 (DONE)
Download the Roccat power Grid examples (DONE)
Read the README FILE (DONE)
Understand the README FILE ... ouch.... WRONG.

Ok explain to me these line from the custom_dll example...

This is the sample for using a custom DLL in a Power-Grid plugin.

1. open up the project for the DLL in QtCreator
2. fix the path to the Power-Grid .lib and .h files
3. compile a DLL
4. place the DLL in this folder
5. place the folder in your plugins folder located at %USERPROFILE%\Documents\ROCCAT\Power-Grid\plugins
6. add the control to a custom grid


now... QtCreator does not exist in QT 4.8.6 ! but QtDesigner does... however QtCreator does exist in QT 5.8.0 and it opens QtDesigner anyway... So I open QtDesigner in 4.8.6 and it ask me to open the .UI file ...

Which does not exist in the example provided by Roccat... :?:

so I'm stuck again...

Parl
Parkensis
 
Posts: 8
Joined: 8. Jul 2016, 21:34

Re: Step by Step to creating DLL

Postby Parkensis » 10. Jul 2016, 14:59

Hee Haa!

Ok found the trouble with the trouble... Seems like we have to install QT 4.8.6 and QT Creator 4.0.3 (standalone) then link them together... did not find a page with the complete solution but part of it was here...

since QtCreator does not come with Qt 4.8.6 here is the link and scroll down to QtCreator...
https://www.qt.io/download-open-source/
And then here (do not need to install since we are using VS2010 for C++)
https://zahidhasan.wordpress.com/2014/04/29/how-to-install-qt-4-8-mingw-and-qt-creator-on-windows-8-1/

Once done follow the readme file... 1. open up the project for the DLL in QtCreator

Ok a better way to say this would be 1. open up the project (.pro) in QtCreator for the Sample2.pro in the example folder SCR of the cosutom_dll example you have downloaded.
Parkensis
 
Posts: 8
Joined: 8. Jul 2016, 21:34

Re: Step by Step to creating DLL

Postby Parkensis » 10. Jul 2016, 15:29

ok next step... 2. fix the path to the Power-Grid .lib and .h files

Now where do I start making more trouble... let me see... I still have no idea what that phrase means and where this is configured but I'll start with... QtCreator...maybe... hum....

ok got some clues while trying to run it from QtCreator... some error is telling me that RoccatPowerGrid.h is undeclared... could this mean that the path is actually not found?

Ok nothing like cliking like a zombie... Think a found it... I need to change the path in the sample2.h file well at least for the .h ... oups not working...

Realy need a real tutorial to go with these example files... Signing off for today...
Parkensis
 
Posts: 8
Joined: 8. Jul 2016, 21:34

Re: Step by Step to creating DLL

Postby Addihash » 12. Jul 2016, 11:02

Sorry for the late answer.

Nice to see that you could help yourself so far, let me explain step 2 for you:

you just need to make sure that RoccatPowerGrid.h and RoccatPowerGrid.lib are found. the header will be included in sample2.h, just check if the path is right.
And the same goes for the .lib where you have to check in the .pro file.
Addihash
Administrator
 
Posts: 232
Joined: 2. Feb 2015, 14:35

Re: Step by Step to creating DLL

Postby Parkensis » 14. Jul 2016, 05:03

Yup I agree, well here is another thing that I found regarding the project. The QT Creator needs to be in the same drive as the .H and .CPP files. Also found this, when you upload a plugin with a DLL you need to delete the previous one from Roccat Power Grid location (pluggin) otherwize it just won't load properly *event if you close the program.

By the way I've manage to complete the automatic mouse movement to precise coordinate in CPP using SetCursorPos(x,y); just yesterday.

Now I need to be able to incorporate it into the DLL for Roccat in conjunction with the .QS file. Not an easy task when you haven't program C++ for 25 years! I'm using the Sample2 (advance pluggin) example but it does lack dept or simplicity in the SAMPLE2.CPP file. If you could share the TRACKPAD.H and .CPP now that would be amazing!

Thanks
Parkensis
 
Posts: 8
Joined: 8. Jul 2016, 21:34

Re: Step by Step to creating DLL

Postby Addihash » 14. Jul 2016, 15:06

I cannot share the source of our DLLs with you, however if you tell me exactly where you have problems I can help you out with that.
Addihash
Administrator
 
Posts: 232
Joined: 2. Feb 2015, 14:35

Re: Step by Step to creating DLL

Postby Parkensis » 15. Jul 2016, 21:44

Hi,

after makeing simple modifications to the SAMPLE2.CCP program, I'm Trying to re-create the DLL with the changes I've made. I keep running into trouble again...
Here is the error found in MSVS2010.

\users\david\documents\roccat\sdk\include\roccatpowergrid.h(4): fatal error C1083: Cannot open include file: 'QtCore': No such file or directory

Did try quite a few things before I come to you.
1. Add to change the following so that many error would go away.

//#include "..\..\..\include\RoccatPowerGrid.h"
#include "\Users\david\Documents\ROCCAT\SDK\include\RoccatPowerGrid.h"

2. Added the .LIB as a Linker and library
3. Added the .LIB path to the project
4. Added the .h path to the project (did not work SEE point 1. I manually added the path)

Questions:
A) Should I compile the DLL with QTCreator or MSVS2010?
b) I know the procedure to create the DLL with MSVS2010 I was successful in creating one DLL but I do not know why this is not working with the changes I've made.
C) I do not understand the MOC object and its relation to the project. IS this required to recreate the DLL?

Thanks


Thanks
Parkensis
 
Posts: 8
Joined: 8. Jul 2016, 21:34

Re: Step by Step to creating DLL

Postby Addihash » 21. Jul 2016, 09:29

The DLLs need to be created in QT because they are QTPlugins.
MOC objects will be created when buildingn the .dll in QT, you do not need them for the final Power-Grid plugin.
Addihash
Administrator
 
Posts: 232
Joined: 2. Feb 2015, 14:35


Return to Power-Grid SDK

Who is online

Users browsing this forum: No registered users and 1 guest