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
- ObjectSpanRewriter.cs
- Internal.cs
- AsyncPostBackTrigger.cs
- InputMethodStateTypeInfo.cs
- RecordManager.cs
- CalendarModeChangedEventArgs.cs
- ForwardPositionQuery.cs
- MatrixCamera.cs
- WebPartTransformer.cs
- RoleManagerModule.cs
- SystemShuttingDownException.cs
- cookiecollection.cs
- SchemaInfo.cs
- TogglePattern.cs
- Helper.cs
- Timer.cs
- HttpHandlerAction.cs
- WebDisplayNameAttribute.cs
- StackOverflowException.cs
- figurelengthconverter.cs
- Quad.cs
- EventNotify.cs
- TrackBarRenderer.cs
- FixedFlowMap.cs
- ThemeDictionaryExtension.cs
- ScriptReference.cs
- AudioSignalProblemOccurredEventArgs.cs
- InputScopeAttribute.cs
- BufferModeSettings.cs
- ConfigXmlDocument.cs
- HttpHandlerAction.cs
- DoubleAnimationBase.cs
- BamlCollectionHolder.cs
- DocumentXmlWriter.cs
- Tokenizer.cs
- VideoDrawing.cs
- assertwrapper.cs
- StylusPointPropertyInfo.cs
- DrawingGroup.cs
- PKCS1MaskGenerationMethod.cs
- DiagnosticTraceSchemas.cs
- ObjectContext.cs
- TextEndOfSegment.cs
- FileInfo.cs
- DataTableExtensions.cs
- ErrorRuntimeConfig.cs
- HierarchicalDataBoundControl.cs
- BridgeDataReader.cs
- ShutDownListener.cs
- OutputCacheSettings.cs
- TemplateComponentConnector.cs
- SystemTcpConnection.cs
- PublishLicense.cs
- EnumerableCollectionView.cs
- MenuItemBinding.cs
- XPathChildIterator.cs
- DependencyObject.cs
- CodeMemberEvent.cs
- IPipelineRuntime.cs
- TimeSpanMinutesConverter.cs
- ArrayElementGridEntry.cs
- AnnotationDocumentPaginator.cs
- SqlInternalConnectionTds.cs
- DbConnectionOptions.cs
- SoundPlayerAction.cs
- Mouse.cs
- MSAAEventDispatcher.cs
- ContextMenu.cs
- XmlValidatingReaderImpl.cs
- HttpDictionary.cs
- ScriptBehaviorDescriptor.cs
- CacheEntry.cs
- SaveFileDialog.cs
- CommandValueSerializer.cs
- CompoundFileReference.cs
- RoleService.cs
- MultiAsyncResult.cs
- RegistrySecurity.cs
- SubMenuStyle.cs
- ToolBarButton.cs
- DesignOnlyAttribute.cs
- Win32MouseDevice.cs
- DataGridViewCellEventArgs.cs
- SqlDataRecord.cs
- DocumentApplication.cs
- AuthorizationSection.cs
- HttpRawResponse.cs
- SafeLocalMemHandle.cs
- BackgroundFormatInfo.cs
- ValidationSummary.cs
- TcpConnectionPool.cs
- ViewBase.cs
- SequentialUshortCollection.cs
- CallbackHandler.cs
- XmlSerializerSection.cs
- ActiveXSite.cs
- DataGridRelationshipRow.cs
- XmlNotation.cs
- IntSecurity.cs
- OutputCacheProfileCollection.cs