Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Cannot open sketches or they are empty... (Read 11011 times)
CeSinge
Newbies
*
Offline


Posts: 5
Location: Brussels, Belgium
Joined: Nov 13th, 2014
Cannot open sketches or they are empty...
Nov 13th, 2014 at 10:39pm
Print Post  
Hello,
I installed Visual Micro on Win 7 x64 and with visual studio 2008.
The menus (like Tools/Visual Micro) appear, I can select the port, board and Arduino 1.0.x.
My board (a SainSmart Uno) is detected as it should. 

However, when I try to File/Open/Sketch Project and pick an .ino file, nothing happens at all.
If I do File/Open file... and open an .ino file, I get an 'Inconsistent line endings' message, suggesting to modify the line ending in CR/LF, Mac CR, Unix LF etc. Wether yes or no, I get 'Would you like to open a project for sketch 'blink.ino'? 
If Yes, Visual Studio briefly blinks, but nothing happens;
If no, the file is opened but with none of the coloring its, as if it were in notepad.
Nothing in the Solution explorer.

I read the manual; reinstalled VS and Visual Micro. This is the case with all .ino files, and the Arduino soft works perfectly.

Anyone a guess at the problem (or better than a guess) ?

Thank you,
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot open sketches or they are empty...
Reply #1 - Nov 13th, 2014 at 11:40pm
Print Post  
Hi,

Thanks for the clear report. Few questions:-

Have you installed the release or beta version of Visual Micro? (tools>options>visual micro>version>version and minor version?

Can you try to create new empty win32 c++ project using file>new>project. Does the c++ project create ok?

You can see if syntax color is configured using this article
http://www.visualmicro.com/post/2011/10/09/How-to-fix-Arduino-code-color-coding-...

Thanks
  
Back to top
IP Logged
 
CeSinge
Newbies
*
Offline


Posts: 5
Location: Brussels, Belgium
Joined: Nov 13th, 2014
Re: Cannot open sketches or they are empty...
Reply #2 - Nov 14th, 2014 at 10:26am
Print Post  
Tim,

The version I show is 1.1407.10, minor 10.
I also see the license seems expired, but I suppose that's because I'm still on the free version.

But then, when you talk about C/C++ I realized how stupid I am  Embarrassed
Because I always work in VB.net, I never even installed the C/C++ component, so most likely, I imagine that Visual Micro relies on it...

Can't do it now, but I'll add C/C++ over the weekend and come back to you, were it only for others, later on...

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot open sketches or they are empty...
Reply #3 - Nov 14th, 2014 at 12:50pm
Print Post  
Great, thanks

By the way Microsoft release Visual Studio 2013 community this week. It's free, a full version of vs and very good.

Unless you are using xp I recommend updating from 2008
« Last Edit: Nov 14th, 2014 at 12:51pm by Tim@Visual Micro »  
Back to top
IP Logged
 
CeSinge
Newbies
*
Offline


Posts: 5
Location: Brussels, Belgium
Joined: Nov 13th, 2014
Re: Cannot open sketches or they are empty...
Reply #4 - Nov 16th, 2014 at 12:17pm
Print Post  
I may consider VS2013 Community, but I have a VS2012 that I do not use because I find the look and feel awful to use. But the problem is the same for both versions anyway, so it's not even sure VS2013 would be better.

So I added and tested the C/C++ components and they work fine.
Result is partially better: With File/Open File, I can open an .ino and it shows colored syntax, however there's no way to compile or push the file to the board. F5 does just nothing at all (and compiling does work in C or VB).

And if I do File/Open/Sketch Project, I get Automation server can't create object and a 0x800A04AD error. Sad

As always, I already reinstalled Visual Micro, repaired VS (it works for everything else), and looked up this error code, but I see nothing that helps.
Any clue?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot open sketches or they are empty...
Reply #5 - Nov 16th, 2014 at 4:42pm
Print Post  
2013 is a lot better than 2012.

The error you see is being returned from the Visual Studio macro that creates a "new empty win32 c++ project not using ATL"

This means the new empty win32 c++ template is not installed correctly. It is part of the standard c++ pack for vs. You should see the same error of you attempt to create the specific project type you mention.

That's what vm does to create an arduino sketch. First it asks Visual Studio to create an empty c++ project then it adds a .ino source file. the folder, the project name and the .ino will all have the same name which causes Visual Micro to manage the project. So it's a simple system  Smiley
  
Back to top
IP Logged
 
CeSinge
Newbies
*
Offline


Posts: 5
Location: Brussels, Belgium
Joined: Nov 13th, 2014
Re: Cannot open sketches or they are empty...
Reply #6 - Nov 19th, 2014 at 11:33pm
Print Post  
Tim,

Thank you for your help. I both completely uninstalled and reinstalled VS 2008, and also installed the new VS2013, but the result is the same: error message given below. I more or less understand your explanation and indeed, I get this error precisely when (it seems that) Visual Micro attempts to create/insert the ino file in the solution.

Googled a lot to no avail. I noticed that after the error I end up with an empty Solution. In there, Add Existing Sketch project fails, but Add Existing Item at least opens the file.
But then still, no compile option and F5 does nothing.

If I understand what you say, yes, I can perfectly create a new empty win32 c++ project (file/new/Win32 project: Visual C++), and I can add a source file and edit it, syntax check it etc. But there again, the three options (in Source Files/Add item) of VM remain dimmed. So I'm not sure about what you mean by the C++ template not installed correctly...

Bottom line is that I think I'll unfortunately have to give up with Visual Micro. Reinstalling my whole system is not an option I want to consider.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot open sketches or they are empty...
Reply #7 - Nov 19th, 2014 at 11:51pm
Print Post  
Hi,

Thanks for the info. You certainly don't need to re-install anything there will be some simple explaination because so many people use Visual Micro.

The test to create an empty c++ project was just to prove you have c++ installed.

Visual Micro will "come alive" if the arduino rule for sketch names are followed along with 1 extra rule:-
  • Directory name and sketch.ino must be the same
    The Visual Studio C++ project must have the same name and .vcproj .name

Anyway as for the problem. If you have the energy to look at the following I hope you can see what Visual Micro is trying to do.

How does Visual Micro create a project in Visual Studio

1) Get the Visual Studio C++ templates path

2) Runs the Visual Studio "Launch new project wizard" macro for the "emptyproj.vsz" in the templates path discovered in 1)

The Visual Studio C++ templates path should be easy to find in tools>options and then easy to see if emptyproj.vsz exists?

Thanks
« Last Edit: Nov 20th, 2014 at 12:12am by Tim@Visual Micro »  
Back to top
IP Logged
 
CeSinge
Newbies
*
Offline


Posts: 5
Location: Brussels, Belgium
Joined: Nov 13th, 2014
Re: Cannot open sketches or they are empty...
Reply #8 - Nov 20th, 2014 at 10:35pm
Print Post  
Tim,

So I could find the  "emptyproj.vsz" by doing a full search of C:, in 
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcprojects

I realise the vsz files in that folder and subfolders exactly match the File/New Project templates from VS2013 (Installed/Templates/Other Languages/Visual C++): The 'Empty Project' is there.


VSWIZARD 7.0
Wizard=VsWizard.VsWizardEngine.12.0
Param="WIZARD_NAME = EmptyProject"
Param="RELATIVE_PATH = VCWizards\AppWiz\.NET"
Param="WIZARD_UI = FALSE"
Param="MANAGED = FALSE"
Param="WIZARD_ID = 54"


I see that if I create a new project with this template, I also get the 'Automation Server can't create object' error message ! So, it's clearly not a VM specific issue.
The file above points to VCWizard\Appwiz\.Net, where I find \EmptyProject\Scripts\1033 containing a default.js.

I will try to see if I can analyze this file - but not any more tonight Wink
Thank you again. I maybe cornering the issue now!

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot open sketches or they are empty...
Reply #9 - Nov 22nd, 2014 at 5:06pm
Print Post  
Interesting sounds like something like the windows scripting system needs a repair.

If you don;t get to the bottom of it easily you don't need to create a project you can use the empty one in the zip of this message.

As I said earlier if the right rules are encountered Visual Micro will handle any project as an Arduino project

You can place the project file in any sketch folder and then open it but you must ensure the following before Visual Micro becomes active for the project.

1) Rename the project file to match the sketch name.
2) Open the project with vs 2013 and again rename the project in the solution explorer (vs sometimes allows the project file name and internal name to differ).
3) Close and reopen the project. Visual Micro should automatically add the sketch sources to the project and everything should work.

To create a new project

1) Create a new folder (keep the name less than 30 chars, no spaces, usual arduino naming rules)
2) Copy the project file from the zip to the new folder
3) Rename the project to the same as the folder
4) Open the projectin vs2013
5) Again, rename the project in the solution explorer tree to the same name as the folder in 1)
6) Add a new cpp file to the project
7) Rename the .cpp to .ino and give it the same name as you used in 1)
8) Add a void setup() {} and void loop() {} methods then click compile

« Last Edit: Nov 22nd, 2014 at 5:08pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint