Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- peernodeimplementation.cs
- WebCodeGenerator.cs
- HttpCookie.cs
- Pens.cs
- OwnerDrawPropertyBag.cs
- CompositeActivityTypeDescriptorProvider.cs
- HttpListenerException.cs
- StartUpEventArgs.cs
- EraserBehavior.cs
- ScriptReference.cs
- EditCommandColumn.cs
- PrintDocument.cs
- ProtectedProviderSettings.cs
- XPathDocumentNavigator.cs
- X500Name.cs
- WebMethodAttribute.cs
- ApplyImportsAction.cs
- WebControl.cs
- ToolStripArrowRenderEventArgs.cs
- XmlProcessingInstruction.cs
- SymbolDocumentInfo.cs
- LayoutTable.cs
- Activator.cs
- TextSerializer.cs
- DateTimeSerializationSection.cs
- TextSchema.cs
- HttpConfigurationSystem.cs
- DataServiceContext.cs
- StackBuilderSink.cs
- ObjectDataSourceFilteringEventArgs.cs
- ByteFacetDescriptionElement.cs
- TimeSpanSecondsConverter.cs
- XmlSerializationGeneratedCode.cs
- XmlSchemaDocumentation.cs
- XAMLParseException.cs
- RowToParametersTransformer.cs
- ISCIIEncoding.cs
- FormDesigner.cs
- DivideByZeroException.cs
- ListMarkerLine.cs
- ServiceHostFactory.cs
- PrintDocument.cs
- AccessibilityApplicationManager.cs
- ClonableStack.cs
- VideoDrawing.cs
- BinaryWriter.cs
- SqlUnionizer.cs
- DateRangeEvent.cs
- _ConnectStream.cs
- PowerStatus.cs
- DataGridViewCellEventArgs.cs
- ProfileBuildProvider.cs
- ColorIndependentAnimationStorage.cs
- TimelineClockCollection.cs
- ListBoxDesigner.cs
- PeerResolverElement.cs
- ProvidersHelper.cs
- AppSettingsSection.cs
- MemoryMappedViewStream.cs
- AsyncStreamReader.cs
- EncodingInfo.cs
- ResourcePermissionBase.cs
- ComponentResourceManager.cs
- ZipIOBlockManager.cs
- SystemFonts.cs
- _WinHttpWebProxyDataBuilder.cs
- DesignerOptions.cs
- Error.cs
- PDBReader.cs
- OdbcDataAdapter.cs
- WebPartManagerInternals.cs
- DataControlReference.cs
- CompilationRelaxations.cs
- ResourceDisplayNameAttribute.cs
- URLAttribute.cs
- SerializationSectionGroup.cs
- BatchParser.cs
- TextEditorCopyPaste.cs
- InlineUIContainer.cs
- hresults.cs
- DbLambda.cs
- PopupRootAutomationPeer.cs
- TextPatternIdentifiers.cs
- SqlCommandSet.cs
- RawStylusActions.cs
- CompositeDesignerAccessibleObject.cs
- ThreadExceptionDialog.cs
- MemberJoinTreeNode.cs
- AuthStoreRoleProvider.cs
- LineSegment.cs
- MediaElementAutomationPeer.cs
- BindingWorker.cs
- SecurityTokenParametersEnumerable.cs
- ObjectNavigationPropertyMapping.cs
- Models.cs
- WebPartVerb.cs
- ValidatorCompatibilityHelper.cs
- BaseParaClient.cs
- Annotation.cs
- ReadOnlyNameValueCollection.cs