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
- WebConfigurationHost.cs
- columnmapfactory.cs
- ObjectDataSourceStatusEventArgs.cs
- PositiveTimeSpanValidatorAttribute.cs
- MultiTouchSystemGestureLogic.cs
- DbProviderFactories.cs
- ServerIdentity.cs
- FlowDocumentPage.cs
- ToolBar.cs
- EditingMode.cs
- EditBehavior.cs
- StringToken.cs
- DbSourceCommand.cs
- XsltConvert.cs
- DefaultSettingsSection.cs
- DataControlButton.cs
- ControlCollection.cs
- UniqueID.cs
- TransformerInfo.cs
- ProgressBarRenderer.cs
- OuterGlowBitmapEffect.cs
- BaseCAMarshaler.cs
- RadioButtonAutomationPeer.cs
- TextOptions.cs
- MemoryPressure.cs
- PictureBox.cs
- PolyQuadraticBezierSegment.cs
- FixedHyperLink.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- SqlRetyper.cs
- ByteStreamGeometryContext.cs
- TraceContextEventArgs.cs
- MediaEntryAttribute.cs
- ConfigurationFileMap.cs
- EntityCommandCompilationException.cs
- GestureRecognizer.cs
- FormViewInsertedEventArgs.cs
- EntitySet.cs
- TransactionChannelListener.cs
- UrlParameterReader.cs
- ListSourceHelper.cs
- FaultContractAttribute.cs
- HttpDictionary.cs
- ScalarConstant.cs
- cache.cs
- KeyConverter.cs
- InvalidOleVariantTypeException.cs
- PixelShader.cs
- DependencyObject.cs
- PersonalizableTypeEntry.cs
- Point3D.cs
- ConfigXmlSignificantWhitespace.cs
- FormParameter.cs
- SecurityManager.cs
- EntitySqlQueryCacheEntry.cs
- Odbc32.cs
- Tokenizer.cs
- TextServicesPropertyRanges.cs
- Dictionary.cs
- JsonEncodingStreamWrapper.cs
- SqlClientFactory.cs
- ReceiveMessageRecord.cs
- UserPreferenceChangingEventArgs.cs
- Zone.cs
- TransactionProtocolConverter.cs
- TransactedReceiveScope.cs
- TabControl.cs
- OlePropertyStructs.cs
- serverconfig.cs
- DBDataPermission.cs
- WebResourceAttribute.cs
- VectorAnimation.cs
- WorkflowInstanceQuery.cs
- ErrorStyle.cs
- XPathException.cs
- MetadataArtifactLoaderComposite.cs
- WmlPhoneCallAdapter.cs
- Vector3D.cs
- PasswordBox.cs
- Propagator.Evaluator.cs
- AddInIpcChannel.cs
- ResourceDescriptionAttribute.cs
- NegotiationTokenAuthenticatorState.cs
- InvalidateEvent.cs
- WebPartZoneBase.cs
- ParameterInfo.cs
- JsonDeserializer.cs
- TypeUnloadedException.cs
- FactoryId.cs
- MarshalByRefObject.cs
- CssClassPropertyAttribute.cs
- PasswordRecoveryDesigner.cs
- SamlSubject.cs
- NumericUpDownAccelerationCollection.cs
- ComAdminWrapper.cs
- FontNameEditor.cs
- DebugViewWriter.cs
- MsmqAppDomainProtocolHandler.cs
- EditorAttribute.cs
- MapPathBasedVirtualPathProvider.cs