Thanks for visiting Electrical Engineering Equipment Company. Please remember to bookmark this page 40 Header Strip. If you found what your looking for, then don"t forget to click an appreciation button above for this post.
![]() 10 strip 40 Pin 2.54 mm Single Row Pin Header Strip PCB US $1.99
|
![]() 200 pcs 40 Pin 2.54 mm Single Row Pin Header Strip PCB US $24.99
|
40 Header Strip
Visual Studio 2008 configuration for SmartWin GUI development
"SmartWin++ is a 100% free C++ GUI and SOAP library for developing Windows applications both on Desktop, Pocket PC, Windows Mobile or Windows CE based systems."
http://smartwin.sourceforge.net/
Ok, first thing we have to get it. Here we go:
http://sourceforge.net/projects/smartwin/files/smartwin/
This tutorial describes how to install, build and configure SmartWin++ GUI library Release version without unicode support.
Assuming we got an executable installation file, lets run it! The following window appears:
We just hitting Next button a couple of times…
Default location for smartwin installation, its fine with me. Another couple of time we are hitting Next button and then we see the installation process itself.
After all we have following window:
Let me make a decision for you, we are not checking any of those options, just hitting Next button and Finish.
Now we are heading to SmartWin++ installation folder
(c:smartwin) and looking for SmartWin.sln file
(visual studio solution file right).
Ok, double click, pass convertion, and here we go, the smartwin project:
(remember to change to release version like you see on the pic.)
Alright, but first, before we are going to build whole thing, we need to tell compiler where to find header files.
Tools --> Options --> Projects and Solutions --> VC++ Directories --> Show directories for --> Include Files.
And we are adding smartwin++ include folder.
Ok, we got it done. Now just build the solution (F7).
Our result should appear in c:smartwinlib, lets check it out.
Here it is: SmartWin.lib file. Ok, so now we should add path to this library, so we are doing same thing we did previously. Go to:
Tools --> Options --> Projects and Solutions --> VC++ Directories --> Show directories for --> Library Files. And add a path:
We are done with configuring smartwin. Lets create some small project for now for testing purposes.
The great thing about SmartWin library is that it comes with dozens of ready to build examples, which explains how to use every widget (we got widgets here, they are like windows controls but a bit different).
So I'll just going to take some of these, strip it down a bit just to show main idea behind it.
#include
using namespace SmartWin;
// The "factory" version
class WidgetTest1
: public WidgetFactory< WidgetWindow, WidgetTest1 >
{
public:
WidgetTest1()
: Widget()
{}
bool shouldClose()
{
if ( createMessageBox().show( _T( "Should I close" ), _T( "Closing question" ), WidgetMessageBox::BOX_OKCANCEL )
== WidgetMessageBox::RETBOX_OK )
return true;
return false;
}
void createMainWidget( const SmartWin::Seed & cs )
{
// Member version
onClosing( & WidgetTest1::shouldClose );
onKillFocus( & WidgetTest1::killFocus );
onFocus( & WidgetTest1::focus );
setMinimizeBox( true );
setMaximizeBox( true );
}
void killFocus()
{
setText( _T( "No Focus" ) );
}
void focus()
{
setText( _T( "HAS Focus, Hooray!" ) );
}
void initAndCreate()
{
WidgetWindow::Seed cs;
cs.background = CreateSolidBrush( RGB( 0, 0, 125 ) );
cs.caption = _T( "WidgetWindow ( factory ) compile and execute test" );
onCreate( & WidgetTest1::createMainWidget );
createWindow( cs );
this->setBounds( 0, 0, 400, 200 );
}
};
int SmartWinMain( SmartWin::Application & app )
{
// Widget (Factory) version
WidgetTest1 * testWnd1 = new WidgetTest1;
testWnd1->initAndCreate();
testWnd1->setFocus();
return app.run();
}
As you can see it's pretty straightforward and easy to get a point (you should examine every example as well). You can easily mix this code with win32 api, NT api, just like you would do while writing pure win32 app (I mean while it is classes based framework you are still able to use global variables, functions, etc, you are not limited to put everything into classes like while working with mfc, for example, or gtkmm), except here your app will have a bit bigger size (win32-> 20Kb, SmartWin++ -> 250Kb) but who cares about bytes these days right? hehe…
To successfully build the above code we have to do a couple of things.
Set project to Release version
Character Set --> Use Multi-Byte Character Set
C/C++ --> Code Generation --> Runtime Library --> Multi-threaded (/MT)
Else you'll get around 40 errors while building an app. That's it! Now you can examine smartwin examples and make your mind about using it or not. My opinion is:
it is easier then win32 api and the code is smaller, but when you will build a huge app (lets say, hmm, like 3dsMax for example ) you'll see how much slower it is, you'll see how widgets will be drawn one after another with a delay. There are a couple of other smaller bugs too. I was about to use it but, I have chosen to not. Anyway, it is great solution for smaller applications (lets say, you are going to code some dialog based app, where you got a form builder etc, but dialog based app, emmm, is pretty much immature application, in this case you should really consider using smartwin) and a great work! It's just not for a bigger commercial projects.
Machinized Fractals
www.machinized.com
About the Author
Segmentation Fault, core dumped.

If you are looking for a different item here are a list of related products on Electrical Engineering Equipment Company, please check out the following:


















































































