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
- XmlILOptimizerVisitor.cs
- CultureInfoConverter.cs
- ClientType.cs
- CodeTypeReferenceSerializer.cs
- _NegoState.cs
- MsmqVerifier.cs
- MarkupExtensionReturnTypeAttribute.cs
- GB18030Encoding.cs
- DaylightTime.cs
- Int64Converter.cs
- QilReference.cs
- CodeLabeledStatement.cs
- XmlQueryTypeFactory.cs
- DeferredReference.cs
- Line.cs
- PointLightBase.cs
- BrowserCapabilitiesCodeGenerator.cs
- ConfigViewGenerator.cs
- ServiceModelInstallComponent.cs
- EventLogEntry.cs
- String.cs
- StoragePropertyMapping.cs
- HotSpotCollection.cs
- VectorValueSerializer.cs
- DefaultTextStore.cs
- BeginStoryboard.cs
- StoreItemCollection.cs
- MSHTMLHost.cs
- TextEditorTyping.cs
- MachineKeyConverter.cs
- ErrorWrapper.cs
- WebPartManagerInternals.cs
- PropertyFilter.cs
- ToolStripItemImageRenderEventArgs.cs
- DataControlCommands.cs
- SemanticResultValue.cs
- DetailsViewPagerRow.cs
- Button.cs
- FixedSOMPage.cs
- PrintingPermissionAttribute.cs
- MimeMultiPart.cs
- SkipStoryboardToFill.cs
- LinkConverter.cs
- PasswordRecoveryAutoFormat.cs
- ResourceCodeDomSerializer.cs
- XmlNamedNodeMap.cs
- SqlProviderManifest.cs
- SerializerProvider.cs
- ArgumentNullException.cs
- FormsAuthenticationUserCollection.cs
- Rect.cs
- MailBnfHelper.cs
- Wizard.cs
- ForwardPositionQuery.cs
- InfoCardMasterKey.cs
- TypeGeneratedEventArgs.cs
- IntAverageAggregationOperator.cs
- assertwrapper.cs
- OptimisticConcurrencyException.cs
- SqlConnectionHelper.cs
- EntityTransaction.cs
- OleServicesContext.cs
- SynchronizingStream.cs
- ComPersistableTypeElement.cs
- Serializer.cs
- PropertyEmitterBase.cs
- PrePostDescendentsWalker.cs
- Attributes.cs
- ManipulationLogic.cs
- PageFunction.cs
- ValueTypeFieldReference.cs
- MouseButton.cs
- DataExpression.cs
- PhysicalAddress.cs
- DispatcherTimer.cs
- UrlPropertyAttribute.cs
- DataGridrowEditEndingEventArgs.cs
- ContextTokenTypeConverter.cs
- DnsPermission.cs
- XmlSchemaSimpleTypeUnion.cs
- DataContractSerializerSection.cs
- XmlNullResolver.cs
- SchemaDeclBase.cs
- SectionVisual.cs
- IdnMapping.cs
- TextPenaltyModule.cs
- Workspace.cs
- FontStretches.cs
- OleStrCAMarshaler.cs
- BaseUriHelper.cs
- ItemsPanelTemplate.cs
- EditorAttribute.cs
- DebugHandleTracker.cs
- Int16.cs
- SuppressMergeCheckAttribute.cs
- webbrowsersite.cs
- SqlDataSourceEnumerator.cs
- SmiMetaData.cs
- ByteAnimation.cs
- EventHandlersStore.cs