Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / ComponentModel / COM2Interop / OleStrCAMarshaler.cs / 1 / OleStrCAMarshaler.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.ComponentModel.Com2Interop { using System.Runtime.InteropServices; using System.ComponentModel; using System.Diagnostics; using System; ////// /// This class performs marshaling on a CALPOLESTR struct given /// from native code. /// internal class OleStrCAMarshaler: BaseCAMarshaler { public OleStrCAMarshaler(NativeMethods.CA_STRUCT caAddr) : base(caAddr) { } ////// /// Returns the type of item this marshaler will /// return in the items array. In this case, the type is string. /// public override Type ItemType { get { return typeof(string); } } protected override Array CreateArray() { return new string[Count]; } ////// /// Override this member to perform marshalling of a single item /// given it's native address. /// protected override object GetItemFromAddress(IntPtr addr) { string item = Marshal.PtrToStringUni(addr); // free the memory Marshal.FreeCoTaskMem(addr); return item; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeSystemProvider.cs
- Journaling.cs
- TargetException.cs
- MailDefinition.cs
- DataBinder.cs
- DataBindingValueUIHandler.cs
- Funcletizer.cs
- EnumerableWrapperWeakToStrong.cs
- PageBreakRecord.cs
- IconHelper.cs
- documentsequencetextview.cs
- XamlStream.cs
- PeerNodeAddress.cs
- StrokeFIndices.cs
- SettingsSection.cs
- InstanceNameConverter.cs
- DesignerOptionService.cs
- ToolboxItemSnapLineBehavior.cs
- BridgeDataRecord.cs
- EventBuilder.cs
- DeadLetterQueue.cs
- XPathDescendantIterator.cs
- SqlCachedBuffer.cs
- SqlUserDefinedTypeAttribute.cs
- TablePattern.cs
- TrackingProfileCache.cs
- TripleDES.cs
- RenamedEventArgs.cs
- URIFormatException.cs
- EventProviderTraceListener.cs
- HighlightOverlayGlyph.cs
- ContainerParagraph.cs
- WhitespaceRule.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- ExpressionPrefixAttribute.cs
- HttpDebugHandler.cs
- MissingManifestResourceException.cs
- UIPermission.cs
- FieldAccessException.cs
- DataColumnPropertyDescriptor.cs
- DynamicDataManager.cs
- DocumentGrid.cs
- BackStopAuthenticationModule.cs
- PartitionerStatic.cs
- CodeEntryPointMethod.cs
- X509ChainPolicy.cs
- WinFormsSecurity.cs
- SchemaExporter.cs
- CacheChildrenQuery.cs
- DataBindingExpressionBuilder.cs
- BinarySecretSecurityToken.cs
- DictionaryBase.cs
- ConfigurationSectionGroup.cs
- IISMapPath.cs
- X509PeerCertificateAuthenticationElement.cs
- StringUtil.cs
- BaseComponentEditor.cs
- Color.cs
- HtmlAnchor.cs
- BuildProviderUtils.cs
- BezierSegment.cs
- InputLanguageManager.cs
- Pts.cs
- EpmHelper.cs
- SQLMoneyStorage.cs
- SelfIssuedTokenFactoryCredential.cs
- Brushes.cs
- BaseTemplateBuildProvider.cs
- XmlElementCollection.cs
- RegexCharClass.cs
- IteratorFilter.cs
- SqlCacheDependency.cs
- XmlUTF8TextReader.cs
- Compensation.cs
- RC2CryptoServiceProvider.cs
- PanelStyle.cs
- ErrorRuntimeConfig.cs
- BitmapEffectInputData.cs
- HtmlInputImage.cs
- recordstate.cs
- NaturalLanguageHyphenator.cs
- IListConverters.cs
- OleDbError.cs
- XPathSingletonIterator.cs
- ModifyActivitiesPropertyDescriptor.cs
- DataGridViewDataConnection.cs
- TemplateBindingExpressionConverter.cs
- DesignerActionVerbItem.cs
- CallbackDebugBehavior.cs
- userdatakeys.cs
- RankException.cs
- TypeConverterHelper.cs
- UInt32Converter.cs
- EntityCollectionChangedParams.cs
- ConsoleCancelEventArgs.cs
- DataKeyPropertyAttribute.cs
- MimeTypeAttribute.cs
- SmiEventStream.cs
- UpdateManifestForBrowserApplication.cs
- PolicyLevel.cs