Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / ComponentModel / COM2Interop / OleStrCAMarshaler.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewCheckBoxCell.cs
- EmptyCollection.cs
- UInt16Converter.cs
- DependencyPropertyDescriptor.cs
- LineServicesRun.cs
- SqlBinder.cs
- TextLineBreak.cs
- XmlAttributeOverrides.cs
- CompositionTarget.cs
- EventHandlersStore.cs
- OutputScopeManager.cs
- SourceFilter.cs
- RSAProtectedConfigurationProvider.cs
- DataKey.cs
- UdpChannelFactory.cs
- Point3D.cs
- TextViewSelectionProcessor.cs
- PropertyToken.cs
- DataColumnMapping.cs
- WindowsToolbarItemAsMenuItem.cs
- QuaternionConverter.cs
- PtsHost.cs
- SByteStorage.cs
- DependencyPropertyKey.cs
- BitConverter.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- DecimalFormatter.cs
- ActivitySurrogate.cs
- GeometryValueSerializer.cs
- EdgeProfileValidation.cs
- MultiByteCodec.cs
- UrlRoutingHandler.cs
- CodeNamespaceCollection.cs
- URL.cs
- JournalEntryStack.cs
- ByteStreamBufferedMessageData.cs
- QilInvoke.cs
- DbDataRecord.cs
- TextEditorTyping.cs
- ScriptManagerProxy.cs
- CompositeActivityDesigner.cs
- StopStoryboard.cs
- HelpOperationInvoker.cs
- FlowDocumentPaginator.cs
- FormsAuthenticationConfiguration.cs
- IndexedWhereQueryOperator.cs
- DataServiceSaveChangesEventArgs.cs
- ConstraintEnumerator.cs
- ConstraintStruct.cs
- InputLangChangeRequestEvent.cs
- PrintSystemException.cs
- DataGridViewColumnStateChangedEventArgs.cs
- OracleTimeSpan.cs
- DesignObjectWrapper.cs
- WrappedIUnknown.cs
- ItemCheckEvent.cs
- UInt64Converter.cs
- DataRecordObjectView.cs
- CollectionEditorDialog.cs
- ReturnType.cs
- TransformGroup.cs
- CompressedStack.cs
- WebPartDisplayMode.cs
- PostBackOptions.cs
- CaseInsensitiveComparer.cs
- XmlSchemaCollection.cs
- RequestResizeEvent.cs
- ToolStripSystemRenderer.cs
- MatrixTransform.cs
- JsonFormatReaderGenerator.cs
- PngBitmapEncoder.cs
- dbenumerator.cs
- GridView.cs
- PassportAuthenticationEventArgs.cs
- GridItem.cs
- MasterPage.cs
- ExpressionConverter.cs
- SignatureResourcePool.cs
- BatchServiceHost.cs
- VisualTreeHelper.cs
- _SafeNetHandles.cs
- WindowsEditBox.cs
- _NTAuthentication.cs
- WindowsToolbarItemAsMenuItem.cs
- PropertyPushdownHelper.cs
- DbProviderFactories.cs
- ObjectPersistData.cs
- XmlSchemaObject.cs
- XmlSignificantWhitespace.cs
- BamlResourceSerializer.cs
- MappingMetadataHelper.cs
- ObjectReferenceStack.cs
- PersonalizationProviderCollection.cs
- Int32EqualityComparer.cs
- DbgCompiler.cs
- CodeDOMUtility.cs
- Panel.cs
- SequentialActivityDesigner.cs
- ContainerSelectorBehavior.cs
- WindowsFormsSynchronizationContext.cs