VS 2012 debugger shows strange values
-
On 16/02/2014 at 11:44, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13,14,15
Platform: Windows ;
Language(s) : C++ ;---------
Hi, I ask this here in this forum, because some of you use Visual Studio, and probably have seen something similar.
I cannot remember that I had this in VS 2010.When I set a breakpoint, and inspect a variable, I get strange values.
In this particular case, I am getting the name of a BaseObject.
The Visual Studio debugger shows "dummy dummy dummy", but as you see, the next line sends the name to the console, using GePrint(). And in the console in C4D, the name is printed correctly.
Have you experienced this? And do you have a solution?I can also mention that the VS 2012 debuggers sometimes is insanely slow, have no idea if these two phenomenons are related.
-
On 16/02/2014 at 23:50, xxxxxxxx wrote:
I did ask a similar question earlier and got this answer from Steve;
"You need to go to http://www.maxon.net/support/developer-support.html and click 'Additional Downloads' then get the 'C4D Typeview for Visual Studio 2010' archive. Install that (instructions in the zip) and you will be able to see the string content in the VS windows.
One caveat: it works fine with the full VS 2010 but whether it works with the Express version, I don't know. "
See https://developers.maxon.net/forum/topic/7607/9534_using-the-watch-window
There must be something similar for 2012.
-
On 17/02/2014 at 01:25, xxxxxxxx wrote:
you can also simply use:
cstr(newEntry) to plot the string while debugging.
-
On 17/02/2014 at 05:37, xxxxxxxx wrote:
Originally posted by xxxxxxxx
There must be something similar for 2012.
Yes, I agree, there must. But is it? I find no DLL for 2012. The first thing I did when I started to write plugins, was to install this for VS 2010. And it works. In VS 2010.
I tried to use the same DLL for 2012, unregistered it, moved it and registered it again in the new location, where devenv.exe for VAS 2012 is. I edited the autoexp.dat file as documented.
But the error remains. No change.Now, does the 2010 DLL also work for vs 2012? So that it is only me that have made a mistake when installing it?
Is there a VS 2012 DLL? Because I cannot find any on the web site. -
On 17/02/2014 at 05:45, xxxxxxxx wrote:
What you see in this case is the String.
class String { LONG m_size; // dummy1 LONG m_len; // dummy2 UWORD* m_txt; // dummy3 void* m_future_enhancements; //dummy4 }
By the way the file is called "c4dapi.natvis" and it is included in C4D R15 SDK.
-
On 17/02/2014 at 05:49, xxxxxxxx wrote:
Hi Remo, so what you sayt is that the file that corresponds to the VS 2010 DLL now is called c4dapi.natvis? Does this work when debugging the R14 SDK, in Visual Studio 2012?
OK, I will download it and have a look -
On 17/02/2014 at 15:35, xxxxxxxx wrote:
I hope Maxon Support can chime in here. I submitted a support question to Maxon, only to get the reply that they don't reply to developer questions, only user questions.
What I want to know is if there is a C4D Typeview for Visual Studio 2012 and the R14 SDK, and if not, what I can do instead to view variables when debugging the R14 SDK, using Visual Studio 2012. -
On 18/02/2014 at 00:32, xxxxxxxx wrote:
Originally posted by xxxxxxxx
I hope Maxon Support can chime in here. I submitted a support question to Maxon, only to get the reply that they don't reply to developer questions, only user questions.
To reach the developer support directly please send an email to sdk_support[at]maxon.net
Originally posted by xxxxxxxx
What I want to know is if there is a C4D Typeview for Visual Studio 2012 and the R14 SDK, and if not, what I can do instead to view variables when debugging the R14 SDK, using Visual Studio 2012.
Visual Studio 2012 isn't the supported development environment for R14.
With VS 2012, no DLL is needed anymore for a custom visualizer, just one XML file.
If you have CINEMA 4D 15, the SDK examples project ( cinema4dsdk ) copies c4dapi.natvis and other files to C:\Users\username\Documents\Visual Studio 2012\Visualizers after having successful built the CINEMA API. You can also manually copy this file from the CINEMA R15 application dir resource\_api_lib.
I haven't tried it but this visualizer *may* also work with R14. -
On 18/02/2014 at 02:25, xxxxxxxx wrote:
Originally posted by xxxxxxxx
With VS 2012, no DLL is needed anymore for a custom visualizer, just one XML file.
If you have CINEMA 4D 15, the SDK examples project ( cinema4dsdk ) copies c4dapi.natvis and other files to C:\Users\username\Documents\Visual Studio 2012\Visualizers after having successful built the CINEMA API. You can also manually copy this file from the CINEMA R15 application dir resource\_api_lib.
I haven't tried it but this visualizer *may* also work with R14.WOW!!!
This is nothing less than fantastic! It works!!!
I haven't tested it thoroughly, and I might run into issues here and there, who knows. But at first sight, it plainly works - no doubt about it!
The only thing I did was to copy the file you mention, that's it!Originally posted by xxxxxxxx
Visual Studio 2012 isn't the supported development environment for R14.
Well, after they released some extensions that make the IDE in VS 2012 usable, so that I do not get a white-out any longer, like the pilots flying inside clouds, I use VS 2012. It has some real nice features I have gotten addicted to, being able to search inside the solution explorer, worth to mention. So I use it. I hated it before, yes, HATED it, now I like it a lot
If there at all are any technical reasons not to use it, with regard to the binaries it creates, the plugins, please inform me about that. Then I will have to switch to VS 2010 again. But so far, all is well and fine, when I run the plugins I make.
Again, a whole bunch of thanks for this great tip!
-
On 18/02/2014 at 04:32, xxxxxxxx wrote:
Originally posted by xxxxxxxx
If there at all are any technical reasons not to use it, with regard to the binaries it creates, the plugins, please inform me about that. Then I will have to switch to VS 2010 again. But so far, all is well and fine, when I run the plugins I make.
The plugins run for you but people on a different machine may need to install the runtime components that are required to run C++ applications built with Visual Studio 2012.
See Visual C++ Redistributable for Visual Studio 2012. -
On 18/02/2014 at 06:03, xxxxxxxx wrote:
Originally posted by xxxxxxxx
The plugins run for you but people on a different machine may need to install the runtime components that are required to run C++ applications built with Visual Studio 2012.
See Visual C++ Redistributable for Visual Studio 2012.If that is the only concern, then there is no problem.
I use a setup, an MSI file, for installing the plugin. I use Advanced Installer to create setup projects, and it will take care of installing the redistrubutable, if needed.
I also have the option to compile the finale revision in VS 2010, before deployment.