Function Name Conflict in a UserControl that implements UCOMIPersistFile??

  • Thread starter Thread starter Leon_Amirreza
  • Start date Start date
L

Leon_Amirreza

Hi,
I have create a usercontrol that implements UICOMIPersistFile interface in
c# but there exist a Load function both in the interface and the usercontrol
that compiler nags about.
anyway i can implement the Load function of the interface with a new name?
or can i apply a property like "EntryPoint" in DllImport attribute which
imports functions with a new name; if there exists such an attribute for COM
functions?
 
anyway i can implement the Load function of the interface with a new name?

You can implement it explicitly with the syntax

void UCOMIPersistFile.Load(string pszFileName, int dwMode) { }



Mattias
 
having an bject of the usercontrol class created like this:

mycustomcontrol mcm = new mycustomcontrol();

how can i direct the compiler that when i am calling my implemeted Load()
and when of the dotNET library?
 
having an bject of the usercontrol class created like this:
mycustomcontrol mcm = new mycustomcontrol();

how can i direct the compiler that when i am calling my implemeted Load()
and when of the dotNET library?

Cast to the right interface:

UCOMIPersistFile pf = (UCOMIPersistFile)mcm;
pf.Load(...);



Mattias
 

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

Back
Top