Sending data to dll plugin problem!! help.

G

Guest

I have 3rd party dll plugin COM interface, when loaded executes the following
functions.

public class Test: IPlugin
{
public void Innitialize(IPluginApp obj, int pluginHandle)
{
//gets the plugin obj dynamically to work with third party application.
//can be added events etc.
}
public shutdown()
{
//this is executed with plugin is terminated.
}
}

I have our application written in c# that should reference this plugin
assembly
and send some data to plugin from outside. But my problem is im unable to
send
data to plugin from outside that assembly. Plugin should accept the data and
do
further processing using IPluginApp object. IPluginApp object is null
outside that
Innitialize method. I am unable to create copy of that object using late
binding
concepts as that is an interface pointer. Can anyone suggest me some
techniques
to send data to plugin from outside.
 
C

Chris Dunaway

Aravind said:
I have 3rd party dll plugin COM interface, when loaded executes the following
functions.

public class Test: IPlugin
{
public void Innitialize(IPluginApp obj, int pluginHandle)
{
//gets the plugin obj dynamically to work with third party application.
//can be added events etc.
}
public shutdown()
{
//this is executed with plugin is terminated.
}
}

I have our application written in c# that should reference this plugin
assembly
and send some data to plugin from outside. But my problem is im unable to
send
data to plugin from outside that assembly. Plugin should accept the data and
do
further processing using IPluginApp object. IPluginApp object is null
outside that
Innitialize method. I am unable to create copy of that object using late
binding
concepts as that is an interface pointer. Can anyone suggest me some
techniques
to send data to plugin from outside.

Can't you add an IPluginApp variable to the class and assign that in
the constructor:

public class Test: IPlugin
{
private IPluginApp _pluginApp;

public void Innitialize(IPluginApp obj, int pluginHandle)
{
_pluginApp = obj;

//gets the plugin obj dynamically to work with third party
application.
//can be added events etc.
}

public shutdown()
{
//this is executed with plugin is terminated.
}
}
 
G

Guest

Thanx for your reply. Sorry im late in framing my question. I have done like
this..
public class Test: IPlugin
{
public static IPluginApp _pluginApp;

public void Innitialize(IPluginApp obj, int pluginHandle)
{
_pluginApp = obj;

//gets the plugin obj dynamically to work with third party
// application.
//can be added events etc.
}

public static bool CheckPluginIsNull()
{
if(Test._pluginApp == null) return true;
else return false;
}

}

from my executable application. I need to access that _pluginApp.

But if i do if(Test.CheckPluginIsNull) ..... Im geting null value...

Test class is in different assembly which I reference in to my executable
project.

I hope now you understood my problem. Is there any way to access that
_pluginApp referece from outside the Test class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top