We have a problem with some users where Windows is set up so that they do not have "write" rights - when we create object to use our dll they cannot run program. Any suggestions on how to get around this?
Surely, if your code is writing data to disk, and your users don't have the rights to do that, your code is not going to run. That's the whole point of having these restrictive access rights.
The only solution is to ensure that the only users who run your apps are the ones who have the rights to do so.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
code is writing to disk and no problem but as soon as we created dll we got problems any time they run program that creates the object (which I thought was created in memory)
So, you're saying that the CREATEOBJECT() is causing the violation. That's surprising. Like you, I would have not thought anything was written to disk.
Can you post the relevant code?
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Hi Mike - here is code for the dll and also code that creates object. According to the techs we have talked to it is something to do with not letting users create or write to dlls
**** code from calling progs
PUBLIC lbesidll as Object
PUBLIC esidll
esidll=CREATEOBJECT('lbesidll.lbesidll')
******
Line in calling program
**
WITH THISFORM.PageFrame1.Page1
.edtDescrMemo.Value = esidll.stripcodes(lcDescrMemo)
end with
**
Define Class lbesidll As Session OlePublic
Hidden descrmemo As String
descrmemo=""
Function stripcodes(lpcdescrmemo As String) As String
* task based
* need function to strip codes and put into thisform.taskcode, .activity
Local lntaskdelimiter As Integer,lcdescrmemo As String,lcreturnvalue As String
lcreturnvalue=""
lcdescrmemo=lpcdescrmemo
lntaskdelimiter=Len(lcdescrmemo)
lntaskdelimiter=Atc("~~",lcdescrmemo)
If lntaskdelimiter>1
lcreturnvalue= Substr(lcdescrmemo,1,lntaskdelimiter-1) &&STREXTRACT(lcdescrmemo,"~~","",4)
ELSE
lcreturnvalue=lcdescrmemo
Endif
I can't see any problem with your code -- assuming it's the CREATEOBJECT() that's triggering the error. I don't understand why that would cause an access violation.
I was wondering if you had code in the class's Init that might be causing the problem (as the Init is fired during the CREATEOBJECT()). But that's obviously not the case here.
Sorry I can't be more help. Has anyone else got any ideas?
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Where is the dll located and does the local user have read access to this location/file. You could also look at the dcomcnfg access permissions if this is a COM Dll. Just a thought. Also it is possiable fox is creating some sort of .tmp file for this object to test for this situation you could create a config.fpw with a line in it
PROGWORK c:\temp
or
PROGWORK c:\windows\temp
Make sure they have rights to the temp directory and that the directory exists.
If you compiled your lbesidll class to a dll called lbesidll, the comserver is named "lbesidll.lbesidll", if not, then change the first part to the dll name "<<dllname>>.lbesidll".
A COM server, like your lbesidll.dll, needs a registration in the registry, done by regsvr32 or a proper setup, eg made with Installshield Express that comes with VFP/7/8/9. On your development machine, VFP does this registration the moment you build the DLL, therefore you don't needed it there.
You don't need the line "PUBLIC lbesidll AS Object", as the esidll variable will hold the object, "lbesidll.lbesidll" will be known from the registry.
The users don't need write access to the COM server folder or the registry, after that registration process is done, but someone with write access to the registry needs to register the COM server.
Your original post really does not say
I guess it would really be helpful to know "exactly" what the error message says. It might just tell us what is really going on. all of the above suggestions would depend on the actual error being reported.
ie.
non-registered would produce
class definition lbesidll.lbesidll not found
lack of COM permisions would say something like
an error occured during COM object invocation
a failed write might say
File access denied
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.