xref: /trunk/main/svl/source/svdde/ddestrg.cxx (revision 40df464e)
1*40df464eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*40df464eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*40df464eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*40df464eSAndrew Rist  * distributed with this work for additional information
6*40df464eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*40df464eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*40df464eSAndrew Rist  * "License"); you may not use this file except in compliance
9*40df464eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*40df464eSAndrew Rist  *
11*40df464eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*40df464eSAndrew Rist  *
13*40df464eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*40df464eSAndrew Rist  * software distributed under the License is distributed on an
15*40df464eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*40df464eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*40df464eSAndrew Rist  * specific language governing permissions and limitations
18*40df464eSAndrew Rist  * under the License.
19*40df464eSAndrew Rist  *
20*40df464eSAndrew Rist  *************************************************************/
21*40df464eSAndrew Rist 
22*40df464eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svl.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #define UNICODE
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "ddeimp.hxx"
30cdf0e10cSrcweir #include <svl/svdde.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir // --- DdeString::DdeString() --------------------------------------
33cdf0e10cSrcweir 
DdeString(DWORD hDdeInst,const sal_Unicode * p)34cdf0e10cSrcweir DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) :
35cdf0e10cSrcweir 				String( p )
36cdf0e10cSrcweir {
37cdf0e10cSrcweir 	hString = DdeCreateStringHandle( hDdeInst, (LPTSTR)p, CP_WINUNICODE );
38cdf0e10cSrcweir 	hInst = hDdeInst;
39cdf0e10cSrcweir }
40cdf0e10cSrcweir 
41cdf0e10cSrcweir // --- DdeString::DdeString() --------------------------------------
42cdf0e10cSrcweir 
DdeString(DWORD hDdeInst,const String & r)43cdf0e10cSrcweir DdeString::DdeString( DWORD hDdeInst, const String& r) :
44cdf0e10cSrcweir 				String( r )
45cdf0e10cSrcweir {
46cdf0e10cSrcweir 	hString = DdeCreateStringHandle( hDdeInst, (LPTSTR)r.GetBuffer(), CP_WINUNICODE );
47cdf0e10cSrcweir 	hInst = hDdeInst;
48cdf0e10cSrcweir }
49cdf0e10cSrcweir 
50cdf0e10cSrcweir // --- DdeString::~DdeString() -------------------------------------
51cdf0e10cSrcweir 
~DdeString()52cdf0e10cSrcweir DdeString::~DdeString()
53cdf0e10cSrcweir {
54cdf0e10cSrcweir 	if ( hString )
55cdf0e10cSrcweir 		DdeFreeStringHandle( hInst, hString );
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir // --- DdeString::operator==() -------------------------------------
59cdf0e10cSrcweir 
operator ==(HSZ h)60cdf0e10cSrcweir int DdeString::operator==( HSZ h )
61cdf0e10cSrcweir {
62cdf0e10cSrcweir 	return( !DdeCmpStringHandles( hString, h ) );
63cdf0e10cSrcweir }
64cdf0e10cSrcweir 
65cdf0e10cSrcweir // --- DdeString::operator HSZ() -----------------------------------
66cdf0e10cSrcweir 
operator HSZ()67cdf0e10cSrcweir DdeString::operator HSZ()
68cdf0e10cSrcweir {
69cdf0e10cSrcweir 	return hString;
70cdf0e10cSrcweir }
71