COM interop help

  • Thread starter Thread starter edmitchell
  • Start date Start date
E

edmitchell

I'm getting an error when I pass "User" in "report.HasBeenAccesedBy(ref
User,ref UserN);" I have created the iL to see if there is something
incorrect.

..method public hidebysig newslot abstract virtual
instance bool HasBeenAccesedBy([in][out] class LDD.User&
marshal( interface) aUser,
[in][out][opt] string&
marshal( bstr) aUserID) runtime managed internalcall

and is failing in the marshal(interface). but not sure what else to
try. Any help would be appreciated.




LDD.UserRepositoryClass PRC;
PRC = new PRDS_ORAL.UserRepositoryClass();


LDD.UserClass User;
User = (LDD.UserClass)PRC.UserByID(ref UsrID);


LDD.ReportCollectionClass reports;
reports = (LDD.ReportCollectionClass)User.UnaccesedReports(ref UserN);


for ( int count = 1;count<=reports.Count;count++)
{

LDD.ReportClass report;
report = (LDD.ReportClass)reports.get_ItemByIndex(ref count);


report.HasBeenAccesedBy(ref User,ref UserN);
 
Ed,

If you could tell what the error is, it would help.

I believe that it has to do with your declaration of the User variable.
It should be of type LDD.User (the name of the interface on the class, not
the implementation name). Or, if it is a VB COM dll, then LDD._User.

The UserClass is just the implementation, not the interface, which is
really what is being accessed in COM.

Hope this helps.
 
Sorry the error I get is:

The best overloaded method match for LDD.ReportClass.HasbeenAccedBy(ref
LDD.User, ref string) has someinvalid arguments.
 
Ed,

Then what I said would be right. If HasbeenAccedBy is looking for a
LDD.User and you are passing in LDD.UserClass, it won't work.
 
Back
Top