1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

plugin SDK

Discussion in 'Support' started by fpefpe, Jan 30, 2015.

  1. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    Hello -- The plugin that I been using with v15/v16 does not seems to load with v17 -- has any of the headers changed?
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,300
    Likes Received:
    39
    Lots of calls changed. Many of my plugins needed changes before they would load under v17.
     
  3. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    Hello – Thanks for the reply .... I notice that in the v17 takecmd.h file, there are no entries in the form of

    int WINAPI <foo>_cmd( LPTSTR ) ;

    where <foo> is a tcc command name.

    I was using these ep’s to call tcc commands from my plugin – it there now a more general way to pass string to tcc to execute?

    Thanks
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,854
    Likes Received:
    83
    Because of the string changes in v17, the prototypes of most functions changed. Some of the ones commonly used in plugins still have a stub with the old calling format.

    Calling xxx_cmd directly is no longer supported (it was never a terribly good idea, as it presupposed that the caller was passing the proper sized buffer for each command). You should use Command(LPTSTR, int) to call the internal TCC commands.
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,935
    Likes Received:
    30
    I have 4 plugins of decent size. Making the necessary changes so that they build and run in v17 and before was not hard. Finding what needed to be changed took a little work but it was nowhere near the chore I expected. If you have DUMPBIN.EXE it can be valuable in finding out exactly what the latest TakeCmd.dll exports.
     
  6. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    Thanks for the info ... I think that "depends" sort of does some of the same things as dumpbin
     
  7. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    Hello -- in the old sdk there was an ep "external" -- not in v17 -- is there an alternative? maybe use the windows api to execute a program?
     
  8. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,935
    Likes Received:
    30
    What's an "ep"?

    There's
    Code:
    Command(L"program.exe". ...);
    and
    Code:
    Command(L"START ...", ...);
    and of course the Win32 API functions CreateProcess() and ShellExecute[Ex]().

    "External()" is still there but in a new form which I doubt we're going to be using any time soon.
    Code:
    g:\tc17> dumpbin /exports takecmd.dll | grep External
    
      142  6D 00045B70 ?External@@YGHAAV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@00@Z
    
    g:\tc17> undecorate ?External@@YGHAAV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@00@Z
    
    int __stdcall External(class ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > &,clas
    s ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > &,class ATL::CStringT<wchar_t,cla
    ss ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > &)
     
  9. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1

    Thanks for the info
     
  10. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    ep -> entry point
     
  11. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    Just to confirm -- with the calls

    ascii to unicode and

    unicode to ascii

    the size of the target buffer in in characters not bytes ?

    Thanks
     
  12. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,854
    Likes Received:
    83
  13. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    thanks
     
  14. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    Has the function GetClipboardLine been removed from takecmd.h -- if so is there an alternative?
     
  15. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,854
    Likes Received:
    83
    It's still there, but the argument types have changed -- so you can't use it both v16 & v17.

    But it's simple enough to write your own version.
     
  16. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    Hello --

    Thanks for the info ...

    umm ... I see that from export list of the dll, there seems to be a decorated version of the clipboard function,
    but no reference in the *.h file, so how it it accessed?

    From the clipboard function in the *.h -- not sure if I missed one, but all that seems to "read/get"
    text from the clipboard require a filename -- is that the case?

    in addition egets also is not in the *.h file --

    Should there be some core function in the API that transcend any version of the code?

    Thanks

    166 7C 00005C30 ?GetClipboardLine@@YGHHAAV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@@Z
    167 7D 00005E00 ?GetClipboardLines@@YGHXZ

    73 31 000D26E0 ?CutEgets@@YAXXZ
    460 142 000D25F0 ?ResetEGets@@YAXHH@Z
    683 1FE 000CD850 ?egets@@YGHAAV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@HHPB_W@Z
     
  17. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,854
    Likes Received:
    83
    It's not intended to be accessed by plugins. To do it, you'd have to write a v17-only version and switch everything to CAtlStrings. Or you could write your own function to read a line from the clipboard in < 20 lines of code.

    The clipboard routines are all for internal use -- they implement the CLIP: pseudo-variable (by writing the clipboard to a temp file & then reading that file). They're way too complicated to use if you just want to read the clipboard.

    egets should not be used in plugins -- it's not reentrant, so using it in a plugin is going to trash memory.

    We had a v17 private & public beta for several months so that plugin authors could get their plugins updated to work with v17. Upon request, some of the new v17 functions got a wrapper
    so they could be called with the old prototype.
     
  18. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1

    Thanks for the info ... yes, I can see the clipboard code in a few lines of code .... is there an a alternative to egets to read text from the screen?
     
  19. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,854
    Likes Received:
    83
    Not as a takecmd.dll function; there's lots of choices in the RTL and third-party libs.
     
  20. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    247
    Likes Received:
    1
    thanks -- thanks again for the help
     

Share This Page