The type also needs to be the full path if your CFCs are going to be
in different folders.
<cfargument name="mailserv" type="cfcs.mailserv.mailserv" required="true" />
This assumes that CF can find these from the webroot of your site or
that you have a mapping /cfcs that points to the right place.
On 8/10/06, Brent Shaub <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I have a bunch of .cfcs in the same folder whose init() function creates
> application-level instances of the cfc object. I make reference to one of
> these objects as a parameter when initializing another cfc. It works fine
> when everything is in the same folder. When I pass in an application-level
> object to a cfc in a different folder, I get an error that the parameter
> object's type is not the expected type. I'm wondering if anyone has seen
> this before and knows how to correct.
>
> Here's some code to help:
>
> /cfcs/email/email.cfc
> <cffunction name="init" returntype="email" output="false">
> <cfargument name="mailserv" type="mailserver" required="true"
> />
>
> <cfset variables.mailserv = arguments.mailserv />
>
> <cfreturn this />
> </cffunction>
>
>
> /cfcs/mailserv/mailserv.cfc
> <cffunction name="init" returntype="mailserver" output="false">
> ...
>
> <cfreturn this />
> </cffunction>
>
> in application.cfm:
> <cfset application.mailserv = createObject("component",
> "cfcs.mailserv.mailserv").init() />
> <cfset application.email = createObject("component",
> "cfcs.email.email").init(mailserv = application.mailserv) />
>
>
> Thanks in advance. Been trying everything to no avail!
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:249487
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4