|
|
Home » Community » Newbie corner » Hello, need a helping hand
|
Re: Hello, need a helping hand [message #26831 is a reply to message #26830] |
Tue, 01 June 2010 15:55   |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
jerson wrote on Tue, 01 June 2010 15:11 | Hi folks
I'm an absolute newbie to C++ coding and UPP. I code in C and VB6. I stumbled upon UPP a few days back and find it really interesting; however, my lack of knowledge about C++ and UPP is only making it difficult to cross the initial barriers.
I have worked with the examples and am able to run almost all of them. There are some that I cannot understand that report errors(in the uppsrc directory). I work on a WinXP machine.
Right now, I am able to create the example code called shopping list I found on the www. This was a very nice example to learn UPP. However, the next step has frustrated me and I will like a helping hand if anyone can.
On the layout, I wish to place a slider control visually (if that is possible) and link it to a text label that will show the value of the slider. I am able to place the static text label & name it. But, how do I place the slider? I suspect it has to be done in code. Being a total newbie in UPP and a total zero in C++ means a double whammy and I'm stuck. I want to migrate away from VB6 and come to UPP.
I intend to add new controls and eventually graduate to creating a simple RS232 terminal for my own use while 'learning the ropes'
Can anyone guide me gently please ?
I will appreciate links too if this is something I missed here.
Thanks
|
Hello Jerson
Yes, you can enter the SliderCtrl in the Layout designer.
If you right click the mouse in the Layout designer and choose Progress/SliderCtrl you will get it.
To do it in a very simple way you can get the package Reference/Layout, and modify it adding an SliderCtrl.
For example, in Layout example after adding:
- a SliderCtrl named slider
- a Label named text;
, change the code with this:
void Slider() {
text = AsString(~slider);
}
GUI_APP_MAIN
{
WithDialogLayout<TopWindow> dlg;
CtrlLayoutOKCancel(dlg, "Enter a number");
dlg.number <<= 10;
dlg.slider <<= THISBACK(SliderFunc);
for(;;)
switch(dlg.Execute()) {
case IDOK:
PromptOK(AsString(~dlg.number));
break;
case IDCANCEL:
return;
}
}
I advise you to follow this:
1. Check the samples:
After that you like U++.
2. Read the documentation:
After that you understand
3. Check the samples you prefer again and read the code
After that you really understand
Best regards
Iñaki
|
|
|
Re: Hello, need a helping hand [message #26832 is a reply to message #26830] |
Tue, 01 June 2010 16:04   |
|
Hi Jerson,
Welcome to U++ ! 
It is of course possible to create the application GUI visually. Have a look at the GUI tutorial, section 16 describes the basics. To get into the layout designer, just add a file with .lay extension into you package. Any widget, including SliderCtrl, can be added by right-clicking in the design area and selecting them from the context menu.
As for RSS232, there are already some classes ready to use, it should be not too hard to create a simple terminal for educational purposes 
Don't be afraid to ask questions. You can do it here, or you can try your luck on our irc channel #upp on slashnet.org (webclient), most of the time there is someone present.
Best regards,
Honza
PS: I see Koldo was faster to answer... Anyway, one more opinion never hurts
[Updated on: Tue, 01 June 2010 16:11] Report message to a moderator
|
|
|
|
Re: Hello, need a helping hand [message #26839 is a reply to message #26838] |
Tue, 01 June 2010 20:46   |
|
jerson wrote on Tue, 01 June 2010 20:07 |
If it helps, the zip I downloaded is upp-mingw-605.zip for the windows platform.
|
Yes, that helps a lot - that is a 4 years old version, SliderCtrl wasn't born yet back then 
You should grab a latest stable (nightly builds are not available today...). Installing that over your previous installation should help to solve the slider problem, plus you get improved sources and theide 
As for mingw: You might experience some troubles, especially if you want to do multithreaded apps later. There were good reasons to stop providing the bundled packages some time ago. You should consider installing freely downloadable M$ Visual C++ Express compiler and windows SDK. Or at least TDM release of mingw, it is reported to work much better.
Honza
|
|
|
|
Re: Hello, need a helping hand [message #26892 is a reply to message #26842] |
Mon, 07 June 2010 06:09   |
jerson
Messages: 202 Registered: June 2010 Location: Bombay, India
|
Experienced Member |

|
|
Hello
I'm back again with a little more understanding than when I first started here. I have been able to work through most of the tutorials and wanted to have a 'feel' of the bazaar apps. I tried some apps and except the GUI MT variety, the normal GUI variety works. For example, the Controls-4Udemo gives me this
----- CtrlLib ( GUI MT GCC BLITZ WIN32 ) (1 / 17)
----- Controls4U ( GUI MT GCC BLITZ WIN32 ) (2 / 17)
Controls4U.cpp
In file included from C:/MyApps/Functions4U/Functions4U.h:410,
from C:/MyApps/Controls4U/Controls4U.h:5,
from C:\MyApps\Controls4U\Controls4U.cpp:5:
C:/MyApps/Functions4U/Functions4U_Gui.h:67:7: warning: no newline at end of file
Controls4U: 1 file(s) built in (0:08.17), 8172 msecs / file, duration = 8344 msecs
----- plugin/gif ( GUI MT GCC BLITZ WIN32 ) (3 / 17)
----- plugin/jpg ( GUI MT GCC BLITZ WIN32 ) (4 / 17)
----- plugin/tif ( GUI MT GCC BLITZ WIN32 ) (5 / 17)
----- CtrlCore ( GUI MT GCC BLITZ WIN32 ) (6 / 17)
----- Draw ( GUI MT GCC BLITZ WIN32 ) (7 / 17)
BLITZ: DrawLock.cpp Font.cpp FontCR.cpp FontWin32.cpp FontFc.cpp Draw.cpp DrawText.cpp DrawData.cpp Drawing.cpp ImageAnyDraw.cpp DrawU
til.cpp DrawTextUtil.cpp Display.cpp Image.cpp ImageBlit.cpp RasterFormat.cpp RasterWrite.cpp Palette.cpp Raster.cpp RasterEncoder
.cpp ImageOp.cpp ImageChOp.cpp ImageScale.cpp MakeCache.cpp DrawRasterData.cpp Cham.cpp SSettings.cpp
In file included from C:/upp/out/Draw/MINGW.Blitz.Gui.Mt\$blitz.cpp:3:
C:\upp\uppsrc\Draw\DrawLock.cpp:11: error: thread-local storage not supported for this target
In file included from C:/upp/out/Draw/MINGW.Blitz.Gui.Mt\$blitz.cpp:10:
C:\upp\uppsrc\Draw\Font.cpp:273: error: thread-local storage not supported for this target
C:\upp\uppsrc\Draw\Font.cpp:335: error: thread-local storage not supported for this target
C:\upp\uppsrc\Draw\Font.cpp:362: error: thread-local storage not supported for this target
C:\upp\uppsrc\Draw\Font.cpp:363: error: thread-local storage not supported for this target
C:\upp\uppsrc\Draw\Font.cpp:364: error: thread-local storage not supported for this target
Draw: 27 file(s) built in (0:03.20), 118 msecs / file, duration = 3469 msecs
Is this because I use the mingw compiler? Is there a particular reason you recommend the VC++ express compiler over the mingw? I resisted the download of the MSVC++ compiler because it demands the .NET framework to be downloaded too. I already have .NET2.0, .NET3.0 and .NET3.5 fws on my machine. A little detail will help clear this for me since these are tools I've never used before. Are there some precompiled binaries for the bazaar apps for win32 that I can try out?
On another note, is there some kind of comparison of a real world product that uses UPP vs traditional IDEs like VB or VC? I have almost made up my mind to do the crossover and a little nudge will help make that decision for me.
Please excuse the newbiesque questions. I really am a UPP newbie and am grateful for the assistance you offer.
Thanks
[Updated on: Mon, 07 June 2010 06:11] Report message to a moderator
|
|
|
Re: Hello, need a helping hand [message #26893 is a reply to message #26892] |
Mon, 07 June 2010 08:02   |
|
Hi Jerson!
jerson wrote on Mon, 07 June 2010 06:09 | Is this because I use the mingw compiler? Is there a particular reason you recommend the VC++ express compiler over the mingw? I resisted the download of the MSVC++ compiler because it demands the .NET framework to be downloaded too. I already have .NET2.0, .NET3.0 and .NET3.5 fws on my machine. A little detail will help clear this for me since these are tools I've never used before. Are there some precompiled binaries for the bazaar apps for win32 that I can try out?
|
Yes, you hit the restrictions of mingw. The original mingw does not implement thread local storage which is crucial for MT applications. That is actually also the main reason why VC++ is recommended. But if you want to keep using mingw, you still can - just download the installer from Twilight Media Dragon site, delete the upp/mingw directory and install the downloaded one in the same place, it should work right away This version of mingw is tweaked a bit so that it supports everything U++ needs. I personally have never used VC++ (I work mainly in Linux and when I need to compile something on windows occasionally, I use mingw, because I'm lazy to install NET ).
jerson wrote on Mon, 07 June 2010 06:09 | On another note, is there some kind of comparison of a real world product that uses UPP vs traditional IDEs like VB or VC? I have almost made up my mind to do the crossover and a little nudge will help make that decision for me.
|
You can find some examples of real world apps in Applications section of this web. Also some other user created apps can be found on the designated section of this forum. Very nice example is Mindtravelers STermPro. And Sergeys industrial hardware programing is definitely a must read
jerson wrote on Mon, 07 June 2010 06:09 | Please excuse the newbiesque questions. I really am a UPP newbie and am grateful for the assistance you offer.
|
We like to see newbies here Getting used to U++ is not easy and we know it, so we try to help as much as possible. But once you get familiar with the ideas of U++, you became an addict
Regards,
Honza
|
|
|
|
|
Re: Hello, need a helping hand [message #26897 is a reply to message #26895] |
Mon, 07 June 2010 10:36   |
jerson
Messages: 202 Registered: June 2010 Location: Bombay, India
|
Experienced Member |

|
|
I have 2 versions of mingw now. Original mingw-5.1.6 that does not compile the MT demos from bazaar section(uninstalled now)
TDM-mingw-4.4.1-2 that compiles some of the demos, but gives errors for others. In the controls4u_demo, it is asking for
In file included from C:/upp/out/Functions4U/MINGW.Blitz.Gui.Mt\$blitz.cpp:3:
C:\MyApps\Functions4U\Functions4U.cpp: In member function 'bool Dll::Load(const Upp::String&)':
C:\MyApps\Functions4U\Functions4U.cpp:1741: error: 'LOAD_IGNORE_CODE_AUTHZ_LEVEL' was not declared in this scope
Functions4U: 7 file(s) built in (0:02.90), 415 msecs / file, duration = 2969 msecs
In the Ultimateplayer example, I get this. There are a lot more errors than just this.
c++.exe: WIN32: No such file or directory
UltimatePlayer.cpp
C:\MyApps\UltimatePlayer\UltimatePlayer.cpp:4:25: error: fmod_errors.h: No such file or directory
In file included from C:\MyApps\UltimatePlayer\UltimatePlayer.h:16,
from C:\MyApps\UltimatePlayer\UltimatePlayer.cpp:17:
C:\MyApps\UltimatePlayer\FMod.h:8: error: 'FMOD' has not been declared
C:\MyApps\UltimatePlayer\FMod.h:8: error: ISO C++ forbids declaration of 'System' with no type
C:\MyApps\UltimatePlayer\FMod.h:8: error: expected ';' before '*' token
C:\MyApps\UltimatePlayer\FMod.h:9: error: 'FMOD' has not been declared
Perhaps this example is meant for Linux rather than Win32.
I think it will be an uphill task till I reach some basic level with UPP 
Jerson
[Updated on: Mon, 07 June 2010 10:36] Report message to a moderator
|
|
|
|
|
Re: Hello, need a helping hand [message #26902 is a reply to message #26899] |
Mon, 07 June 2010 14:27   |
jerson
Messages: 202 Registered: June 2010 Location: Bombay, India
|
Experienced Member |

|
|
Hi Koldo
Sorry, I'm a bit lost here. I have the latest UPP 2361 build. If you meant the control4u demo from the website, I do not see a link to download it. However, changing this line which was complaining
hinstLib = LoadLibraryEx(TEXT(fileDll), NULL, LOAD_IGNORE_CODE_AUTHZ_LEVEL);
to this
hinstLib = LoadLibraryEx(TEXT(fileDll), NULL, 2);
made controls4udemo work. Now, there is some hope for me
Thanks
Jerson
|
|
|
|
Re: Hello, need a helping hand [message #27405 is a reply to message #26904] |
Thu, 15 July 2010 16:46   |
jerson
Messages: 202 Registered: June 2010 Location: Bombay, India
|
Experienced Member |

|
|
Hi Koldo
I'm back after a bit. I think I owe it to you that I have been able to get started in UPP. As such, I found it really hard to understand at first. I played a lot with the examples, bazaar projects and read the tutorials. I cannot say for sure I understand everything right now, but, I am at least 35% there in my own estimates.
I have made a screen to check out what I learnt till now and find I can really make some good progress. I need to make a few controls of my own to handle charts(I know about the scatter program) for my own needs. I think the controls4u demo shows how to make such controls with their own interface for the IDE.

However, for now, this is what I have achieved and for this I owe you a big Thank You.
I have a lot more to do in this project, but, slow and steady wins I guess.
BTW : what do these statements mean? It's a bit like greek to me.
void UWord::SerializeApp(Stream& s)
{
int version = 1;
s / version; <<== this one here
s % UWordFs() <<== and here
% PdfFs(); <<== and here
if(version >= 1)
s % lrufile();
}
-
Attachment: Upp1.gif
(Size: 31.78KB, Downloaded 806 times)
|
|
|
|
|
|
Goto Forum:
Current Time: Sun Apr 27 00:15:17 CEST 2025
Total time taken to generate the page: 0.02645 seconds
|
|
|