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
- SimpleApplicationHost.cs
- SingleTagSectionHandler.cs
- TraceData.cs
- AssemblyCacheEntry.cs
- CompressedStack.cs
- UpdateCommandGenerator.cs
- UnmanagedMarshal.cs
- CodeConditionStatement.cs
- BitmapEncoder.cs
- ToolStripDropTargetManager.cs
- Renderer.cs
- TheQuery.cs
- ConfigurationManagerInternal.cs
- RowType.cs
- BitmapEffectDrawing.cs
- AxisAngleRotation3D.cs
- _Connection.cs
- DrawListViewItemEventArgs.cs
- PolygonHotSpot.cs
- ExceptionValidationRule.cs
- DataViewSetting.cs
- XComponentModel.cs
- DataListItemEventArgs.cs
- HtmlForm.cs
- FontWeightConverter.cs
- webproxy.cs
- DashStyle.cs
- DetailsViewModeEventArgs.cs
- XhtmlConformanceSection.cs
- SQLDecimalStorage.cs
- DataGridItemAttachedStorage.cs
- mda.cs
- MobileUserControlDesigner.cs
- EventPrivateKey.cs
- InputScopeConverter.cs
- SoapFault.cs
- ImpersonateTokenRef.cs
- DbMetaDataFactory.cs
- MessageQueue.cs
- SettingsSavedEventArgs.cs
- MatrixUtil.cs
- GACMembershipCondition.cs
- SecurityTokenInclusionMode.cs
- ObjectSet.cs
- Equal.cs
- GuidelineSet.cs
- StyleXamlTreeBuilder.cs
- SourceSwitch.cs
- SkewTransform.cs
- SelectionUIService.cs
- CalloutQueueItem.cs
- FormsAuthenticationCredentials.cs
- ColumnResizeUndoUnit.cs
- BinaryFormatter.cs
- Brushes.cs
- MemberListBinding.cs
- Trigger.cs
- RecordsAffectedEventArgs.cs
- TemplateBindingExtension.cs
- shaperfactory.cs
- DataProtection.cs
- XmlSchemaSimpleTypeList.cs
- ECDiffieHellmanPublicKey.cs
- KnownTypesProvider.cs
- SpotLight.cs
- QuotedPrintableStream.cs
- ModuleConfigurationInfo.cs
- ExtractCollection.cs
- SimpleBitVector32.cs
- ProxyFragment.cs
- ACE.cs
- Propagator.cs
- X500Name.cs
- ConnectionManager.cs
- Html32TextWriter.cs
- SqlProvider.cs
- ClientTarget.cs
- FormViewInsertedEventArgs.cs
- AudioFormatConverter.cs
- HMAC.cs
- HttpMethodAttribute.cs
- WebConfigurationFileMap.cs
- TextElementEditingBehaviorAttribute.cs
- SequentialUshortCollection.cs
- EmbeddedMailObjectsCollection.cs
- IdentitySection.cs
- EventLogPropertySelector.cs
- XmlNullResolver.cs
- DbConnectionFactory.cs
- ActivityXamlServices.cs
- FocusWithinProperty.cs
- StylusPointDescription.cs
- WebPartMovingEventArgs.cs
- MsmqPoisonMessageException.cs
- SqlErrorCollection.cs
- LinqDataSourceDeleteEventArgs.cs
- OracleParameter.cs
- ListViewTableRow.cs
- DbConnectionPoolCounters.cs
- RtfControlWordInfo.cs