Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ColorContext.cs
- OracleDataReader.cs
- FamilyTypeface.cs
- ParallelTimeline.cs
- RuleSettingsCollection.cs
- EntityDataSourceDesigner.cs
- InputBinding.cs
- RelationshipSet.cs
- InOutArgument.cs
- ResourcesChangeInfo.cs
- XPathSingletonIterator.cs
- MediaCommands.cs
- StorageMappingItemLoader.cs
- ComplexPropertyEntry.cs
- CompensationTokenData.cs
- HistoryEventArgs.cs
- Table.cs
- GridViewEditEventArgs.cs
- TextSegment.cs
- DiscardableAttribute.cs
- HttpHostedTransportConfiguration.cs
- RemotingSurrogateSelector.cs
- BaseHashHelper.cs
- ProxyElement.cs
- SqlNotificationEventArgs.cs
- DetailsViewInsertEventArgs.cs
- CanonicalizationDriver.cs
- HuffModule.cs
- WebZone.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- InvocationExpression.cs
- xmlglyphRunInfo.cs
- ResolvedKeyFrameEntry.cs
- SerializationEventsCache.cs
- TextViewBase.cs
- ProviderConnectionPoint.cs
- QueryActivatableWorkflowsCommand.cs
- ImmutableAssemblyCacheEntry.cs
- UserControl.cs
- PageOrientation.cs
- GeometryValueSerializer.cs
- GacUtil.cs
- VirtualDirectoryMappingCollection.cs
- ContractMapping.cs
- FacetDescription.cs
- SyndicationDeserializer.cs
- Dictionary.cs
- TransportationConfigurationTypeInstallComponent.cs
- DataRowChangeEvent.cs
- WebRequestModulesSection.cs
- AlignmentXValidation.cs
- XmlSchemaSimpleTypeUnion.cs
- PageFunction.cs
- CompositeFontFamily.cs
- RegistryExceptionHelper.cs
- PathSegment.cs
- CodeRemoveEventStatement.cs
- SuppressMergeCheckAttribute.cs
- CodeDirectionExpression.cs
- SqlClientPermission.cs
- TransformGroup.cs
- Command.cs
- ChannelServices.cs
- ManagedWndProcTracker.cs
- _LazyAsyncResult.cs
- ToolBar.cs
- RegexParser.cs
- FileUpload.cs
- GrammarBuilderBase.cs
- ProxyManager.cs
- XmlCharCheckingReader.cs
- PixelFormat.cs
- FreezableCollection.cs
- InstanceDataCollectionCollection.cs
- DataControlFieldHeaderCell.cs
- AsynchronousChannel.cs
- FlowLayoutPanel.cs
- Reference.cs
- ContentValidator.cs
- CloudCollection.cs
- AlphaSortedEnumConverter.cs
- RemoteTokenFactory.cs
- ConfigViewGenerator.cs
- EntityDataSourceStatementEditorForm.cs
- ComponentEditorPage.cs
- DataControlButton.cs
- HttpCacheVaryByContentEncodings.cs
- HttpConfigurationSystem.cs
- XmlBoundElement.cs
- ProcessHostFactoryHelper.cs
- ReachVisualSerializerAsync.cs
- IISUnsafeMethods.cs
- FunctionParameter.cs
- ZoneMembershipCondition.cs
- MetadataImporter.cs
- SQlBooleanStorage.cs
- ScriptControlDescriptor.cs
- ComplexTypeEmitter.cs
- BindingsCollection.cs
- OdbcConnectionFactory.cs