Debugging PlugIn's

MerlinC

Hello together,

I'm planning to develop a PlugIn for rFactor1. Thererfore I downloaded the sample code from the rFactor Homepage as a starting point.

To better understand what the InternalPluginsV3 Demo is doing I tried to run the debugger from my IDE (Visual Studio 2010 Ultimate). After the automatic conversion of the project file to the visual studio 2010 format I could compile the source code and link the DLL file right away.

There was just a minor error message because of the attempt to copy the DLL to a directory which was not available. Thererfore I changed the output directory for the DLL to the rFactor\PlugIns Directory and cancelled the copy process.

Furthermore I configured the IDE to start rFactor.exe when debugging the DLL. Starting rFactor from the IDE without debugging (Visual Studio "Menu Debug/Start without Debugging") works fine. But if I try to the example code I get the following error message (assuming from rFactor).

View attachment 11802

Seems that I'm doing something wrong because I can't believe that all available plugins have been developed without using a debugger (just using trace messages written into files) not to talk about runtime optimization.


Any advise is highly appreciated.

Thanks in advance
Merlin
 
Nobody from ISI who can provide some information? Could not believe that the whole community is developing plugins without using a debugger?!
 
I'm sorry for you. It is frustrating when nobody seems to care about one's problems.

enviado mediante tapatalk
 
I'm trying to do the same as you and I've the same message , do you find a solution ?
Thanks you
 
I suppose you could create a 'virtual' rF that calls your own plugin in a similar way to rF? Probably be a bit of work in it but could then use it in future.

As far as debugging goes, you just need to help yourself by making your code modular (classes etc) so you can check the functionality of each part without needing to have the whole thing running, and when bugs do crop up you just narrow it down by outputting to text file in strategic locations. Obviously you want to keep your code readability high so you don't spend half your time chasing how the plugin works ;)

Optimization, same thing: you can test how quickly a particular piece of code works without needing to run rF at all, and test changes. Plus you generally aren't doing that much in a plugin in a performance dependent time (in realtime for example) because you'll quickly start having a big effect on framerate. Any major stuff needs to be offloaded to other processes. So you shouldn't have thousands of lines you're trying to optimize anyway.
 

Back
Top