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
- ClockController.cs
- WizardDesigner.cs
- BaseWebProxyFinder.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- MultiByteCodec.cs
- ByteFacetDescriptionElement.cs
- SelectedDatesCollection.cs
- StorageAssociationTypeMapping.cs
- StandardOleMarshalObject.cs
- SystemColorTracker.cs
- FileDialogPermission.cs
- RelationshipEndMember.cs
- Point.cs
- InvokeBinder.cs
- SymbolEqualComparer.cs
- IriParsingElement.cs
- LinearQuaternionKeyFrame.cs
- DataSourceProvider.cs
- StylusPointPropertyUnit.cs
- PeerPresenceInfo.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- OneOfScalarConst.cs
- ScriptingJsonSerializationSection.cs
- Mapping.cs
- Int16AnimationUsingKeyFrames.cs
- ContainerParagraph.cs
- FixedSOMTextRun.cs
- SafeCryptoHandles.cs
- ListControlDataBindingHandler.cs
- ChtmlTextWriter.cs
- RawMouseInputReport.cs
- BuilderInfo.cs
- SmiContext.cs
- securestring.cs
- WebHttpBindingCollectionElement.cs
- ImageSource.cs
- coordinatorscratchpad.cs
- AnnotationDocumentPaginator.cs
- PerformanceCounterLib.cs
- Axis.cs
- CompressionTransform.cs
- SharedStatics.cs
- Size3DConverter.cs
- CompressedStack.cs
- TimeZone.cs
- MembershipValidatePasswordEventArgs.cs
- UIElementParagraph.cs
- Rules.cs
- ScriptReference.cs
- Itemizer.cs
- SystemThemeKey.cs
- DataComponentMethodGenerator.cs
- BaseUriHelper.cs
- FirewallWrapper.cs
- filewebrequest.cs
- QueryCoreOp.cs
- Dispatcher.cs
- ColumnCollectionEditor.cs
- cookieexception.cs
- DataServiceRequest.cs
- _SecureChannel.cs
- KeyboardNavigation.cs
- EditingMode.cs
- ExpressionDumper.cs
- UriScheme.cs
- DataColumnPropertyDescriptor.cs
- RelationalExpressions.cs
- UrlPath.cs
- SectionInput.cs
- PerformanceCounterPermissionAttribute.cs
- WindowsSolidBrush.cs
- NamespaceQuery.cs
- ExpressionBindingCollection.cs
- XmlComment.cs
- TextDecorations.cs
- ContainerControl.cs
- ViewGenResults.cs
- WebPartRestoreVerb.cs
- SymbolType.cs
- TriState.cs
- counter.cs
- TextProviderWrapper.cs
- Brush.cs
- ClientCultureInfo.cs
- ZipIOLocalFileHeader.cs
- Context.cs
- BasicAsyncResult.cs
- Frame.cs
- RangeValueProviderWrapper.cs
- XmlNode.cs
- ChannelTracker.cs
- SerialPinChanges.cs
- CheckBoxFlatAdapter.cs
- ResourceReferenceExpressionConverter.cs
- ServerReliableChannelBinder.cs
- URLBuilder.cs
- ListViewDeleteEventArgs.cs
- ModelPropertyCollectionImpl.cs
- CuspData.cs
- GridSplitterAutomationPeer.cs