:Base pguide.hlp>main :Title Open Watcom 1.9 C/C++ Programmer's Guide :Index Open Watcom 1.9 C/C++ Programmer's Guide Help=pguide.hlp 1 Open Watcom 1.9 C/C++ Programmer's Guide 2 Watcom C/C++ Application Development 2 Introduction=Watcom_CDCPP_Application_Development 2 Creating 16-bit DOS Applications 2 Introduction=DOS__Creating_16Mbit_DOS_Applications 2 The Sample Application=DOS__The_Sample_Application 2 Building and Running the Sample DOS Application=DOS__Building_and_Running_the_Sample_DOS_Application 2 Debugging the Sample DOS Application=DOS__Debugging_the_Sample_DOS_Application 2 Creating 32-bit Phar Lap 386|DOS-Extender Applications 2 Introduction=Phar_Lap__Creating_32Mbit_Phar_Lap_386_DOSMExtender_Applications 2 The Sample Application=Phar_Lap__The_Sample_Application 2 Building and Running the Sample 386|DOS-Extender Application=Phar_Lap__Building_and_Running_the_Sample_386_DOSMExtender_Application 2 Debugging the Sample 386|DOS-Extender Application=Phar_Lap__Debugging_the_Sample_386_DOSMExtender_Application 2 Creating 32-bit DOS/4GW Applications 2 Introduction=DOSD4GW__Creating_32Mbit_DOSD4GW_Applications 2 The Sample Application=DOSD4GW__The_Sample_Application 2 Building and Running the Sample DOS/4GW Application=DOSD4GW__Building_and_Running_the_Sample_DOSD4GW_Application 2 Debugging the Sample DOS/4GW Application=DOSD4GW__Debugging_the_Sample_DOSD4GW_Application 2 32-bit Extended DOS Application Development 2 Introduction=32Mbit_Extended_DOS_Application_Development 3 How can I write directly to video memory using a DOS extender? 3 Introduction=How_can_I_write_directly_to_video_memory_using_a_DOS_extender_ 3 Writing to Video Memory under Tenberry Software DOS/4GW=Writing_to_Video_Memory_under_Tenberry_Software_DOSD4GW 3 Writing to Video Memory under the Phar Lap 386|DOS-Extender=Writing_to_Video_Memory_under_the_Phar_Lap_386_DOSMExtender 3 How do I get information about free memory in the 32-bit environment? 3 Introduction=How_do_I_get_information_about_free_memory_in_the_32Mbit_environment_ 3 Getting Free Memory Information under DOS/4GW=Getting_Free_Memory_Information_under_DOSD4GW 3 Getting Free Memory Information under the Phar Lap 386|DOS-Extender=Getting_Free_Memory_Information_under_the_Phar_Lap_386_DOSMExtender 3 Getting Free Memory Information in the 32-bit Environment under Windows 3.x=Getting_Free_Memory_Information_in_the_32Mbit_Environment_under_Windows_3_x 3 How do I access the first megabyte in the extended DOS environment? 3 Introduction=How_do_I_access_the_first_megabyte_in_the_extended_DOS_environment_ 3 Accessing the First Megabyte under Tenberry Software DOS/4GW=Accessing_the_First_Megabyte_under_Tenberry_Software_DOSD4GW 3 Accessing the First Megabyte under the Phar Lap 386|DOS-Extender=Accessing_the_First_Megabyte_under_the_Phar_Lap_386_DOSMExtender 3 How do I spawn a protected-mode application? 3 Introduction=How_do_I_spawn_a_protectedMmode_application_ 3 Spawning Protected-Mode Applications Under Tenberry Software DOS/4GW=Spawning_ProtectedMMode_Applications_Under_Tenberry_Software_DOSD4GW 3 Spawning Protected-Mode Applications Under Phar Lap 386|DOS-Extender=Spawning_ProtectedMMode_Applications_Under_Phar_Lap_386_DOSMExtender 2 How Can I Use the Mouse Interrupt (0x33) with DOS/4GW?=How_Can_I_Use_the_Mouse_Interrupt_L0x33R_with_DOSD4GW_ 2 How Do I Simulate a Real-Mode Interrupt with DOS/4GW?=How_Do_I_Simulate_a_RealMMode_Interrupt_with_DOSD4GW_ 2 How do you install a bi-modal interrupt handler using DOS/4GW?=How_do_you_install_a_biMmodal_interrupt_handler_using_DOSD4GW_ 2 The Tenberry Software DOS/4GW DOS Extender 2 Introduction=DOSD4GW__The_Tenberry_Software_DOSD4GW_DOS_Extender 2 Linear Executables 2 Introduction=DOSD4GW__Linear_Executables 3 The Linear Executable Format 3 Introduction=DOSD4GW__The_Linear_Executable_Format 3 The Stub Program=DOSD4GW__The_Stub_Program 2 Memory Use=DOSD4GW__Memory_Use 2 Configuring DOS/4GW 2 Introduction=DOSD4GW__Configuring_DOSD4GW 2 The DOS4G Environment Variable=DOSD4GW__The_DOS4G_Environment_Variable 2 Changing the Switch Mode Setting=DOSD4GW__Changing_the_Switch_Mode_Setting 3 Fine Control of Memory Usage 3 Introduction=DOSD4GW__Fine_Control_of_Memory_Usage 3 Specifying a Range of Extended Memory=DOSD4GW__Specifying_a_Range_of_Extended_Memory 3 Using Extra Memory=DOSD4GW__Using_Extra_Memory 2 Setting Runtime Options=DOSD4GW__Setting_Runtime_Options 2 Controlling Address Line 20=DOSD4GW__Controlling_Address_Line_20 2 VMM 2 Introduction=DOSD4GW__VMM 2 VMM Default Parameters=DOSD4GW__VMM_Default_Parameters 3 Changing the Defaults 3 Introduction=DOSD4GW__Changing_the_Defaults 3 The .VMC File=DOSD4GW__The__VMC_File 2 Interrupt 21H Functions 2 Introduction=DOSD4GW__Interrupt_21H_Functions 3 Functions 25H and 35H: Interrupt Handling in Protected Mode 3 Introduction=DOSD4GW__Functions_25H_and_35H__Interrupt_Handling_in_Protected_Mode 3 32-Bit Gates=DOSD4GW__32MBit_Gates 3 Chaining 16-bit and 32-bit Handlers=DOSD4GW__Chaining_16Mbit_and_32Mbit_Handlers 3 Getting the Address of the Interrupt Handler=DOSD4GW__Getting_the_Address_of_the_Interrupt_Handler 2 Interrupt 31H DPMI Functions 2 Introduction=DOSD4GW__Interrupt_31H_DPMI_Functions 2 Using Interrupt 31H Function Calls=DOSD4GW__Using_Interrupt_31H_Function_Calls 3 Int31H Function Calls 3 Introduction=DOSD4GW__Int31H_Function_Calls 3 Local Descriptor Table (LDT) Management Services=DOSD4GW__Local_Descriptor_Table_LLDTR_Management_Services 3 DOS Memory Management Services=DOSD4GW__DOS_Memory_Management_Services 3 Interrupt Services=DOSD4GW__Interrupt_Services 3 Translation Services=DOSD4GW__Translation_Services 3 DPMI Version=DOSD4GW__DPMI_Version 3 Memory Management Services=DOSD4GW__Memory_Management_Services 3 Page Locking Services=DOSD4GW__Page_Locking_Services 3 Demand Paging Performance Tuning Services=DOSD4GW__Demand_Paging_Performance_Tuning_Services 3 Physical Address Mapping=DOSD4GW__Physical_Address_Mapping 3 Virtual Interrupt State Functions=DOSD4GW__Virtual_Interrupt_State_Functions 3 Vendor Specific Extensions=DOSD4GW__Vendor_Specific_Extensions 3 Coprocessor Status=DOSD4GW__Coprocessor_Status 2 Utilities 2 Introduction=DOSD4GW__Utilities 2 DOS4GW=DOSD4GW__DOS4GW 2 PMINFO=DOSD4GW__PMINFO 2 PRIVATXM=DOSD4GW__PRIVATXM 2 RMINFO=DOSD4GW__RMINFO 2 Error Messages 2 Introduction=DOSD4GW__Error_Messages 2 Kernel Error Messages=DOSD4GW__Kernel_Error_Messages 2 DOS/4G Errors=DOSD4GW__DOSD4G_Errors 2 DOS/4GW Commonly Asked Questions 2 Introduction=DOSD4GW__DOSD4GW_Commonly_Asked_Questions 2 Access to Technical Support=DOSD4GW__Access_to_Technical_Support 2 Differences Within the DOS/4G Product Line=DOSD4GW__Differences_Within_the_DOSD4G_Product_Line 2 Addressing=DOSD4GW__Addressing 2 Interrupt and Exception Handling=DOSD4GW__Interrupt_and_Exception_Handling 2 Memory Management=DOSD4GW__Memory_Management 2 DOS, BIOS, and Mouse Services=DOSD4GW__DOS__BIOS__and_Mouse_Services 2 Virtual Memory=DOSD4GW__Virtual_Memory 2 Debugging=DOSD4GW__Debugging 2 Compatibility=DOSD4GW__Compatibility 2 Creating 16-bit Windows 3.x Applications 2 Introduction=16Mbit_Windows__Creating_16Mbit_Windows_3_x_Applications 2 The Sample GUI Application=16Mbit_Windows__The_Sample_GUI_Application 2 Building and Running the GUI Application=16Mbit_Windows__Building_and_Running_the_GUI_Application 2 Debugging the GUI Application=16Mbit_Windows__Debugging_the_GUI_Application 2 Porting Non-GUI Applications to 16-bit Windows 3.x 2 Introduction=16Mbit_Windows__Porting_NonMGUI_Applications_to_16Mbit_Windows_3_x 2 Console Device in a Windowed Environment=16Mbit_Windows__Console_Device_in_a_Windowed_Environment 2 The Sample Non-GUI Application=16Mbit_Windows__The_Sample_NonMGUI_Application 2 Building and Running the Non-GUI Application=16Mbit_Windows__Building_and_Running_the_NonMGUI_Application 2 Debugging the Non-GUI Application=16Mbit_Windows__Debugging_the_NonMGUI_Application 2 Default Windowing Library Functions=16Mbit_Windows__Default_Windowing_Library_Functions 2 Creating 32-bit Windows 3.x Applications 2 Introduction=32Mbit_Windows__Creating_32Mbit_Windows_3_x_Applications 2 The Sample GUI Application=32Mbit_Windows__The_Sample_GUI_Application 2 Building and Running the GUI Application=32Mbit_Windows__Building_and_Running_the_GUI_Application 2 Debugging the GUI Application=32Mbit_Windows__Debugging_the_GUI_Application 2 Porting Non-GUI Applications to 32-bit Windows 3.x 2 Introduction=32Mbit_Windows__Porting_NonMGUI_Applications_to_32Mbit_Windows_3_x 2 Console Device in a Windowed Environment=32Mbit_Windows__Console_Device_in_a_Windowed_Environment 2 The Sample Non-GUI Application=32Mbit_Windows__The_Sample_NonMGUI_Application 2 Building and Running the Non-GUI Application=32Mbit_Windows__Building_and_Running_the_NonMGUI_Application 2 Debugging the Non-GUI Application=32Mbit_Windows__Debugging_the_NonMGUI_Application 2 Default Windowing Library Functions=32Mbit_Windows__Default_Windowing_Library_Functions 2 The Watcom 32-bit Windows 3.x Extender 2 Introduction=Windows__The_Watcom_32Mbit_Windows_3_x_Extender 2 Pointers=Windows__Pointers 2 Implementation Overview=Windows__Implementation_Overview 2 System Structure=Windows__System_Structure 2 System Overview=Windows__System_Overview 2 Steps to Obtaining a 32-bit Application=Windows__Steps_to_Obtaining_a_32Mbit_Application 2 Windows 3.x 32-bit Programming Overview 2 Introduction=Windows__Windows_3_x_32Mbit_Programming_Overview 2 WINDOWS.H=Windows__WINDOWS_H 2 Environment Notes=Windows__Environment_Notes 2 Floating-point Emulation=Windows__FloatingMpoint_Emulation 2 Multiple Instances=Windows__Multiple_Instances 3 Pointer Handling 3 Introduction=Windows__Pointer_Handling 3 When To Convert Incoming Pointers=Windows__When_To_Convert_Incoming_Pointers 4 When To Convert Outgoing Pointers 4 Introduction=Windows__When_To_Convert_Outgoing_Pointers 4 SendMessage and SendDlgItemMessage=Windows__SendMessage_and_SendDlgItemMessage 3 GlobalAlloc and LocalAlloc=Windows__GlobalAlloc_and_LocalAlloc 4 Callback Function Pointers 4 Introduction=Windows__Callback_Function_Pointers 4 Window Sub-classing=Windows__Window_SubMclassing 3 Calling 16-bit DLLs 3 Introduction=Windows__Calling_16Mbit_DLLs 3 Making DLL Calls Transparent=Windows__Making_DLL_Calls_Transparent 2 Far Pointer Manipulation=Windows__Far_Pointer_Manipulation 2 _16 Functions=Windows___16_Functions 2 Windows 32-Bit Dynamic Link Libraries 2 Introduction=Windows__Windows_32MBit_Dynamic_Link_Libraries 2 A Sample 32-bit DLL=Windows__A_Sample_32Mbit_DLL 2 Calling Functions in a 32-bit DLL from a 16-bit Application=Windows__Calling_Functions_in_a_32Mbit_DLL_from_a_16Mbit_Application 2 Writing a 16-bit Cover for the 32-bit DLL=Windows__Writing_a_16Mbit_Cover_for_the_32Mbit_DLL 3 Creating and Debugging Dynamic Link Libraries 3 Introduction=Windows__Creating_and_Debugging_Dynamic_Link_Libraries 3 Building the Applications=Windows__Building_the_Applications 3 Installing the Examples under Windows=Windows__Installing_the_Examples_under_Windows 3 Running the Examples=Windows__Running_the_Examples 3 Debugging a 32-bit DLL=Windows__Debugging_a_32Mbit_DLL 3 Summary=Windows__Summary 2 Interfacing Visual Basic and Watcom C/C++ DLLs 2 Introduction=Windows__Interfacing_Visual_Basic_and_Watcom_CDCPP_DLLs 2 A Working Example=Windows__A_Working_Example 3 Sample Visual Basic DLL Programs 3 Introduction=Windows__Sample_Visual_Basic_DLL_Programs 3 Source Code for VBDLL32.DLL=Windows__Source_Code_for_VBDLL32_DLL 3 Source code for COVER16.DLL=Windows__Source_code_for_COVER16_DLL 2 Compiling and Linking the Examples=Windows__Compiling_and_Linking_the_Examples 2 WIN386 Library Functions and Macros 2 Introduction=Windows__WIN386_Library_Functions_and_Macros 2 AllocAlias16=AllocAlias16 2 AllocHugeAlias16=AllocHugeAlias16 2 _Call16=_Call16 2 DefineDLLEntry=DefineDLLEntry 2 DefineUserProc16=DefineUserProc16 2 FreeAlias16=FreeAlias16 2 FreeHugeAlias16=FreeHugeAlias16 2 FreeIndirectFunctionHandle=FreeIndirectFunctionHandle 2 GetIndirectFunctionHandle=GetIndirectFunctionHandle 2 GetProc16=GetProc16 2 InvokeIndirectFunction=InvokeIndirectFunction 2 MapAliasToFlat=MapAliasToFlat 2 MK_FP16=MK_FP16 2 MK_FP32=MK_FP32 2 MK_LOCAL32=MK_LOCAL32 2 PASS_WORD_AS_POINTER=PASS_WORD_AS_POINTER 2 ReleaseProc16=ReleaseProc16 2 32-bit Extended Windows Application Development 2 Introduction=Windows__32Mbit_Extended_Windows_Application_Development 2 Can you call 16-bit code from a 32-bit Windows application?=Windows__Can_you_call_16Mbit_code_from_a_32Mbit_Windows_application_ 2 Can I WinExec another Windows application?=Windows__Can_I_WinExec_another_Windows_application_ 2 How do I add my Windows resources?=Windows__How_do_I_add_my_Windows_resources_ 2 All function pointers passed to Windows must be 16-bit far pointers, correct?=Windows__All_function_pointers_passed_to_Windows_must_be_16Mbit_far_pointers__correct_ 2 Why are 32-bit callback routines FAR?=Windows__Why_are_32Mbit_callback_routines_FAR_ 2 Why use the _16 API functions?=Windows__Why_use_the__16_API_functions_ 2 What about pointers in structures?=Windows__What_about_pointers_in_structures_ 2 When do I use MK_FP32?=Windows__When_do_I_use_MK_FP32_ 2 What is the difference between AllocAlias16 and MK_FP16?=Windows__What_is_the_difference_between_AllocAlias16_and_MK_FP16_ 2 Tell Me More About Thunking and Aliases=Windows__Tell_Me_More_About_Thunking_and_Aliases 2 Special Variables for Windows Programming 2 Introduction=Special_Variables_for_Windows_Programming 2 Definitions of Windows Terms 2 Introduction=Definitions_of_Windows_Terms 2 Special Windows API Functions 2 Introduction=Special_Windows_API_Functions 2 Windows NT Programming Overview 2 Introduction=NT__Windows_NT_Programming_Overview 2 Windows NT Programming Note=NT__Windows_NT_Programming_Note 2 Windows NT Character-mode Versus GUI=NT__Windows_NT_CharacterMmode_Versus_GUI 2 Creating Windows NT GUI Applications 2 Introduction=NT__Creating_Windows_NT_GUI_Applications 2 The Sample GUI Application=NT__The_Sample_GUI_Application 2 Building and Running the GUI Application=NT__Building_and_Running_the_GUI_Application 2 Debugging the GUI Application=NT__Debugging_the_GUI_Application 2 Creating Windows NT Character-mode Applications 2 Introduction=NT__Creating_Windows_NT_CharacterMmode_Applications 2 The Sample Character-mode Application=NT__The_Sample_CharacterMmode_Application 2 Building and Running the Character-mode Application=NT__Building_and_Running_the_CharacterMmode_Application 2 Debugging the Character-mode Application=NT__Debugging_the_CharacterMmode_Application 2 Windows NT Multi-threaded Applications 2 Introduction=NT__Windows_NT_MultiMthreaded_Applications 2 Programming Considerations=NT__Programming_Considerations 3 Creating Threads 3 Introduction=NT__Creating_Threads 3 Creating a New Thread=NT__Creating_a_New_Thread 3 Terminating the Current Thread=NT__Terminating_the_Current_Thread 3 Getting the Current Thread Identifier=NT__Getting_the_Current_Thread_Identifier 2 A Multi-threaded Example=NT__A_MultiMthreaded_Example 2 Windows NT Dynamic Link Libraries 2 Introduction=NT__Windows_NT_Dynamic_Link_Libraries 2 Creating Dynamic Link Libraries=NT__Creating_Dynamic_Link_Libraries 2 Creating a Sample Dynamic Link Library=NT__Creating_a_Sample_Dynamic_Link_Library 2 Using Dynamic Link Libraries=NT__Using_Dynamic_Link_Libraries 2 The Dynamic Link Library Data Area=NT__The_Dynamic_Link_Library_Data_Area 2 Creating Windows NT POSIX Applications 2 Introduction=NT__Creating_Windows_NT_POSIX_Applications 2 Creating 16-bit OS/2 1.x Applications 2 Introduction=16Mbit_OSD2__Creating_16Mbit_OSD2_1_x_Applications 2 The Sample Application=16Mbit_OSD2__The_Sample_Application 2 Building and Running the Sample OS/2 1.x Application=16Mbit_OSD2__Building_and_Running_the_Sample_OSD2_1_x_Application 2 Debugging the Sample OS/2 1.x Application=16Mbit_OSD2__Debugging_the_Sample_OSD2_1_x_Application 2 Creating 32-bit OS/2 Applications 2 Introduction=32Mbit_OSD2__Creating_32Mbit_OSD2_Applications 2 The Sample Application=32Mbit_OSD2__The_Sample_Application 2 Building and Running the Sample OS/2 Application=32Mbit_OSD2__Building_and_Running_the_Sample_OSD2_Application 2 Debugging the Sample OS/2 Application=32Mbit_OSD2__Debugging_the_Sample_OSD2_Application 2 OS/2 2.x Multi-threaded Applications 2 Introduction=OSD2__OSD2_2_x_MultiMthreaded_Applications 2 Programming Considerations=OSD2__Programming_Considerations 3 Creating Threads 3 Introduction=OSD2__Creating_Threads 3 Creating a New Thread=OSD2__Creating_a_New_Thread 3 Terminating the Current Thread=OSD2__Terminating_the_Current_Thread 3 Getting the Current Thread Identifier=OSD2__Getting_the_Current_Thread_Identifier 2 A Multi-threaded Example=OSD2__A_MultiMthreaded_Example 2 Thread Limits=OSD2__Thread_Limits 2 OS/2 2.x Dynamic Link Libraries 2 Introduction=OSD2__OSD2_2_x_Dynamic_Link_Libraries 2 Creating Dynamic Link Libraries=OSD2__Creating_Dynamic_Link_Libraries 2 Creating a Sample Dynamic Link Library=OSD2__Creating_a_Sample_Dynamic_Link_Library 2 Using Dynamic Link Libraries=OSD2__Using_Dynamic_Link_Libraries 2 The Dynamic Link Library Data Area=OSD2__The_Dynamic_Link_Library_Data_Area 2 Dynamic Link Library Initialization/Termination=OSD2__Dynamic_Link_Library_InitializationDTermination 2 Programming for OS/2 Presentation Manager 2 Introduction=OSD2__Programming_for_OSD2_Presentation_Manager 3 Porting Existing C/C++ Applications 3 Introduction=OSD2__Porting_Existing_CDCPP_Applications 3 An Example=OSD2__An_Example 2 Calling Presentation Manager API Functions=OSD2__Calling_Presentation_Manager_API_Functions 2 Developing an OS/2 Physical Device Driver 2 Introduction=OSD2__Developing_an_OSD2_Physical_Device_Driver 2 Creating NetWare 386 NLM Applications 2 Introduction=Creating_NetWare_386_NLM_Applications 2 Inter-Language calls: C and FORTRAN 2 Introduction=InterMLanguage_calls__C_and_FORTRAN 2 Symbol Naming Convention=Symbol_Naming_Convention 2 Argument Passing Convention=Argument_Passing_Convention 2 Memory Model Compatibility=Memory_Model_Compatibility 2 Linking Considerations=Linking_Considerations 2 Integer Type Compatibility=Integer_Type_Compatibility 2 How do I pass integers from C to a FORTRAN function?=How_do_I_pass_integers_from_C_to_a_FORTRAN_function_ 2 How do I pass integers from FORTRAN to a C function?=How_do_I_pass_integers_from_FORTRAN_to_a_C_function_ 2 How do I pass a string from a C function to FORTRAN?=How_do_I_pass_a_string_from_a_C_function_to_FORTRAN_ 2 How do I pass a string from FORTRAN to a C function?=How_do_I_pass_a_string_from_FORTRAN_to_a_C_function_ 2 How do I access a FORTRAN common block from within C?=How_do_I_access_a_FORTRAN_common_block_from_within_C_ 2 How do I call a C function that accepts a variable number of arguments?=How_do_I_call_a_C_function_that_accepts_a_variable_number_of_arguments_ 2 Commonly Asked Questions and Answers 2 Introduction=Commonly_Asked_Questions_and_Answers 2 Determining my current patch level=Determining_my_current_patch_level 3 Converting to Watcom C/C++ 3 Introduction=Converting_to_Watcom_CDCPP 3 Conversion from UNIX compilers=Conversion_from_UNIX_compilers 3 Conversion from IBM-compatible PC compilers=Conversion_from_IBMMcompatible_PC_compilers 2 What you should know about optimization=What_you_should_know_about_optimization 2 The compiler cannot find "stdio.h"=The_compiler_cannot_find__stdio_h_ 2 Resolving an "Undefined Reference" linker error=Resolving_an__Undefined_Reference__linker_error 2 Why my variables are not set to zero=Why_my_variables_are_not_set_to_zero 2 What does "size of DGROUP exceeds 64K" mean for 16-bit applications?=What_does__size_of_DGROUP_exceeds_64K__mean_for_16Mbit_applications_ 2 What does "NULL assignment detected" mean in 16-bit applications?=What_does__NULL_assignment_detected__mean_in_16Mbit_applications_ 2 What "Stack Overflow!" means=What__Stack_Overflow___means 2 Why redefinition errors are issued from WLINK=Why_redefinition_errors_are_issued_from_WLINK 2 How more than 20 files at a time can be opened=How_more_than_20_files_at_a_time_can_be_opened 2 How source files can be seen in the debugger=How_source_files_can_be_seen_in_the_debugger 2 The difference between the "d1" and "d2" compiler options=The_difference_between_the__d1__and__d2__compiler_options