Out of process class

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to write a reusable Authentication component for our web
applications. I'm having some problems using the component in other projects.

I have a UserInfo class marked <serializable()> and an Authentication
component with a public function Logon():
public function Logon(byval username as string, byval password as
string>
as Userinfo

dim objUser as new UserInfo
'setup all the member data
return objUser
end function

Then, in another solution, I do:
dim objAuth as new Authentication
dim objUser as new User
objUser = objAuth.Logon("username", "password")

but when I look at the objUser, it doesn't seem to get set to anything.

Am I doing this correctly.
Craig
 
I think I may have figured this out but I'd like some input to see if what I
did was correct technique. I changed my Logon() function to return a
MemoryStream type, and return:
return serialize(objUserInfo)

Then when I use it in my application, I do:
objMemoryStream = Authentication.Logon(...)
objUserInfo = Authentication.Deserialize(objMemoryStream)

from here on I can use the objUserInfo object with all the correct data
returned from the Logon function.

I think the previous way, because I wasn't serializing the object, I was
getting back a reference that was out of process.

any thoughts, Craig
 
Back
Top