1*9eab2a37SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9eab2a37SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9eab2a37SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9eab2a37SAndrew Rist * distributed with this work for additional information 6*9eab2a37SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9eab2a37SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9eab2a37SAndrew Rist * "License"); you may not use this file except in compliance 9*9eab2a37SAndrew Rist * with the License. You may obtain a copy of the License at 10*9eab2a37SAndrew Rist * 11*9eab2a37SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9eab2a37SAndrew Rist * 13*9eab2a37SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9eab2a37SAndrew Rist * software distributed under the License is distributed on an 15*9eab2a37SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9eab2a37SAndrew Rist * KIND, either express or implied. See the License for the 17*9eab2a37SAndrew Rist * specific language governing permissions and limitations 18*9eab2a37SAndrew Rist * under the License. 19*9eab2a37SAndrew Rist * 20*9eab2a37SAndrew Rist *************************************************************/ 21*9eab2a37SAndrew Rist 22*9eab2a37SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #pragma once 25cdf0e10cSrcweir 26cdf0e10cSrcweir #ifndef _WINDOWS_ 27cdf0e10cSrcweir #include <windows.h> 28cdf0e10cSrcweir #endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir #ifndef _COMMDLG_H_ 31cdf0e10cSrcweir #include <commdlg.h> 32cdf0e10cSrcweir #endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir #ifdef __cplusplus 35cdf0e10cSrcweir extern "C"{ 36cdf0e10cSrcweir #endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir //------------------------------------------------------------------------ 39cdf0e10cSrcweir // undefine the macros defined in the shlobj.h file in order to avoid 40cdf0e10cSrcweir // warnings because of multiple defines 41cdf0e10cSrcweir //------------------------------------------------------------------------ 42cdf0e10cSrcweir 43cdf0e10cSrcweir #ifdef GetOpenFileNameW 44cdf0e10cSrcweir #undef GetOpenFileNameW 45cdf0e10cSrcweir #endif 46cdf0e10cSrcweir 47cdf0e10cSrcweir #ifdef GetSaveFileNameW 48cdf0e10cSrcweir #undef GetSaveFileNameW 49cdf0e10cSrcweir #endif 50cdf0e10cSrcweir 51cdf0e10cSrcweir //------------------------------------------------------------------------ 52cdf0e10cSrcweir // set the compiler directives for the function pointer we declare below 53cdf0e10cSrcweir // if we build sal or sal will be used as static library we define extern 54cdf0e10cSrcweir // else sal exports the function pointers from a dll and we use __declspec 55cdf0e10cSrcweir //------------------------------------------------------------------------ 56cdf0e10cSrcweir 57cdf0e10cSrcweir #define COMDLG9X_API extern 58cdf0e10cSrcweir 59cdf0e10cSrcweir //------------------------------------------------------------------------ 60cdf0e10cSrcweir // declare function pointers to the appropriate comdlg functions 61cdf0e10cSrcweir //------------------------------------------------------------------------ 62cdf0e10cSrcweir 63cdf0e10cSrcweir COMDLG9X_API BOOL ( WINAPI * lpfnGetOpenFileNameW ) ( LPOPENFILENAMEW lpofn ); 64cdf0e10cSrcweir COMDLG9X_API BOOL ( WINAPI * lpfnGetSaveFileNameW ) ( LPOPENFILENAMEW lpofn ); 65cdf0e10cSrcweir 66cdf0e10cSrcweir //------------------------------------------------------------------------ 67cdf0e10cSrcweir // redefine the above undefined macros so that the preprocessor replaces 68cdf0e10cSrcweir // all occurrences of this macros with our function pointer 69cdf0e10cSrcweir //------------------------------------------------------------------------ 70cdf0e10cSrcweir 71cdf0e10cSrcweir #define GetOpenFileNameW lpfnGetOpenFileNameW 72cdf0e10cSrcweir #define GetSaveFileNameW lpfnGetSaveFileNameW 73cdf0e10cSrcweir 74cdf0e10cSrcweir #ifdef __cplusplus 75cdf0e10cSrcweir } 76cdf0e10cSrcweir #endif 77