NO

Author Topic: Capture Tab data  (Read 19496 times)

Offline John Z

  • Member
  • *
  • Posts: 865
Re: Capture Tab data
« Reply #30 on: March 07, 2023, 11:03:02 AM »
Thanks Timo, very interesting - I've never seen that error ( don't we all say that  :) )
but really I have not. 

Currently it defaults output to the actual project directory of the source code being run under Debug,
by using docinfo.szFilename.   I thought this would always be writable since the project .exe usually
ends up there.  But perhaps a system .h file is the current doc tab then I think it would fail ( ah ha!)
this would make it fail then as the 'current' doc is in a un-writable directory.  Hadn't thought of that before!!

I'll see if there is another method to get the project directory. Perhaps GetModuleFileName....or some other api.
OR
I could obtain the users TEMP dir and output there?

Thanks very much for the help!

John Z

Update: OK I think int AddIn_GetProjectTarget(HWND hwnd, WCHAR *pch, int cchMax); 
can be used easily to get the 'true' project directory....no matter which source code or .h tab is currently selected.
A much better choice because it will always be where the program .exe will be created.

Update#2:  Here is the new dll version 1.2.2 using AddIn_GetProjectTarget  for the path.  if OK I'll post source zip. This should fix the access issue no matter which document tab is active.... I tested with windows.h selected - worked.  Also writes output filename to the output tab.
  SHA256: D9D43BE786AE65A8B38A5169E2A74438A684E62D4AD487BDE5A1051236502A3F

Updated#3 03/09/2023 with current 1.2.2 dll and readme.txt and also added full project zip for version 1.2.2
Updated 03/12/2023 removed as inappropriate for long term solution
« Last Edit: March 12, 2023, 08:18:11 PM by John Z »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2122
Re: Capture Tab data
« Reply #31 on: March 07, 2023, 04:07:40 PM »
Thanks John !
now it works and i can test it.
May the source be with you

Offline John Z

  • Member
  • *
  • Posts: 865
Re: Capture Tab data
« Reply #32 on: March 09, 2023, 02:57:13 PM »
Good to hear!

 :)  Posted full Pelles Project ZIP above.

John Z