Would you please share a bit more about the issue. Please share some code snippet which used to work before and now its not working. We will further proceed to assist you accordingly.
It is recommended to use System::StaticCast
, System::DynamicCast
to cast SharedPtr<SaveOptions>
to SharedPtr<DocSaveOptions>
. Furthermore, we are looking into the issue related to RTTI and will get back to you soon.
RTTI has not been hided and this example works well with latest version of the API.
#include <iostream>
#include <typeinfo>
#include "Aspose.PDF.Cpp/DocSaveOptions.h"
using namespace System;
using namespace Aspose::Pdf;
void test(Aspose::Pdf::SaveOptions* p)
{
std::cout << (typeid(*p) == typeid(Aspose::Pdf::DocSaveOptions) ? "true" : "false") << std::endl;
}
int main()
{
auto op = MakeObject<DocSaveOptions>();
test(op.get());
}
cast_example.zip (619 Bytes)
Thanks.
I wrote a demo. Testsdk.zip (22.7 KB)
It worked fine with 20.1.
And does not work since 20.2.
We would also like to share with you that Aspose.PDF for C++ ( asposecpplib ) has its own RTTI, please consider next usage:
void RTTITest()
{
auto options = MakeObject<DocSaveOptions>();
const TypeInfo& ti = options->GetType();
std::cout << ti.get_Name().ToUtf8String() << std::endl;
std::cout << ti.get_FullName().ToUtf8String() << std::endl;
}
Please try it using Aspose.PDF for C++ 20.3 and let us know about your feedback.
Thanks.
But it doesn’t work. I tested it a few days ago.
BTW: Which change makes this difference?
We have checked the sample application that you have shared. You should set “Stack Reserve Size” linker option for both Dll1 and TestSDK projects. For Dll1 project, this option is set through imported aspose.pdf.cpp.targets and for TestSDK, this option should be set manually.
picturemessage_g00mdcu1.b2r.png (7.5 KB)
picturemessage_jk1vnbzc.5id.png (35.4 KB)
Sorry. I forgot to say that you have to click menu: File
- Test
.
Stack Reserve Size
does not work for me.
This is just loading dll successfully
---------success
We will check the scenario again as per your response and will share our feedback with you soon.
Issue is that you create DocSaveOptions* in DocSaveOptions_Create but use it as SaveOptions* in MyAsposePDFTest.
Please consider the next changes in dllmain.cpp. dllmain.zip (864 Bytes)
Would you kindly share your sample source and output document for our reference. We will test the scenario in our environment and address it accordingly.