views:

28

answers:

1

I'm using the LeadTools Multimedia video capture control, which appears as type AxltmmCaptureCtrl. In my code, I have the following line:

AxltmmCaptureCtrl1.VideoWindowSizeMode = LTMMLib.ltmmSizeMode.ltmmFit;

That compiles just fine, with no complaints or even warnings from the compiler. But when I use the thing at runtime, I get the following error:

Method not found: 'Void AxLTMMLib.AxltmmCaptureCtrl.set_VideoWindowSizeMode(LTMMLib.ltmmSizeMode)'.

WTF?! Intellisense picks up the method, and the compiler is fine with it - but in runtime it suddenly decides the method doesn't exist?

There are some other properties (not all) exhibiting similar behavior. It doesn't seem to discriminate between setters and getters.

Any ideas?

EDIT: Curiouser and curiouser... it seems that the problem only occurs in runtime of a UserControl, i.e. in Design Mode. I have put this LeadTools control into my own UserControl, and when I put that control onto another form, I get this "Method not found" error. But when it's in runtime ("real" runtime, that is, not UserControl runtime), the code works perfectly! How bizarre is that?

+1  A: 

You are compiling against an interop assembly - a managed/.NET assembly designed to mimic the underlying COM API. The most likely problem here is versioning; maybe that property is present in the managed PIA, but missing in the COM version you have.

Marc Gravell
@Marc - That sounds like a reasonable explanation, thanks. Now how do I go about compiling a new Interop assembly that does match the COM API?
Shaul
You can use tlbimp (http://msdn.microsoft.com/en-us/library/tt0cf3sx(v=vs.80).aspx) to create interops. tlbimp is part of the Visual Studio installation.
ShellShock
Please see my edit - the error only occurs in UserControl runtime, not "real" runtime!
Shaul