Code:
/ FX-1434 / FX-1434 / 1.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
- TextBoxLine.cs
- BrowserTree.cs
- Vector3D.cs
- XPathBinder.cs
- TextEvent.cs
- NetworkAddressChange.cs
- TreeNodeStyle.cs
- DelegatingTypeDescriptionProvider.cs
- Assembly.cs
- TransferMode.cs
- DiscoveryExceptionDictionary.cs
- HttpWriter.cs
- DomNameTable.cs
- NotConverter.cs
- SQLRoleProvider.cs
- FormViewDeleteEventArgs.cs
- ServicePointManager.cs
- MobileComponentEditorPage.cs
- Base64WriteStateInfo.cs
- MappingMetadataHelper.cs
- SlotInfo.cs
- AnimatedTypeHelpers.cs
- StringPropertyBuilder.cs
- Tag.cs
- Int64.cs
- FreeFormPanel.cs
- GeneralTransform3DCollection.cs
- DynamicResourceExtension.cs
- HotSpotCollection.cs
- PowerModeChangedEventArgs.cs
- BaseAddressPrefixFilterElementCollection.cs
- sqlcontext.cs
- XmlUrlResolver.cs
- XPathDocument.cs
- WindowsEditBoxRange.cs
- CompositeKey.cs
- NotificationContext.cs
- Char.cs
- RangeBaseAutomationPeer.cs
- WhiteSpaceTrimStringConverter.cs
- ReliableMessagingVersion.cs
- Html32TextWriter.cs
- ParallelRangeManager.cs
- ToolboxComponentsCreatingEventArgs.cs
- FeatureManager.cs
- TextFormatter.cs
- SiteMapProvider.cs
- TlsnegoTokenProvider.cs
- AuthenticationModulesSection.cs
- DataProtection.cs
- PropertyChangedEventManager.cs
- InvokeAction.cs
- PolyQuadraticBezierSegment.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- XmlObjectSerializerReadContextComplexJson.cs
- EventDescriptor.cs
- AdCreatedEventArgs.cs
- InternalBufferOverflowException.cs
- StubHelpers.cs
- SpellerInterop.cs
- CodeCommentStatementCollection.cs
- JumpTask.cs
- SqlCacheDependency.cs
- IndexedString.cs
- InvalidChannelBindingException.cs
- ModifierKeysConverter.cs
- ConfigXmlSignificantWhitespace.cs
- Version.cs
- StateManagedCollection.cs
- WorkerRequest.cs
- Int32Rect.cs
- DataReceivedEventArgs.cs
- ObjectDataSourceView.cs
- Timer.cs
- XmlNodeChangedEventManager.cs
- WebPartEventArgs.cs
- HttpProfileBase.cs
- XmlILOptimizerVisitor.cs
- PixelFormatConverter.cs
- Helpers.cs
- XmlSerializableServices.cs
- ObjectResult.cs
- PagerSettings.cs
- ToolStripContainer.cs
- ControlTemplate.cs
- XmlAttributeOverrides.cs
- SQLBoolean.cs
- XPathScanner.cs
- AssemblyAttributesGoHere.cs
- DataGridTextBoxColumn.cs
- DataServiceContext.cs
- TraceEventCache.cs
- RadioButtonList.cs
- Object.cs
- WindowsProgressbar.cs
- MULTI_QI.cs
- TextTreeInsertUndoUnit.cs
- HashHelper.cs
- SafeWaitHandle.cs
- ActivationArguments.cs