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
- KeysConverter.cs
- StringDictionary.cs
- SourceFileBuildProvider.cs
- ValidationError.cs
- MetadataExchangeClient.cs
- Bits.cs
- OleDbParameter.cs
- ValueConversionAttribute.cs
- ApplicationSecurityInfo.cs
- ViewKeyConstraint.cs
- TrackingConditionCollection.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- PathGeometry.cs
- SQLDouble.cs
- Queue.cs
- PseudoWebRequest.cs
- InvalidContentTypeException.cs
- PolicyLevel.cs
- ParameterCollectionEditorForm.cs
- PermissionToken.cs
- TextDecorations.cs
- HashCodeCombiner.cs
- XPathEmptyIterator.cs
- CollectionType.cs
- MexTcpBindingCollectionElement.cs
- PersistNameAttribute.cs
- RequestNavigateEventArgs.cs
- DictionaryContent.cs
- BmpBitmapDecoder.cs
- ListViewContainer.cs
- BitmapDownload.cs
- ChineseLunisolarCalendar.cs
- XhtmlConformanceSection.cs
- DbException.cs
- Point3DConverter.cs
- BreakSafeBase.cs
- loginstatus.cs
- EventSinkHelperWriter.cs
- HttpHandler.cs
- SerializationException.cs
- HttpWebResponse.cs
- TCEAdapterGenerator.cs
- SecurityRuntime.cs
- WorkflowView.cs
- UTF8Encoding.cs
- AuthStoreRoleProvider.cs
- Convert.cs
- ListViewSortEventArgs.cs
- TypeGeneratedEventArgs.cs
- MaterialGroup.cs
- TemplateBindingExpressionConverter.cs
- FormsAuthenticationModule.cs
- SystemParameters.cs
- WithStatement.cs
- UnsafeNativeMethodsMilCoreApi.cs
- ValidationError.cs
- DataTableCollection.cs
- XmlTypeMapping.cs
- DataChangedEventManager.cs
- MatrixTransform3D.cs
- Wildcard.cs
- TextReturnReader.cs
- ReachSerializationCacheItems.cs
- KernelTypeValidation.cs
- DefaultObjectMappingItemCollection.cs
- XmlDataSourceNodeDescriptor.cs
- TranslateTransform.cs
- UInt16Converter.cs
- MatrixCamera.cs
- MetadataArtifactLoaderComposite.cs
- SafeNativeMethodsMilCoreApi.cs
- Rect3DConverter.cs
- TrackingProfileSerializer.cs
- MatchSingleFxEngineOpcode.cs
- SimpleWorkerRequest.cs
- Membership.cs
- LeafCellTreeNode.cs
- RectAnimationClockResource.cs
- ToolStripDropDownClosingEventArgs.cs
- Calendar.cs
- SystemWebCachingSectionGroup.cs
- ArraySortHelper.cs
- ToolboxComponentsCreatedEventArgs.cs
- Pkcs9Attribute.cs
- DataGridColumnEventArgs.cs
- SqlProfileProvider.cs
- handlecollector.cs
- XPathCompileException.cs
- ExceptionUtility.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- TreeViewBindingsEditorForm.cs
- ProfileService.cs
- VerificationException.cs
- EnglishPluralizationService.cs
- SqlDeflator.cs
- ConnectionStringsExpressionBuilder.cs
- PartialToken.cs
- SymbolMethod.cs
- odbcmetadatafactory.cs
- PageSettings.cs