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
- HoistedLocals.cs
- PropertyCollection.cs
- COM2FontConverter.cs
- SplitterEvent.cs
- ToolStripSeparatorRenderEventArgs.cs
- SystemColorTracker.cs
- StatusBarItemAutomationPeer.cs
- XmlParserContext.cs
- DateTimeFormatInfoScanner.cs
- StreamUpgradeBindingElement.cs
- CheckBox.cs
- Stack.cs
- RichTextBox.cs
- WindowsListViewItem.cs
- ListDesigner.cs
- XmlNamespaceMappingCollection.cs
- HttpModuleAction.cs
- SqlUnionizer.cs
- GlobalizationAssembly.cs
- ObjectDataSourceStatusEventArgs.cs
- DateTimeFormatInfoScanner.cs
- LinqDataSourceContextData.cs
- ServiceNameElement.cs
- HttpClientCertificate.cs
- COM2TypeInfoProcessor.cs
- StylusPointProperty.cs
- xdrvalidator.cs
- StringInfo.cs
- AssemblyAttributesGoHere.cs
- SafeRsaProviderHandle.cs
- SoapElementAttribute.cs
- ProgressBarRenderer.cs
- CodeCommentStatementCollection.cs
- ConstraintManager.cs
- ScrollViewer.cs
- SqlDataSourceSummaryPanel.cs
- OleCmdHelper.cs
- RowTypePropertyElement.cs
- ListItemsPage.cs
- TreeSet.cs
- ClientTarget.cs
- EntityContainerRelationshipSetEnd.cs
- SizeAnimationBase.cs
- COMException.cs
- XhtmlBasicCommandAdapter.cs
- DetailsViewDeletedEventArgs.cs
- Events.cs
- TextServicesLoader.cs
- VectorKeyFrameCollection.cs
- DesignerDataTableBase.cs
- Enum.cs
- GradientStopCollection.cs
- ExcCanonicalXml.cs
- XmlSchemaImporter.cs
- SqlDataSourceStatusEventArgs.cs
- SafeFileMappingHandle.cs
- SystemTcpStatistics.cs
- SerialErrors.cs
- GroupBoxAutomationPeer.cs
- SqlUserDefinedAggregateAttribute.cs
- SchemaObjectWriter.cs
- relpropertyhelper.cs
- CategoryAttribute.cs
- ellipse.cs
- HandleInitializationContext.cs
- DeviceContext2.cs
- RoutedCommand.cs
- BoolExpr.cs
- HScrollBar.cs
- InvalidComObjectException.cs
- ComponentEvent.cs
- ColorAnimationBase.cs
- DesignSurfaceServiceContainer.cs
- InteropBitmapSource.cs
- DataGridViewBand.cs
- TemplatedControlDesigner.cs
- DeferredElementTreeState.cs
- GifBitmapEncoder.cs
- LassoSelectionBehavior.cs
- SubqueryRules.cs
- InstalledFontCollection.cs
- AssociationType.cs
- ParagraphVisual.cs
- PackageDigitalSignatureManager.cs
- ConfigurationSchemaErrors.cs
- ObjectPropertyMapping.cs
- ContextProperty.cs
- ShortcutKeysEditor.cs
- HostSecurityManager.cs
- ManagedWndProcTracker.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- PropertyItemInternal.cs
- DataReaderContainer.cs
- WebEvents.cs
- SortQuery.cs
- EventPropertyMap.cs
- PeerResolverElement.cs
- PageThemeParser.cs
- XmlSchemaGroup.cs
- ResourceCollectionInfo.cs