Re: syntax question in dealing with .Net api



[newsgroups trimmed since my ISP doesn't carry microsoft.*, f'up set]

Quoth trillich@xxxxxxxxx:

we've got two apps, one in java, one in .Net, and we're trying to put
some glue together to transfer data back and forth between them:

- reading data FROM the .Net application is easy
- writing data TO the .Net application is a puzzle...

to read data from within VB, we can use syntax like VAR =
OBJ.METHOD(PARAMS) and to write fields to an object from within VB
it's also simple: OBJ.METHOD(PARAMS) = VAL.

only the read-style syntax works in exterior languages (Perl is our
platform for proof-of-concept):

$val = $obj->method("param");

but the write-style syntax needs something different:

$obj->method("param") = $expr; # no way

I don't know much about .Net, but when you say 'fields' here are you
referring to what Microsoft call 'properties' in OLE/COM? In that case,
that standard way to access COM objects from Perl is to use the
Win32::OLE module, which provides the syntax

$obj->LetProperty('method', 'param', $expr);

to perform what you are asking for above. See the docs for Win32::OLE.

Since the method/property distinction, in particular the concept of
'properties with arguments which are nevertheless assignable and
different from methods', is very much a VB thing, you will have to use
some sort of OLE-compatibility layer in other languages. I would have
thought most languages that run on Win32 would have a standard COM
binding, by now.

If you are talking to your .Net app through some means other than COM,
you will have to tell us more about what you are doing.

Ben

.



Relevant Pages

  • Re: What was Noam Chomskys contribution to *LINGUISTICS*?
    ... >>> The thing is that you can't use corpus linguistics to falsify Paul ... >> syntax class to discover how many found a particular example acceptable. ... who have likely been taught British Standard English. ... > a number of Romance and Germanic languages enter into the discussion. ...
    (sci.lang)
  • Re: Introducing a teenager to programming
    ... I am talking about well-written code in both languages. ... The same with lisp. ... basic syntax of lisp is so simple: ... there are languages with much worse readability floating around... ...
    (comp.programming)
  • Re: Killing VB softly with his song, Killing VB softly...with a song.............
    ... The topic is about syntax and grammar and only ... > in C or C based languages? ... > C++, Java, C# and J# share in much of their actual language syntax. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Killing VB softly with his song, Killing VB softly...with a song.............
    ... syntax of the web is based in markup. ... What you are talking about is object-oriented programming languages that can ... > about which syntax and which grammar has become the defacto standard for ... > legacy of C has become the legacy of the web and this legacy is best ...
    (microsoft.public.dotnet.languages.vb)
  • Re: New bytecode assembly language to play with
    ... C syntax does have its deficiencies. ... many languages have. ... only available within the scope of a single function to be a pretty ... A globally declared function can only see ...
    (comp.lang.misc)