Page 1 of 1
3 questions about exported procedures.
Posted: Wed Apr 28, 2004 9:20 pm
by Edwin Knoppert
1) The procedurename can not handle underscores twice like:
ProcedureDLL.s PBSGPLIB_BrowseForFolder_GetPath( Gadget )
2) How to make a procedure having optional parameters (NOT CDECL)
3) I'm using TB_SetGadget()
Is there a description?
What does it do?
It does not show my message requester when the control is destroyed.
Using it now as:
VT\FreeGadget = @MyFreeGadgetDummy()
VT\GetGadgetState = @MyGetGadgetStateDummy()
VT\SetGadgetState = @MySetGadgetStateDummy()
TB_SetGadget( Gadget, hWnd, @VT )
Thanks!
Creating libraries is very neat!
Also big thanks to 'tailbite'.
Posted: Thu Apr 29, 2004 1:51 am
by El_Choni
First af all, you're using TailBIte, otherwise you wouln't ask such questions. I'm not in the position to answer you right now, but I'll try tomorrow. Anyway, some of your questions are answered in the TailBite help file.
If I'm wrong, I'm sorry.
Regards,
Posted: Thu Apr 29, 2004 9:05 am
by Edwin Knoppert
Just read the help (again)
Very very good, i did not expect that
I will refraise if needed, let me read it completely first

Posted: Thu Apr 29, 2004 12:19 pm
by El_Choni
1) The procedurename can not handle underscores twice like:
ProcedureDLL.s PBSGPLIB_BrowseForFolder_GetPath( Gadget )
What happens if you use two underscores? Seems ok here. About TB_SetGadget, reemmber to use a global structure. Does it work ok for you now?
Regards, and thanks for the feedback and reports,
Posted: Thu Apr 29, 2004 12:32 pm
by Edwin Knoppert
Try to actually use the call, i believe it's there where it goes wrong.
The lib looks fine but i believe it was pb not finding the proc.
To bad about the struct being global.
I used it protected, will change, maybe therefore not seeing my destroy being handled...
About the string issue, at some point i need to use a local string to copy my BSTR stuff into, then i pass it back to the procedure as result var.
Is this still wrong, how to avoid?
(Had no time for your help yet, only briefly)
Fine tool, keep it up, even if low feedback.
Posted: Thu Apr 29, 2004 12:43 pm
by El_Choni
Could you post some code to find the bug (lib & test, please)?
I'm not sure if you can use strings to store a BSTR.
Posted: Thu Apr 29, 2004 12:52 pm
by Edwin Knoppert
The BSTR is not an issue
I copy via MoveMemory_() the BSTR contents over to a local string.
The local string is returned in the procedure.
My question is if i can use a string in pb, there was this string issue?
A few weeks ago i had a problem during a callback and the explorergadget.
I was mentioned that strings where a problem that there was only on string or so allocated???
I don't understand, i don't need conflicts.

Posted: Thu Apr 29, 2004 12:53 pm
by Edwin Knoppert
+ it works all the way, no worries, only mentioning it to prevent conflicts..
Posted: Fri May 07, 2004 9:10 am
by Edwin Knoppert
Any ideas about the procedurename having more _ 's?
There is no need to have any code in the procedure.
pb will not like it while tailbite compiles it fine.
==================
Tailbite:
I'm still worried about the string issue which i can not describe.
The help shows an exampe similar to what i use:
ProcedureDLL.s MyReplaceString(a$, b$, c$)
There is this remark in the help:
So, my advice would be to avoid string manipulation in your code (use direct strings, or only memory addresses),
What are direct strings?
forget the BSTR issue, i use a similar function as ProcedureDLL.s MyReplaceString(a$, b$, c$)
I simply use MoveMemory_() to copy BSTR contents to the pb string.