External Dll does not refer to correct location. Please Help
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
External Dll does not refer to correct location. Please Help
Hello,
I want to use XML libary in my revolution stack. I have manually copied revxml.dll file to "My Data" folder which is located in the current directoy of standalone.
I am using the following code in OpenStack
put defaultFolder &"/My Data/" into DataFolderPath
put DataFolderPath & "revxml.dll" into myDLLfilePath
set the externals of me to into myDLLfilePath
When I run the standalone then It seems to refer dll from the path C:\Program Files\Revolution 2.6\My Data\revxml.dll because standalone for xml works fine when revxml.dll is located in My DATA folder present in revolution 2.6 directory.
Can you please help me in making this dll refer to correct path.
I have found the following thread for loading the dll in custom propery and then loading it at run time. do we really need to do that ?
http://forums.runrev.com/phpBB2/viewtop ... revxml+dll
Please let me know How I can bind revxml.dll from My Data folder present in standalone directory
Thanks for your help
Best Regards
Pradeep
I want to use XML libary in my revolution stack. I have manually copied revxml.dll file to "My Data" folder which is located in the current directoy of standalone.
I am using the following code in OpenStack
put defaultFolder &"/My Data/" into DataFolderPath
put DataFolderPath & "revxml.dll" into myDLLfilePath
set the externals of me to into myDLLfilePath
When I run the standalone then It seems to refer dll from the path C:\Program Files\Revolution 2.6\My Data\revxml.dll because standalone for xml works fine when revxml.dll is located in My DATA folder present in revolution 2.6 directory.
Can you please help me in making this dll refer to correct path.
I have found the following thread for loading the dll in custom propery and then loading it at run time. do we really need to do that ?
http://forums.runrev.com/phpBB2/viewtop ... revxml+dll
Please let me know How I can bind revxml.dll from My Data folder present in standalone directory
Thanks for your help
Best Regards
Pradeep
Dear Pradeep,
Setting the externals property in the openStack handler doesn't work. If you read the documentation about the externals property, you will read that you would have to close and reopen the stack.
The following seems to work, although I believe it is undocumented.
Create a new stack "Externals Lib". Put a startUp handler into the card script of card 1 of the mainstack.
Also add the following handler to the script of the same card:
This way, you can load an external without closing and reopening the stack.
You don't need to load an external into a custom property.
Best,
Mark
Setting the externals property in the openStack handler doesn't work. If you read the documentation about the externals property, you will read that you would have to close and reopen the stack.
The following seems to work, although I believe it is undocumented.
Create a new stack "Externals Lib". Put a startUp handler into the card script of card 1 of the mainstack.
Code: Select all
on startUp
put defaultFolder &"/My Data/" into DataFolderPath
put DataFolderPath & "revxml.dll" into myDLLfilePath
set the externals of stack "Externals Lib" to into myDLLfilePath
send "openLib" to me in 0 millisecs
pas startUp
end startUp
Code: Select all
on openLib
go invisible stack "Externals Lib" in new window
go back
end openLib
You don't need to load an external into a custom property.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Dag MArk, salaam Pradeep,
The "startup" handler is the only place where you can set the external of your mainstack and then can use the externals afterwards, so messing around with a substack is not necessary!
So this is all you need:
I do this in all of my standalones and never had problems!
Best
Klaus
The "startup" handler is the only place where you can set the external of your mainstack and then can use the externals afterwards, so messing around with a substack is not necessary!
So this is all you need:
Code: Select all
on startUp
put defaultFolder &"/My Data/" into DataFolderPath
put DataFolderPath & "revxml.dll" into myDLLfilePath
set the externals of this stack to myDLLfilePath
pass startUp
end startUp
Best
Klaus
My Data folder for dll is not ready when appplication loads
Dear Mark,
Thanks for the solution. I tried your code in plain stack and it seems to work fine.
But In my main application, "My Data" folder is downloaded when I clicked on authenticate button on first card. So I can not use startup handler that because I do not have dll at that time.
Once the atuthenticate is successful then "My Data" is downloaded with the revxml.dll etc. and then it opens up another substack which uses the xml features.
Is there any way, so that I can bind the dll at some other place (after the first card )?
Any trick/solution to do that in rev?
Thanks
Best Regards
Pradeep
Thanks for the solution. I tried your code in plain stack and it seems to work fine.
But In my main application, "My Data" folder is downloaded when I clicked on authenticate button on first card. So I can not use startup handler that because I do not have dll at that time.
Once the atuthenticate is successful then "My Data" is downloaded with the revxml.dll etc. and then it opens up another substack which uses the xml features.
Is there any way, so that I can bind the dll at some other place (after the first card )?
Any trick/solution to do that in rev?
Thanks
Best Regards
Pradeep
Salaam Pradeep,
in that case you can use this handler right after the dll has been downloaded (succesfully
):
You can of course use a shorter name for the handler 
Regards
Klaus
in that case you can use this handler right after the dll has been downloaded (succesfully

Code: Select all
on create_externals_stack_and_use_it_right_away
put defaultFolder &"/My Data/" into DataFolderPath
put DataFolderPath & "revxml.dll" into myDLLfilePath
create invisible stack "Externals Lib"
set the externals of stack "Externals Lib" to myDLLfilePath
start using stack "Externals Lib"
end create_externals_stack_and_use_it_right_away

Regards
Klaus
Hi Pradeep,
In your case, the solution with a dll stored in a custom property might be exactly what you need. Distribute the standalone with the dll in a custom property and write the dll to disk on startUp. Then continue the startUp handler as I explained above.
Klaus, I tried loading the revFont external without separate substack and it didn't work.
Best,
Mark
In your case, the solution with a dll stored in a custom property might be exactly what you need. Distribute the standalone with the dll in a custom property and write the dll to disk on startUp. Then continue the startUp handler as I explained above.
Klaus, I tried loading the revFont external without separate substack and it didn't work.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Dag Mark,
hmmm, in the "startup" handler?
This is the official palce to do so...
I do this all the time in my apps and it always worked for me...?
hmmm, in the "startup" handler?
This is the official palce to do so...
I do this all the time in my apps and it always worked for me...?
Last edited by Klaus on Tue Jul 31, 2007 12:34 pm, edited 1 time in total.
Klaus posted another reply while I was writing my answer. Sure, you can also download the dll from a server rather than store it in a custom property.
Mark
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Gutentag Klaus,
Sure I believe you and I don't know why it didn't work for me, but I do think that using a substack is the safest way to get it to work. Are you using MetaCard perhaps?
Best,
Mark
Sure I believe you and I don't know why it didn't work for me, but I do think that using a substack is the safest way to get it to work. Are you using MetaCard perhaps?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode