Building a DataBlade DLL with Microsoft DevStudio Jean T. Anderson October 9, 2000 © 2001 International Business Machines Corporation. All rights reserved. Introduction The easiest way to build a DataBlade DLL for NT is to use the DataBlade Developers Kit (DBDK), which provides a direct hook to Microsoft DevStudio. However, you must use the DBDK-generated source code and directory structure. Some DataBlade developers want to build a project that conforms to their company code style and directory structure. With that in mind, this technical note explains how to build a DataBlade module from scratch with Microsoft DevStudio and without DBDK. If you do not use DBDK to generate source code, it is still important to use DBDK to generate SQL scripts so that the DataBlade module can be registered using BladeManager. Contents Sample Project This simple project creates a user-defined routine (UDR) that outputs the message "Hello World!". It requires the two files listed below: Contents Creating a DevStudio Project These instructions were tested with Microsoft DevStudio version 6.0. This simple project does not have any header files. To add header files, you would set Files of type to "C++ Include Files". You can verify which files got added by selecting Project->Settings. Click on the + sign to the left of hello, then click on the + sign to the left of Source Files. This step requires setting the link and include paths. Select Project->Settings Select the Link tab: Set the Category field to "General". Add these two libraries to the end of the Object/library modules field (notice that libraries are separated by a space): sapi.lib ifxintfc.lib Set the Category field to "Input". Add "%INFORMIXDIR%\lib" to the Additional library path field. If you want to change the default DLL name, for example to give it a .bld extension, edit the DLL name in the Project Options field. Select the C/C++ tab Set the Category field to "General". Add these settings to the end of the Preprocessor definitions field (notice that each setting is separated by a comma): ,MI_SERVBUILD,NT,GL_NT_STATIC,NT_MI_SAPI Set the Category field to "Preprocessor". Add the %INFORMIXIDIR%\incl\public and %INFORMIXIDIR%\incl\esqlc directories to the Additional Include Directories field. Press OK Choose Build->Rebuild ALL to build the DataBlade DLL. The Build->Configurations setting determines where the resulting DLL gets output. If it is set to "Win32 Debug", the DLL gets output to the Debug subdirectory. If it is set to "Win32 Release", the DLL gets output to the Release subdirectory. Contents Exporting a Makefile Choose Project->Export Makefile to generate a makefile that allows compiling at the DOS prompt. For example, if you export a makefile for this project called "hello.mak", you can compile it as follows: nmake -f hello.mak Contents Glossary Acronyms and vocabulary used by this tech note include: - DBDK
- DataBlade Developers Kit
- DLL
- Dynamic Link Library
- UDR
- User-Defined Routine
Contents IBM, DB2, Informix, and WebSphere are trademarks or registered trademarks of IBM Corporation in the United States, other countries, or both. Windows and Windows NT are registered trademarks of Microsoft Corporation in the United States, other countries, or both. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Other company, product, and service names may be trademarks or service marks of others. IBM copyright and trademark information |