AddToHistory() produces a linker error

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 10, 2008
35
0
#1
It seems TakeCmd.h contains an incomplete declaration for AddToHistory(). If I use the .h from the latest SDK I receive a linker error that the function can't be found.

I unmangled the name in TakeCmd.lib and it seems the function has an int as its second parameter. At least, once I changed the .h accordingly, the linker was happy.

I gotta say that using the SDK proved to be more troublesome than it should be, IMHO. Not to mention the documentation or rather lack of it.

--
cheers thomasl
 

rconn

Administrator
Staff member
May 14, 2008
10,103
85
#2
> It seems TakeCmd.h contains an incomplete declaration for AddToHistory().
> If I use the .h from the latest SDK I receive a linker error that the
function

> can't be found.
AddToHistory was changed in 12.10 to take a second optional argument. If
you use it in that format, your plugin won't work in any previous version.

void WINAPI AddToHistory( LPTSTR, int nForceAppend=0 );


> I gotta say that using the SDK proved to be more troublesome than it
should

> be, IMHO. Not to mention the documentation or rather lack of it.
Which is largely because I don't WANT developers using more than a small
fraction of the SDK, as it makes it impossible for me to update TCMD without
breaking everybody's plugins.

The SDK is there for a small core set of functions that you can't do any
other way, not as a general RTL replacement library that will remain
unchanged forever.

Rex Conn
JP Software
 
Jun 10, 2008
35
0
#3
function AddToHistory was changed in 12.10 to take a second optional argument. If you use it in that format, your plugin won't work in any previous version.
I take it that means that if I want to have my plugin work in previous versions I have to use an pre-12.10 SDK version?

Anyway, as things stand right now, I can't link with the current version of the SDK w/o editing the TakeCmd.h file.

--
cheers thomasl
 

rconn

Administrator
Staff member
May 14, 2008
10,103
85
#4
I take it that means that if I want to have my plugin work in previous versions I have to use an pre-12.10 SDK version?

Anyway, as things stand right now, I can't link with the current version of the SDK w/o editing the TakeCmd.h file.
There's no reason for you to use AddToHistory -- you should use "HISTORY /A command" if you want to add something to the history. That interface will never change.
 
#5
On Fri, 05 Aug 2011 21:11:52 -0400, rconn <> wrote:

|There's no reason for you to use AddToHistory -- you should use "HISTORY /A command" if you want to add something to the history. That interface will never change.

Do you mean HistoryCmd() or Command(L"HISTORY ...")?
 
Jun 10, 2008
35
0
#7
There's no reason for you to use AddToHistory -- you should use "HISTORY /A command" if you want to add something to the history. That interface will never change.
Thanks, though you could usefully have mentioned that in your first post.

Either way, I'd prefer an SDK that actually does what it says on the tin. Well.

--
cheers thomasl
 

rconn

Administrator
Staff member
May 14, 2008
10,103
85
#8
Thanks, though you could usefully have mentioned that in your first post.

Either way, I'd prefer an SDK that actually does what it says on the tin. Well.
I didn't understand at first why you were ignoring the easy documented way of doing it in favor of the hard undocumented way.

The SDK on the ftp site has the updated TakeCmd.h file.