Hi Luiz,
I should have taken out Returnstring because it is not relevant. It can be replaced by a fixed string like this:
Code: Select all
ProcedureDLL.s MyMessage()
MessageRequester("Hello", "This is a PureBasic DLL !", #PB_MessageRequester_YesNo )
If Result = #PB_MessageRequester_Yes
a$ + "Yes"
Else
a$ + "No"
EndIf
ProcedureReturn a$
EndProcedure
You are also right that MyMessage does not return the correct value because of the lack of Global variable (but I don't mind at the moment).
The main point though is that the MessageRequester window does pop up and my question is why the window in MyWindow only pops up if the other one has appeared first. Your answer about the Common Controls is the kind of issue I thought might be involved but I would love to know how to use this to solve the problem.
The other language is called Lhogho and the other simple examples I have tried in a DLL like doubling numbers and things like that have all worked fine.
I am using the proper method for loading and calling functions in a DLL in Lhogho and here is an example:
Code: Select all
make "Turtlelib libload "TurtleDLL.dll
if :Turtlelib=0
[print [TurtleLib not loaded]]
[print [TurtleLib loaded]]
to MyMessage end
external "MyMessage [s1 MyMessage] :Turtlelib
make "ans MyMessage
print :ans
The context here is that I am interested in writing a DLL to implement Turtle graphics which is something which is popular in languages for teaching youngsters to programme.