If you haven't followed this series before, the parts before this one were:
- MySQL Cluster on Windows - NDB API part 1 - Where I go through the basics.
- MySQL Cluster on Windows - Not so NDB oriented: Set up a dev environment - Where I show how to set up a reasonable development environment for NDB MGM API on Windows
- MySQL Cluster on Windows - NDB API part 3 - The code - Where I show the code for a small, but complete and somewhat useful, application
So, the file NDBMonitor.rc really should look like this:
#include "resource.h"Not much, but somewhat, different than before. OK, so we are OK so far, now we will build the thing. We have prepared the MySQL Cluster libraries and includefiles and stiff like that before, but I will assume a few things going forward:
#include "WinUser.h"
#define IDC_STATIC (-1)
IDD_DIALOG_MAIN DIALOGEX 0, 0, 310, 194
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "NDB Monitor"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN DEFPUSHBUTTON "OK",IDOK,253,173,50,14
LISTBOX IDC_LIST_NODES,7,23,186,164,LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
LTEXT "Connect string:",IDC_STATIC,7,7,55,14,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_CONNECTSTRING,63,7,182,14,ES_AUTOHSCROLL
PUSHBUTTON "Connect",IDC_BUTTON_CONNECT,253,7,50,14
PUSHBUTTON "Refresh",IDC_BUTTON_REFRESH,199,173,50,14,WS_DISABLED
END
- MySQL Cluster is installed in C:\MYSQL714b
- Microsoft Visual Studio, and the Express version is fine for this exercise, is located in C:\Program, Files\Microsoft Visual Studio 9.0
- Microsoft Windows SDK is installed at C:\Program Files\Microsoft SDK2\Windows\v7.0a (This is part of Visual Studio 2008)
MYSQL_HOME=C:\MySQL714bNow we are nearly ready to begin building our application, if you installed Visual Studio 2008 the usual way, then you can start a command prompt with the appropriate environment by using the Start->Programs->Microsoft Visual C++ 2008 Express Edition->Visual Studio Tools->Visual Studio 2008 Command Prompt. Alternatively, make sure that you have the following directories in your path in a DOS Window:
VSHOME=C:\Program Files\Microsoft Visual Studio 9.0
SDKHOME=C:\Program Files\Microsoft SDKs\Windows\v7.0A
CC="$(VSHOME)\VC\bin\cl"
RC="$(SDKHOME)\bin\rc"
RCINCLUDE=/i "$(SDKHOME)\include" /i "$(VSHOME)\VC\include"
CFLAGS=/TP /MT /D "WIN32" /D "_WINDOWS" /I "$(SDKHOME)\Include" \
/I "$(VSHOME)\VC\Include" /I "$(MYSQL_HOME)\include" \
/I "$(MYSQL_HOME)\include\storage\ndb"
LDFLAGS=/LIBPATH:"$(SDKHOME)\lib" /LIBPATH:"$(VSHOME)\VC\lib" \
/LIBPATH:"$(MYSQL_HOME)\lib" \
/LIBPATH:"$(MYSQL_HOME)\lib\opt" /MACHINE:X86 ndbapi.lib \
ndbmgmapi.lib mysys.lib ndbclient.lib ndblogger.lib \
wsock32.lib strings.lib kernel32.lib user32.lib gdi32.lib \
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
NDBMonitor.exe: NDBMonitor.c NDBMonitor.res
$(CC) $(CFLAGS) NDBMonitor.c /link $(LDFLAGS) NDBMonitor.res
NBDMonitor.res: NDBMonitor.rc
$(RC) $(RCINCLUDE) /fo NDBMonitor.res NDBMonitor.rc
- C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
- C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
- C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin
Not very exciting, I know, but if you type in the connect string to a MySQL Cluster management node, like localhost:1186 in the Connect string edit box and click Connect, then you will see the status of that Cluster in a simple way, like this:
Click the Refresh button to refresh the status shown in the listbox. So that's it for now. Happy Clustering folks!/Karlsson
1 comment:
This blog really is doing great for me. This blog also offers me more ideas and knowledge. Thanks!
----------------------
performance testing
Post a Comment