Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create object

Status
Not open for further replies.

samsnead

Programmer
Sep 3, 2005
100
CA
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)

My Visual FoxPro site: www.ml-consult.co.uk
 
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)
 
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


Return lcreturnvalue
Endfunc
ENDDEFINE
 

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)

My Visual FoxPro site: www.ml-consult.co.uk
 
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.

Steve Bowman
Independent Technology, Inc.
CA, USA
 
Hi samsnead!

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.

Bye, Olaf.

 
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

OR maybe you figured this all out already.

Steve Bowman
Independent Technology, Inc.
CA, USA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top