plugin SDK

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Oct 18, 2008
263
1
#1
Hello -- The plugin that I been using with v15/v16 does not seems to load with v17 -- has any of the headers changed?
 
Oct 18, 2008
263
1
#3
Lots of calls changed. Many of my plugins needed changes before they would load under v17.
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
 

rconn

Administrator
Staff member
May 14, 2008
10,099
85
#4
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
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.
 
Oct 18, 2008
263
1
#7
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.
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
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?
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> > > &)
 
Oct 18, 2008
263
1
#9
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> > > &)

Thanks for the info
 
Oct 18, 2008
263
1
#11
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
 
Oct 18, 2008
263
1
#16
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
 

rconn

Administrator
Staff member
May 14, 2008
10,099
85
#17
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?
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.

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?
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.

in addition egets also is not in the *.h file --
egets should not be used in plugins -- it's not reentrant, so using it in a plugin is going to trash memory.

Should there be some core function in the API that transcend any version of the code?
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.
 
Oct 18, 2008
263
1
#18
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.

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?