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