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
- shaperfactoryquerycacheentry.cs
- HybridDictionary.cs
- QilLiteral.cs
- EntityDesignerDataSourceView.cs
- ConditionalAttribute.cs
- WebPartsPersonalization.cs
- XmlAttributes.cs
- TreeViewImageKeyConverter.cs
- FixedSOMTableRow.cs
- RelatedCurrencyManager.cs
- SafeNativeMemoryHandle.cs
- Selection.cs
- ServiceModelExtensionCollectionElement.cs
- TypeFieldSchema.cs
- fixedPageContentExtractor.cs
- ColorConverter.cs
- FloaterBaseParaClient.cs
- xmlglyphRunInfo.cs
- FrameworkContextData.cs
- ValueChangedEventManager.cs
- Activator.cs
- DbReferenceCollection.cs
- OrderedHashRepartitionEnumerator.cs
- XmlTextAttribute.cs
- ConnectorEditor.cs
- ResetableIterator.cs
- MsmqIntegrationChannelFactory.cs
- AutomationProperties.cs
- DateTimeFormatInfo.cs
- controlskin.cs
- AtomicFile.cs
- QuaternionAnimation.cs
- XPathPatternBuilder.cs
- TextDpi.cs
- odbcmetadatacolumnnames.cs
- WebConfigurationHostFileChange.cs
- PrintingPermission.cs
- TagMapCollection.cs
- RootProfilePropertySettingsCollection.cs
- DeflateEmulationStream.cs
- xmlfixedPageInfo.cs
- SystemDiagnosticsSection.cs
- DesignerTransactionCloseEvent.cs
- SourceSwitch.cs
- DataGridViewCellLinkedList.cs
- TrackingServices.cs
- BinaryParser.cs
- ExchangeUtilities.cs
- PropertyReferenceSerializer.cs
- SynchronizedPool.cs
- ImageMetadata.cs
- SafeProcessHandle.cs
- SHA1.cs
- ReadOnlyNameValueCollection.cs
- MimeMapping.cs
- DivideByZeroException.cs
- SchemaNotation.cs
- ReadOnlyDataSource.cs
- SafeEventLogReadHandle.cs
- EasingKeyFrames.cs
- listitem.cs
- ProtectedProviderSettings.cs
- FrameworkTemplate.cs
- AssociationTypeEmitter.cs
- ExecutionScope.cs
- RuleConditionDialog.Designer.cs
- GestureRecognizer.cs
- PointCollectionConverter.cs
- NativeMethods.cs
- WpfXamlLoader.cs
- SQLByte.cs
- NavigationWindow.cs
- FrameworkTemplate.cs
- CreateUserWizardStep.cs
- BamlTreeUpdater.cs
- ZipIOExtraFieldZip64Element.cs
- WebPartDisplayModeCollection.cs
- AutomationPattern.cs
- DuplicateContext.cs
- DropDownList.cs
- LazyLoadBehavior.cs
- ThreadStateException.cs
- PopupRootAutomationPeer.cs
- RequestCachingSection.cs
- EntityProviderFactory.cs
- OracleDataAdapter.cs
- ViewSimplifier.cs
- PropertyDescriptorGridEntry.cs
- DetailsViewInsertEventArgs.cs
- WmiPutTraceRecord.cs
- DataChangedEventManager.cs
- LassoSelectionBehavior.cs
- GridSplitterAutomationPeer.cs
- DataBoundLiteralControl.cs
- Schema.cs
- SqlConnectionStringBuilder.cs
- GB18030Encoding.cs
- ValidatorCollection.cs
- Compiler.cs
- NamedElement.cs