Skip to main content
Participating Frequently
February 16, 2021
Question

Is there any change on recent Acrobat/SDK/API recently? str casting from ASPathName not working.

  • February 16, 2021
  • 1 reply
  • 410 views

Hi 

Recently I had a strange issue with recent Acrobat version such as 2021.001.20135.

String cast in the following worked fine.

---

ASPathName asPathName = ASFileSysPathFromDIPath(m_asFileSys, CT2CA(diPath), relativeToThisPath);

CString sFilePath = reinterpret_cast<char*>(asPathName );

---

But it doesn't work anymore at V 2021.001.20135.

So I'm wondering why it doesn't work suddenly. 

Is there any change on API level? If yes, can I get info about what was updated .

 

Anyway I coluld resolve the issue by using  ASFileSysDisplayASTextFromPath rather than string cast something like the below.

--

ASFileSysDisplayASTextFromPath(m_asFileSys, asPathName , asText);

CString sFilePath =  (LPCTSTR)ASTextGetUnicode(asText);

--

I believe it's right resolution.

 

Thanks

Jason

 

This topic has been closed for replies.

1 reply

Legend
February 17, 2021

This is an interesting question. It has never been supported to typecast ASPathName to a string. By pure accident it may have worked for a long time (for the default ASFileSys), but still, it could break any time, now it has broken. There will be no notification, because Adobe didn't plan it to ever work.

Participating Frequently
February 24, 2021

Agree. Thanks for the comment.