E
Eric bouxirot
hi,
i'd like to do a "cast", who seem to be very complicated in .NET. in C
standard it's so easy...
i explain :
i have made an app based on plugin architecture in VB.NET. all work
fine..
but I want to avoid to the maximum to modify the interface at each new
plugin feature request from main app, i defined a function like this :
Public Function Host_GetObject(ByVal FonctionName As String,
Optional ByVal Parameters() As Object = Nothing) As Object() Implements
ENPI.Interfaces.IHost.Host_GetObject
this function get 1 parameter to tell witch "function" to do and 1
array of object (defined by the function) to optionals parameters of
this function.
this function return an array of object (content defined by the
"function" entry parameter)
i put this function in my interface between the main app and plugin. no
pb at this point.
if i use it with framework types, i get no problems.
But now, i want to return (in the array of object) a simple data
structure (no class !) like this :
Private Structure StrPIsName
Friend PIName As String
Friend PIAssyName As String
End Structure
the main app can make the array of object from array of StrPIsName.
good.
in the plugin, i get the array of object. good too.. but each object is
typed with mainapp.StrPIsName all this is normal.
but for me, for raisons i tell before, i don't want to put the
structure in the interface. (to avoid to recompil all plugin if i add
or change the structure to the interface..)
then, since my plugin does not have the reference to mainapp.StrPIsName
but to it's own StrPIsName, the cast can't be made.
do you understand what i mean ?
the end goal is to be able to make some enhancement or changes in the
main app and somme plugin or new plugins needs without the need to
recompil all other plugins.
i don't want to have many auxilliary DLL to get many interfaces between
main app and plugins too.
in fact, i want to do something (perhaps not good in .NET) like in
standard C :
toto = (mycast) tata;
HELPPP !!
i'd like to do a "cast", who seem to be very complicated in .NET. in C
standard it's so easy...
i explain :
i have made an app based on plugin architecture in VB.NET. all work
fine..
but I want to avoid to the maximum to modify the interface at each new
plugin feature request from main app, i defined a function like this :
Public Function Host_GetObject(ByVal FonctionName As String,
Optional ByVal Parameters() As Object = Nothing) As Object() Implements
ENPI.Interfaces.IHost.Host_GetObject
this function get 1 parameter to tell witch "function" to do and 1
array of object (defined by the function) to optionals parameters of
this function.
this function return an array of object (content defined by the
"function" entry parameter)
i put this function in my interface between the main app and plugin. no
pb at this point.
if i use it with framework types, i get no problems.
But now, i want to return (in the array of object) a simple data
structure (no class !) like this :
Private Structure StrPIsName
Friend PIName As String
Friend PIAssyName As String
End Structure
the main app can make the array of object from array of StrPIsName.
good.
in the plugin, i get the array of object. good too.. but each object is
typed with mainapp.StrPIsName all this is normal.
but for me, for raisons i tell before, i don't want to put the
structure in the interface. (to avoid to recompil all plugin if i add
or change the structure to the interface..)
then, since my plugin does not have the reference to mainapp.StrPIsName
but to it's own StrPIsName, the cast can't be made.
do you understand what i mean ?
the end goal is to be able to make some enhancement or changes in the
main app and somme plugin or new plugins needs without the need to
recompil all other plugins.
i don't want to have many auxilliary DLL to get many interfaces between
main app and plugins too.
in fact, i want to do something (perhaps not good in .NET) like in
standard C :
toto = (mycast) tata;
HELPPP !!