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
- LayoutTable.cs
- FileDialog_Vista_Interop.cs
- _ConnectStream.cs
- ListMarkerSourceInfo.cs
- LogManagementAsyncResult.cs
- AtlasWeb.Designer.cs
- SocketStream.cs
- CultureInfo.cs
- SudsParser.cs
- PtsContext.cs
- MenuCommandsChangedEventArgs.cs
- Point4DValueSerializer.cs
- LongValidatorAttribute.cs
- xmlfixedPageInfo.cs
- WebPartActionVerb.cs
- ThemeDictionaryExtension.cs
- WebPartDisplayModeEventArgs.cs
- StyleCollection.cs
- GeometryCombineModeValidation.cs
- TextControlDesigner.cs
- InvocationExpression.cs
- IdentitySection.cs
- UniqueID.cs
- PropertyInfoSet.cs
- NetPeerTcpBinding.cs
- ErrorLog.cs
- ObjectViewListener.cs
- WhitespaceRule.cs
- PocoPropertyAccessorStrategy.cs
- HtmlInputButton.cs
- MenuItem.cs
- FilterQuery.cs
- BitmapCodecInfoInternal.cs
- HighlightVisual.cs
- SaveFileDialog.cs
- XMLSyntaxException.cs
- DesignerProperties.cs
- SuppressMergeCheckAttribute.cs
- ErrorHandler.cs
- WindowsAuthenticationEventArgs.cs
- PointLightBase.cs
- TraceListeners.cs
- Transform3DGroup.cs
- ZipIOCentralDirectoryBlock.cs
- IdentitySection.cs
- OutputWindow.cs
- SplashScreenNativeMethods.cs
- ActivityLocationReferenceEnvironment.cs
- WSDualHttpSecurity.cs
- StoreConnection.cs
- ConnectionManagementElement.cs
- CompiledIdentityConstraint.cs
- HScrollBar.cs
- WsatServiceAddress.cs
- ErrorStyle.cs
- Message.cs
- CheckBox.cs
- QueryContinueDragEvent.cs
- AssemblyCache.cs
- ComplexBindingPropertiesAttribute.cs
- SchemaImporterExtension.cs
- Int16Storage.cs
- SqlDependency.cs
- EntityClientCacheKey.cs
- Column.cs
- NullExtension.cs
- ToolStripContainer.cs
- ConfigXmlWhitespace.cs
- DrawingGroup.cs
- MobileComponentEditorPage.cs
- FilterException.cs
- ListViewInsertEventArgs.cs
- HostingEnvironmentSection.cs
- Int16AnimationBase.cs
- BindingSource.cs
- AppDomainShutdownMonitor.cs
- WebPartTransformerCollection.cs
- ClientScriptManager.cs
- HandleCollector.cs
- DrawListViewItemEventArgs.cs
- SelectionPatternIdentifiers.cs
- DataGridViewCellCollection.cs
- ConfigurationConverterBase.cs
- DataRecordInfo.cs
- FormParameter.cs
- ActiveXContainer.cs
- IntegrationExceptionEventArgs.cs
- DbProviderServices.cs
- AudioException.cs
- TabItem.cs
- NetNamedPipeSecurityElement.cs
- Point4D.cs
- ViewPort3D.cs
- SemaphoreFullException.cs
- AllowedAudienceUriElementCollection.cs
- SR.Designer.cs
- ButtonColumn.cs
- ForwardPositionQuery.cs
- MsmqIntegrationInputMessage.cs
- PropertyGrid.cs