Note that there are some explanatory texts on larger screens.

plurals
  1. POVC++ / CLI abstract method implementation problem for c#
    primarykey
    data
    text
    <p>I am working on a pdf class library project. I create a base abstract class for all output process'.</p> <p>here is the code:</p> <pre><code> public ref class PDFPrinter { internal: int index; SPDFPrinter* p; public: PDFPrinter(); virtual property int HorizontalDPI { int get(){ return 72; } } virtual property int VerticalDPI { int get(){ return 72; } } virtual property bool UseMediaBox { bool get(){ return true; } } virtual property bool CropPage { bool get(){ return true; } } virtual property Second::PDF::PageRotation PageRotation { Second::PDF::PageRotation get() {return Second::PDF::PageRotation::Rotate0; } } virtual property bool IsUpsideDownCoordinateSystem { bool get() = 0; } virtual property bool CanUseDrawChar { bool get() = 0; } virtual property bool IsType3CharsInterpretted { bool get() = 0; } virtual property bool CanUseTilingPatternFill { bool get() = 0; } virtual property bool CanUseShadedFills{ bool get() = 0; } virtual property bool CanUseDrawForm{ bool get() = 0; } virtual property bool CanResolveText { bool get() = 0; } virtual property bool CanCreateAntialiasedVectors { bool get() = 0; } virtual bool CanDrawPageSlice(PDFPage page, System::Drawing::PointF resolution, Second::PDF::PageRotation rotation, System::Drawing::Rectangle slice, bool useMediaBox, bool cropEnabled, bool isPrinting) = 0; }; </code></pre> <p>and here is the Metadata:</p> <pre><code>using System; using System.Drawing; namespace Second.PDF { public abstract class PDFPrinter { public PDFPrinter(); public abstract bool CanCreateAntialiasedVectors { get; } public abstract bool CanResolveText { get; } public abstract bool CanUseDrawChar { get; } public abstract bool CanUseDrawForm { get; } public abstract bool CanUseShadedFills { get; } public abstract bool CanUseTilingPatternFill { get; } public virtual bool CropPage { get; } public virtual int HorizontalDPI { get; } public abstract bool IsType3CharsInterpretted { get; } public abstract bool IsUpsideDownCoordinateSystem { get; } public virtual PageRotation PageRotation { get; } public virtual bool UseMediaBox { get; } public virtual int VerticalDPI { get; } public abstract bool CanDrawPageSlice(PDFPage page, PointF resolution, PageRotation rotation, Rectangle slice, bool useMediaBox, bool cropEnabled, bool isPrinting); } } </code></pre> <p>when i try to use this class in c# like this:</p> <pre><code>class Printer : PDFPrinter { public override bool CanCreateAntialiasedVectors { get { throw new NotImplementedException(); } } public override bool CanResolveText { get { throw new NotImplementedException(); } } public override bool CanUseDrawChar { get { throw new NotImplementedException(); } } public override bool CanUseDrawForm { get { throw new NotImplementedException(); } } public override bool CanUseShadedFills { get { throw new NotImplementedException(); } } public override bool CanUseTilingPatternFill { get { throw new NotImplementedException(); } } public override bool IsType3CharsInterpretted { get { throw new NotImplementedException(); } } public override bool IsUpsideDownCoordinateSystem { get { throw new NotImplementedException(); } } public override bool CanDrawPageSlice(PDFPage page, System.Drawing.PointF resolution, PageRotation rotation, System.Drawing.Rectangle slice, bool useMediaBox, bool cropEnabled, bool isPrinting) { throw new NotImplementedException(); } } </code></pre> <p>I get this strange errors:</p> <blockquote> <p>Error 1 'Second.PDFLib.CSharp.Test.Printer' does not implement inherited abstract member 'Second.PDF.PDFPrinter.CanDrawPageSlice()' C:\Projects\Visual Studio\test\Second.PDFLib.CSharp.Test\Program.cs 8 11 Second.PDFLib.CSharp.Test </p> <p>Error 2 'Second.PDFLib.CSharp.Test.Printer.CanDrawPageSlice(Second.PDF.PDFPage, System.Drawing.PointF, Second.PDF.PageRotation, System.Drawing.Rectangle, bool, bool, bool)': no suitable method found to override C:\Projects\Visual Studio\test\Second.PDFLib.CSharp.Test\Program.cs 51 30 Second.PDFLib.CSharp.Test</p> </blockquote> <p>Do you have any idea to fix this errors?</p> <p>Thank you</p> <p>P.S: Only this abstract method (CanDrawPageSlice) generates errors. There is no problem without this method.</p> <p><strong>EDIT</strong></p> <p>Shame! Shame! Shame! Shame on me! :) That is completely my mistake!</p> <p>I figured out.. Problem source is c++ class</p> <p>I forgot to use top level operator (^) in here (PDFPage page)</p> <pre><code>virtual bool CanDrawPageSlice(PDFPage page, System::Drawing::PointF resolution, Second::PDF::PageRotation rotation, System::Drawing::Rectangle slice, bool useMediaBox, bool cropEnabled, bool isPrinting) = 0; </code></pre> <p>it should be like:</p> <pre><code>virtual bool CanDrawPageSlice(PDFPage^ page, System::Drawing::PointF resolution, Second::PDF::PageRotation rotation, System::Drawing::Rectangle slice, bool useMediaBox, bool cropEnabled, bool isPrinting) = 0; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload