Nov
07
2008
0

Debugging and Logging in wxWidgets with wxLogWindow

wxLogWindow make it much easier to debugging and logging.

in the constructor add the following code:

#if defined(__WXDEBUG__ )
    //logging and debugging
    wxLogWindow *w= new wxLogWindow(this, wxT(”Logger”));
    w->Show();
#endif

Then, in anywhere, add the following:

wxLogDebug(wxT(”Debug message”));

If you are running in Debug build target, it’ll show a small console and displaying all the messages. If you are running in release mode, that console won’t appear and thus no log messages there.

Written by hkai in: wxWidgets | Tags:
Nov
07
2008
0

Setup wxWidgets and Code::Blocks on Windows Vista

Since I’m going to extend my knowledge of programming, I selected wxWidgets as the next target. It has some advantages when comparing with other frameworks:

  1. cross platform: vs Win32, Cocoa, Gnome, KDE
  2. can develop commercial applications: vs Qt
  3. has more features: vs FLTK
  4. active community

So here’s how to setup wxWidgets on Windows Vista. I assume you already setup MinGW and Code::Blocks.

  1. download and install wxWidgets: wxMSW-2.8.9-Setup.exe, I installed it to c:\apps\wxWidgets-2.8.9
  2. endter the directory wxWidgets-2.8.9\build\msw, run the command:
    make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1
    make -f makefile.gcc BUILD=debugSHARED=1 MONOLITHIC=1 UNICODE=1
  3. after finished, copy wxWidgets-2.8.9\lib\gcc_dll\wxmsw28u_gcc_custom.dll and wxmsw28ud_gcc_custom.dll to c:\windows\system32
  4. start code::blocks, create a wxWidgets project, when asking wxWidgets Library Settings, check the Use wxWidgets DLL, wxWidgts is built as a monolithic library and Enable unicode
  5. build and run the project, you should have your 1st wxWidgets applications with wxSmith GUI editor.

Here’s some wxSmith tutorial

Written by hkai in: C/C++ | Tags: , ,
Nov
07
2008
0

Setup C++ Development using MinGW, Code::Blocks on Windows Vista

Download and install MinGW:

1. download MinGW-5.1.4.exe, create c:\MinGW, and run it. It’ll download and install the current stable version of GCC, G++ etc.

2. set the environment, add c:\MinGW\bin;C:\MinGW\libexec\gcc\mingw32\3.4.5 to PATH

2.1 download gdb and extract to c:\MinGW

2.2 start a console, make sure you can run gcc -v and gdb -v

3. download code::blocks 8.02, install and start it

3.1 in code::blocks, settings->Global compiler settings, selected compiler=GNU GCC Compiler, then add the following into Search directories

Compiler tab

C:\MinGW\include
C:\MinGW\include\c++\3.4.5
C:\MinGW\include\c++\3.4.5\backward
C:\MinGW\include\c++\3.4.5\mingw32
C:\MinGW\lib\gcc\mingw32\3.4.5\include

Linker tab

C:\MinGW\lib
C:\MinGW\lib\gcc\mingw32\3.4.5

Resource compiler tab

C:\MinGW\include

Note if your GCC is not 3.4.5, please change to the correct version.

Now the most important part: START THE PROJECT in C: , don’t in D:, if you start the project in other disk, you’ll get the following error when you compile a standard C project:

ld: crt2.o: No such file: No such file or directory

I don’t know the reason, but if you copy crt2.o, crtbegin.o and crtend.o to the project directory, it’ll be able to show you another issue:

undefined reference to `WinMain@16′

If the project located at c:\somedir, the those issues will disappear. What a strange thing!

Written by hkai in: C/C++ | Tags: , , ,
Oct
25
2008
0

Switching Debian repository

While running apt-get update, I found one of the source repository debian.cn99.com is not responding, so I checked the Debian mirror page, there’s another repository “www.anheng.com.cn” good enough in China, so I decide to switch my repository to it. Here’s the steps:

1. edit /etc/apt/sources.list, comment out the old repository in case we’ll need to resume it later.

2. add the following 2 lines:

deb http://www.anheng.com.cn/debian/ etch main non-free contrib
deb-src  http://www.anheng.com.cn/debian/ etch main non-free contrib

3. save the file and run: apt-get update

Written by hkai in: Linux Debian | Tags: , , ,
Aug
21
2008
0

Install flash plugin on Debian 4.0

1. download install_flash_player_9_linux.tar.gz from www.adobe.com

2. extract to a folder, close your browser, then run ./flashplayer-installer

3. when asking installation path of the Mozilla, Netscape, or Opera browser, typein /usr/lib/iceweasel

4. start browser, in the address type in about:plugins

Written by hkai in: Flash/Flex, Linux Debian |
Aug
19
2008
0

Installing Debian without burning CD

If you have a windows machine and would like to install debian onto your system, and don’t have access to a CD-RW, here is a software you can use to install Debian onto your system

Install Debian Without burning CD

Written by hkai in: Linux Debian |
Aug
13
2008
2

Flex in a week video training: Day 3

http://www.adobe.com/devnet/flex/videotraining/

Note for exercise 3.2: Using RemoteObject to send data to the server
I followed the URL to download lcds but get version 2.6. So there’s some difference with the exercise.

  • 3. lcds 2.6 installed with tomcat
  • 4. the exercise file is ex9_server.zip, I unziped it into \lcds\tomcat\webapps, it created a odt directory
  • 5. start lcds: All Programs > Adobe > LiveCycle Data Services ES 2.6 > Start LiveCycle Data Services Server
  • 6. the url is http://localhost:8400/odt
  • 17. the root folder is C:\lcds\tomcat\webapps\odt
  • 18. the root url is http://localhost:8400/odt/
  • 22. the out folder is C:\lcds\tomcat\webapps\odt\adobeODT-debug
    adobeodt.jpg
  • 28. the url is http://localhost:8400/odt/adobeODT-debug/AdobeODT.html

exercise 3.1: Validating form data

exercise 3.2: Using RemoteObject to send data to the server

exercise 3.3: Implementing drag and drop between components

Note: in step20, the code is: rf.selectedRoom= dropData[0];

exercise 3.4: Using XML with E4X

Written by hkai in: Flash/Flex, Learning Track |
Aug
11
2008
0
Aug
06
2008
1

Java Programming with Passion: Week1

It’s been 2 years since my last Java project. I decided to spend sometime to renew my Java knowledge by taking Sang Shin’s course.
I’ll report my progress and upload my finished homework here.

You can find the tutorial hereĀ 

Written by hkai in: Java, Learning Track |
Aug
06
2008
1

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes