Wednesday, February 23, 2011

Signware Sample Application Usage/Development Manual

I am trying to write/develop my own Module to use Wacom STU-500 LCD Signature Tablet. This tablet does not use the mouse event but its own Handle Calls & WIN API's where the sample Applications with source can be found HERE by softpro GMBH.

Setting up the environment for running samples of signWare:

  • copy all Include files given in c-api folder of signware to C:\windows\system32 folder.
  • Set the environment variable. Set the PATH to
    ;C:\ProgramFiles\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files\Microsoft Visual Studio 9.0\VC\include;
  • edit License file given with Signware application to set correct path to the license. And double click it for registering.

The signware Module needs a better understanding of WIN API's call.
So, I started learning basics of WIN API's Calls or in general Windows system programming.
I found many tutorials but I found some Good WIN API's tutorial for beginners which I want to share.

Link1: http://winprog.org/tutorial/start.html

Link2: http://www.dreamincode.net/forums/topic/207581-intro-to-the-windows-api/

Link3: http://www.functionx.com/win32/Lesson01b.htm (Good for understanding Details of various options given)

Problems I faced for compilation of the modules:

nmake15 : It is an self extraction zip file. But there is a bug. When you double click on this file to extract it, you'll get some ACCESS DENIED or privilege problem.
Don't Worry. Use your regular unzip files like winzip, unrar etc. This will work.

windows.h problem: If you find error.

" fatal error C1083: Cannot open include file: 'Windows.h'. "

Then you need to set the path. Here is the link from where I found the solution.

In short, you need to edit the batch file given in visual studio which is responsible for setting up the environment. The batch location is given below (That is for me. find yours).
c:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat

You can also edit this batch file to INCLUDE your own custom include/bin files into the PATH option provided into it.

Then create a shortcut of cmd.exe. Then copy & paste the full command given below (keeping in mind about the correct PATH):
%windir%\system32\cmd.exe /K "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
You can use or have a look on my vsvars32.bat file.

Double click on the new CMD shortcut and you are ready for compiling the Windows module from the command line.

Wednesday, February 16, 2011

QT with Microsoft Visual studio VC++

I struggled a lot to find an efficient way to use QT with VC++ tool for programming graphics. Now as I manage to find the elegant solution for it which I want to share with the world.

If you found this compilation error in your Microsoft Visual Studio instead QT is installed in your system:

1>LINK : fatal error LNK1181: cannot open input file 'qtmaind.lib'
1>Project : warning PRJ0018 : The following environment variables were not found:
1>$(QTDIR)


The reason for the above compilation error is that the QT binary path is not set.

I assume that your QT is installed in windows system partition "C:\Qt" like me else use your own path to Qt directory.

You need to SET the PATH of in SYSTEM VARIABLE given in ENVIRONMENT VARIABLE of Windows.

How to find ENVIRONMENT VARIABLE on windows?

Steps:
1. Right Click on "My Computer" Icon.
2. click "Properties"
3. click on "Advanced" Option ("Advanced system setting" in case of Vista)
4. You will find the "Environment Variable" somewhere Below.
5. Please find "System Variable".
6. Please find "PATH" inside "System Variable".
7. Click on Edit button when you find PATH.
8. Copy & Paste the following PATH at the end of the line

;C:\Qt\4.7.1\bin;C:\Qt\4.7.1\include;C:\Qt\4.7.1\include\Qt


9. Save & EXIT.

Look into the QT menu given in "Start -> All Programs".

You'll find a shortcut named "Visual Studio with Qt 4.7.1". If not, the you can find it in c:\Qt\4.7.1\bin\ Batch script name
qtvars.bat


Double Click on "qtvars.bat". It will

1) set the environment and exit.
2) OR/AND open "Microsoft Visual Studio linking with QT"

If Steps 1 & 2 works then you are ready to Programming. :)))

else

OR option is given because if you install QT first before installing Visual studio then the source code of the script will only look like

@echo off
rem
rem This file is generated by the Qt installer
rem

echo Setting up a Qt environment...

set QTDIR=C:\Qt\4.7.1
echo -- QTDIR set to C:\Qt\4.7.1
set PATH=C:\Qt\4.7.1\bin;%PATH%
echo -- Added C:\Qt\4.7.1\bin to PATH
set QMAKESPEC=win32-msvc2008
echo -- QMAKESPEC set to "win32-msvc2008"


This script only set the environment variable.

So, you need to add some scripts to run Visual Studio with QT together. Please copy & paste the following code at the end of the script.


if not "%1"=="vsvars" goto ENDVSVARS
call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"

:ENDVSVARS

if not "%1"=="vsstart" goto ENDVSSTART
call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
devenv /useenv
:ENDVSSTART


CAUTION: Don't forget to give your own path & directory name of the Visual studio to the batch file.

Save & Exit.

Double click on the Script and boom.. it will work. :)))

If you want to run from command line then use the following command
c:\Qt\4.7.1\bin\qtvars.bat vsstart


Please put a shortcut on desktop in case you do not have any.

Hope this may help you!!! :)

Saturday, February 12, 2011

DO-178B/ED-12B

My Research Paper on DO-178B/ED-12B software standards and certification for civil Aviation.