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
- EventPropertyMap.cs
- OperationParameterInfoCollection.cs
- SafeHandles.cs
- PrincipalPermission.cs
- HandleRef.cs
- XmlHierarchicalEnumerable.cs
- RadioButton.cs
- StructureChangedEventArgs.cs
- ThicknessKeyFrameCollection.cs
- TargetInvocationException.cs
- ParseChildrenAsPropertiesAttribute.cs
- ToolboxBitmapAttribute.cs
- XPathArrayIterator.cs
- EmissiveMaterial.cs
- ToolStripStatusLabel.cs
- SQLDoubleStorage.cs
- FullTextBreakpoint.cs
- ExpressionBuilder.cs
- LiteralSubsegment.cs
- MetadataSerializer.cs
- BaseDataListPage.cs
- GeneralTransform.cs
- SupportingTokenAuthenticatorSpecification.cs
- DataConnectionHelper.cs
- ScriptReference.cs
- NativeMethods.cs
- PerformanceCountersElement.cs
- SamlAuthenticationClaimResource.cs
- BamlMapTable.cs
- HttpWriter.cs
- SqlNotificationRequest.cs
- DropShadowBitmapEffect.cs
- TextWriterEngine.cs
- AstTree.cs
- BaseParagraph.cs
- ArcSegment.cs
- AttributeEmitter.cs
- PagePropertiesChangingEventArgs.cs
- DocumentViewerHelper.cs
- RemoteWebConfigurationHost.cs
- ApplicationFileParser.cs
- ListBase.cs
- DriveNotFoundException.cs
- EdmError.cs
- RadioButton.cs
- HierarchicalDataBoundControl.cs
- ExpandCollapsePattern.cs
- SettingsAttributes.cs
- ExpandCollapseProviderWrapper.cs
- Canvas.cs
- NegotiationTokenAuthenticator.cs
- DesignerOptionService.cs
- PlacementWorkspace.cs
- Oci.cs
- FunctionCommandText.cs
- TimeSpanFormat.cs
- BitmapSourceSafeMILHandle.cs
- RectKeyFrameCollection.cs
- OutOfProcStateClientManager.cs
- JumpTask.cs
- TreeBuilder.cs
- Activator.cs
- UIElementCollection.cs
- MetadataAssemblyHelper.cs
- ellipse.cs
- DependencyPropertyConverter.cs
- StreamWithDictionary.cs
- SQLSingleStorage.cs
- LabelAutomationPeer.cs
- StylusPointDescription.cs
- WebPartConnectionsDisconnectVerb.cs
- Validator.cs
- CodeNamespaceCollection.cs
- ColumnProvider.cs
- ConstraintEnumerator.cs
- EntityViewGenerationConstants.cs
- ObjectViewQueryResultData.cs
- AsymmetricAlgorithm.cs
- DbReferenceCollection.cs
- SerializationHelper.cs
- CreateRefExpr.cs
- ListBoxAutomationPeer.cs
- CollectionsUtil.cs
- ImageButton.cs
- ToolStripItemTextRenderEventArgs.cs
- MergePropertyDescriptor.cs
- AttributeCollection.cs
- _NtlmClient.cs
- XmlSchemaAnnotation.cs
- ToolStripDropDownMenu.cs
- XPathNodeList.cs
- TextServicesCompartment.cs
- CharEnumerator.cs
- DataMemberConverter.cs
- StorageAssociationSetMapping.cs
- GeneralTransform3DCollection.cs
- Padding.cs
- M3DUtil.cs
- SmiXetterAccessMap.cs
- HMACRIPEMD160.cs