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
- SinglePageViewer.cs
- AutoResetEvent.cs
- SecurityPermission.cs
- EventHandlersDesigner.cs
- BaseResourcesBuildProvider.cs
- FileDialog.cs
- XmlMembersMapping.cs
- WebColorConverter.cs
- DynamicRendererThreadManager.cs
- SqlServices.cs
- ReturnEventArgs.cs
- HighlightVisual.cs
- SqlError.cs
- WpfWebRequestHelper.cs
- MultidimensionalArrayItemReference.cs
- FrameworkElement.cs
- ConnectionStringSettingsCollection.cs
- ButtonDesigner.cs
- DiscoveryEndpointElement.cs
- StreamHelper.cs
- FormatConvertedBitmap.cs
- EmptyControlCollection.cs
- PropertyStore.cs
- NativeMethods.cs
- BoundConstants.cs
- TreeViewItemAutomationPeer.cs
- DefaultEventAttribute.cs
- PageVisual.cs
- FixedElement.cs
- BitVector32.cs
- SwitchElementsCollection.cs
- CodeTypeReference.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- ToolStripControlHost.cs
- TextContainerChangeEventArgs.cs
- XmlFormatReaderGenerator.cs
- AssociationSet.cs
- ResourcesBuildProvider.cs
- FontSourceCollection.cs
- X509SubjectKeyIdentifierClause.cs
- Debug.cs
- HostingEnvironmentSection.cs
- ColorTypeConverter.cs
- RIPEMD160Managed.cs
- SiblingIterators.cs
- WebBrowserHelper.cs
- EmbeddedObject.cs
- SmiRequestExecutor.cs
- listitem.cs
- HttpCookie.cs
- DetailsViewDesigner.cs
- WorkflowApplicationAbortedException.cs
- WebPartConnectionsCancelEventArgs.cs
- Int32.cs
- Utils.cs
- SpeakCompletedEventArgs.cs
- DataGridViewImageCell.cs
- IISMapPath.cs
- ButtonPopupAdapter.cs
- ExpressionParser.cs
- RenderDataDrawingContext.cs
- Random.cs
- DebugView.cs
- EventLogWatcher.cs
- XhtmlTextWriter.cs
- ConfigXmlDocument.cs
- SelectorAutomationPeer.cs
- TextBoxRenderer.cs
- SystemIPv4InterfaceProperties.cs
- ellipse.cs
- DataControlField.cs
- RankException.cs
- SetIterators.cs
- MethodExecutor.cs
- RenderTargetBitmap.cs
- DPTypeDescriptorContext.cs
- SemaphoreSlim.cs
- ConfigurationSection.cs
- WaitHandleCannotBeOpenedException.cs
- IndentedTextWriter.cs
- indexingfiltermarshaler.cs
- HtmlSelect.cs
- ReflectionServiceProvider.cs
- MainMenu.cs
- HttpListenerContext.cs
- XamlTemplateSerializer.cs
- FontCacheLogic.cs
- ContentPlaceHolder.cs
- SortExpressionBuilder.cs
- DetailsViewModeEventArgs.cs
- DeviceFiltersSection.cs
- CodeIterationStatement.cs
- ListViewItemEventArgs.cs
- XXXInfos.cs
- HandlerBase.cs
- DurationConverter.cs
- WebPartMenuStyle.cs
- DeclarativeCatalogPartDesigner.cs
- ArrayList.cs
- AppSettings.cs