Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey All,

I am attempting to develop a GUI for a program and have downloaded the "Ultimate++" Software to attempt at doing this. I will be using the GUI to control Agilent lab instruments so as to make lab testing more efficient and time effective.

I want to have the user select/enter a Frequency, Power Rating, A Saved Resgister File, and View a screenshot of the Spectrum Analzer screen. From here the image can be saved and the user can select where specifically.

I have already gone into Ultimate++ and created the layout, but the biggest and most important issue is that I am not sure how to properly code these functions as I have never used the software before and am not well versed with it. The largest issue of concern is adding/using the correct library compatible with the Agilent instruments.

The libraries I use are:
C++
#include <"stdafx.h">
#include <"visa.h">
#include <iostream>
#include <fstream>
using namespace std;


After compiling and debugging the initial setup it was reading errors like: " fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory..."

How should I fix these errors/change the code to allow for the project to compile?

I also am not completely sure how to go about programming the fucntionality of a button to operate as it should be by designation. From SCPI commands to C++ conversion programming a frequency would look like this:

viPrintf(v5182_signal_generator, ":Freq 1400 MHz\n");

and if the library I used previously in MVC++ can no longer be used I am unsure how to go about programming a function button/utility. If this is the case would I need to develop my own driver to do this?

Taking on this project was a challenge from the start with my limited programming experience so any input/feedback/recommendations would be greatly appreciated!

Thanks in Advance!

Here are the code documents:
main.cpp:

C++
#include <stdafx.h>
#include <visa.h>
#include <iostream>
#include <fstream>
using namespace std;



maTest::maTest()
{
    CtrlLayout(*this, "Window title");
}

GUI_APP_MAIN
{
    maTest().Run();
}

Test.h:
C++
#ifndef _maTest_maTest_h
#define _maTest_maTest_h

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define LAYOUTFILE <maTest/maTest.lay>
#include <CtrlCore/lay.h>

class maTest : public WithmaTestLayout<TopWindow> {
public:
    typedef maTest CLASSNAME;
    maTest();
};

#endif

Layout File:
maTest.lay
C++
class maTestDlg : public WithmaTestLayout<TopWindow> {
    typedef maTestDlg CLASSNAME;

public:
    maTestDlg();
};

maTestDlg::maTestDlg()
{
    CtrlLayout(*this, "");
}
Posted
Updated 11-Jul-12 9:19am
v2
Comments
Sergey Chepurin 12-Jul-12 8:00am    
From Wikipedia (http://en.wikipedia.org/wiki/Ultimate%2B%2B): "it doesn't use the Standard Template Library (STL)". May be you should reconsider your choice of GUI framework?
Or it will be not C++.

Quote:
After compiling and debugging the initial setup it was reading errors like: " fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory..."

Well that's rather self-explanatory, the compiler can't find the stdafx.h file in any directories you specified as part of your project.

Quote:
If this is the case would I need to develop my own driver to do this?

Usually no, you need to look at the hardware specs to see how you can trasmit the commands over to the piece of equipment. It's likely a TCP/IP socket connection or a serial connection of some sort (hardware dependent).

[edit]
By the way, stdafx is usually the name of the precompiled header made (by default) by the MS IDE (Visual Studio). If you did not include it as part of your source for Ultimate++, it probably shouldn't be included (in another words, if you didn't generate it yourself, don't #include it).
 
Share this answer
 
v2
You might benefit from this Getting Started With Ultimate++[^]
 
Share this answer
 
IMO, in 2012, you don't need third party UI toolkit (*) for 99% of the software out there; you will find that they were created to fix small issues or add features that are not always useful; and support for them will be less than ideal if there are crash and bugs with them (not that MFC is bugless).

MFC offers enough features to be able to create "powerful" (gasp) User Interface that will be easy enough to be used by the majority of the users.

Have a look at the User Experience Guideline (1) and all the MFC samples (2)

Learn MFC (and accessory Win32).

(*) except for really specific items.
(1)Windows User Experience Interaction Guidelines[^]
(2) MFC Feature Pack samples[^]
 
Share this answer
 
Comments
Stefan_Lang 12-Jul-12 11:12am    
Personally, I consider MFC bad enough to use anything but this! But that's just my preference - to each his own ;-)
stdafx.h is autogenerated by the VisualStudio IDE as a means to create precompiled headers, which are used to speed up compilation in large projects. If you copied your .cpp and .h fiels form such a project, you should find that file right there. Just copy it over to your new project directory.

If you don't find it, you can just remove the include. However, you will then likely miss the appropriate headers for MFC or Windows: try to include "afx.h" or windows.h" in that case (this is what "stdafx.h" does for you, normally).

Note that there is also a free version of VisualStudio (called "Express"). If all else fails you could install that, create a Windows project, and copy the stdafx.h from there. (Or you could just work with VS ;-) )

P.S.: all of this assumes you are developing for Windows (only). As I just realized, Ultimate++ is a tool for cross platform development. If that is your goal, ignore the above!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900