Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //----------------------------------------------------------------------------- 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
- LogStore.cs
- VirtualStackFrame.cs
- CryptographicAttribute.cs
- Rect3DValueSerializer.cs
- BuildDependencySet.cs
- TargetConverter.cs
- AnnotationService.cs
- UnauthorizedAccessException.cs
- WebException.cs
- EdmSchemaAttribute.cs
- Funcletizer.cs
- ActiveXContainer.cs
- XsltException.cs
- ParameterInfo.cs
- GridViewRowCollection.cs
- HttpEncoder.cs
- CharStorage.cs
- CellIdBoolean.cs
- RsaKeyIdentifierClause.cs
- PeerCollaborationPermission.cs
- CqlLexer.cs
- DrawingCollection.cs
- Base64Stream.cs
- SecurityTokenException.cs
- MembershipUser.cs
- Transform.cs
- ListBase.cs
- ExternalCalls.cs
- DateTimeConverter2.cs
- SecuritySessionClientSettings.cs
- CodeAttributeArgument.cs
- DispatcherEventArgs.cs
- ToggleProviderWrapper.cs
- ScriptReferenceBase.cs
- XmlSchemaObjectCollection.cs
- DataGridTextBox.cs
- NamespaceDecl.cs
- StringValidator.cs
- UserThread.cs
- HttpDictionary.cs
- IxmlLineInfo.cs
- Processor.cs
- Pointer.cs
- ParseChildrenAsPropertiesAttribute.cs
- WsatEtwTraceListener.cs
- ExpressionConverter.cs
- XmlJsonWriter.cs
- EnumerableWrapperWeakToStrong.cs
- DataGridViewTextBoxColumn.cs
- SystemInfo.cs
- CodeTryCatchFinallyStatement.cs
- GeneralTransform.cs
- ArgumentOutOfRangeException.cs
- CorePropertiesFilter.cs
- WindowsSpinner.cs
- CombinedGeometry.cs
- TemplatedControlDesigner.cs
- PeerTransportCredentialType.cs
- DataGridParentRows.cs
- RawAppCommandInputReport.cs
- IndexingContentUnit.cs
- XamlGridLengthSerializer.cs
- SqlDesignerDataSourceView.cs
- AssemblyName.cs
- SimpleApplicationHost.cs
- SmiRecordBuffer.cs
- TreeView.cs
- EditorPartCollection.cs
- ColumnMapCopier.cs
- PropertyItem.cs
- SchemaObjectWriter.cs
- PreviewKeyDownEventArgs.cs
- ReadOnlyDataSourceView.cs
- _NtlmClient.cs
- DateTimeFormatInfoScanner.cs
- UpdatePanel.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- WeakRefEnumerator.cs
- DataGridCheckBoxColumn.cs
- HtmlToClrEventProxy.cs
- HtmlElementCollection.cs
- ConfigurationManagerInternalFactory.cs
- MemberCollection.cs
- CollectionContainer.cs
- DataTableCollection.cs
- RuntimeConfigLKG.cs
- Stylus.cs
- XmlSchemaType.cs
- TextServicesLoader.cs
- DashStyles.cs
- DataError.cs
- OleDbReferenceCollection.cs
- XPathItem.cs
- PropertyValueUIItem.cs
- XmlTextReader.cs
- ClientConfigurationSystem.cs
- Win32.cs
- Section.cs
- DynamicUpdateCommand.cs
- ImageButton.cs