.net - COM method call fails in C#, VB.NET, but works in Python -


i'm having trouble com library i'm trying use. argumentexception when call particular method , pass null. happens me in both c# project , vb.net project (i call method using nothing) added library reference "com" list in visual studio 2008. when call same method in python, passing in none, method works expected no errors. it's understanding python interacts com library through dcom (and have fuzziest notion means) whereas might using com library directly when reference in c#/vb.net projects. happening cause parameter pass screwed before gets com library? i'm not sure what's happening here. updated com library newer version, wondered if perhaps getting version conflicts in there somewhere, causing exception. removed references com library c# , vb.net projects, deleted bin , obj directories, , re-added reference. did cause interop.mycomlibrary.dll file shows in obj have today's date instead of older date had been seeing.

the documentation have com library describes method follows:

public function additem( _    byval itemdata variant _ ) object 

i'm trying search around issues regarding variant parameters now.

edit: while type.missing , other solutions work getting me past method call without error, trying read string properties on returned item method result in:

system.runtime.interopservices.comexception: item not exist.

this example worked in python throwing exception in c#, i'm guessing more dcom-versus-com weirdness. or perhaps threading issue, since i'm using mstest test.

yes, null not correct. there couple of variants indicate "no data", vt_empty, vt_error, vt_null. start passing type.missing.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -