Dear Robert,

RR> I've been working on converting the TBPtest.dpr example that Stefan
RR> posted to C. I have several issues that prevent it from working correctly
RR> though.

As I wrote to you, you should use the _stdcall (or whatever
underscores it needs - depending on compiler or WINAPI) as the calling
convention for all functions. I think this is the reason the program
does not go any further.


RR> 1) When added in the Spam Plugin options, the plugin is loaded, but
RR> the information is not displayed in the listbox. I can tell a new
RR> entry is created, but it is blank. Once closed, the blank entry does
RR> not come back. So far, I see two calls to TBP_GetName.

OK, here is how TBP_GetName (and any other function that returns
information into a buffer) is called from TB! (C syntax here)

 SizeNeeded = TBP_GetName(NULL, 0);
 if (SizeNeeded > 0) {
   Buffer = malloc(SizeNeeded);
   CharsCopied = TBP_GetName(Buffer, SizeNeeded);
 }

In other words, the first call is made with the buffer parameter set
to 0 (NULL in C, NIL in Delphi), so the calling function should return
the size of the buffer it requires. The second call just collects
Does it makes things more clear?

 
RR> 2) According to Stefan, TBP_Setup should return TRUE if the user made
RR> changes otherwise false.  However, whenever I return true, the plugin
RR> unloads immediately.

This is because of the convention, I guess - there may be a problem
with clearing stack after calling TBP_Setup and this generates an
exception.


RR> 3) Shouldn't TBP_Setup pass the HWND of the preferences window (or
RR> whatever window its called from)?

Not necessarily - you can just call GetActiveWindow() if you need it
:-)




-- 
Sincerely,
 Stefan                            mailto:[EMAIL PROTECTED]

..."If you cannot get rid of the family skeleton, you may as well dance with it."
       - George Bernard Shaw


________________________________________________
Current version is 1.62 | "Using TBDEV" information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to