Passing COM VB6 strings weirdness

drs drs at remove-to-send-mail-ecpsoftware.com
Sat Apr 17 02:30:14 EDT 2004


"U-CDK_CHARLES\Charles" <"Charles Krug"@cdksystems.com> wrote in message
news:z3Rfc.66372$QQ6.4420 at nwrdny02.gnilink.net...
> List:
>
> I've a Python COM server that keeps an event logs.
>
> I've been using it from VB6:
>
> * * *
>
> When I log certain events from VB, I also display a message box for the
> user or for me, depending on the specific message.
>
> If I call messageBox BEFORE I invoke logEntry, all is well.
>
> BUT if I invoke logEntry first, the passed string becomes a literal
> zero.
>
> Any thoughts on this?  I'm not certain why I'm getting the returned
> value from this at all, let alone why it's being assigned to the
> argument string.

I don't know if this is the same thing, but I have found that often passing
variables from VB to Python COM servers mucks up the variables on the VB
side.  I think I have posted this issue here (probably a few years back),
but I have never gotten a reason why -- i think. Also, I have never really
pinned down exectly what circumstances lead to it.  Instead, I have gotten
used to declaring two identicle variables in VB when I need to do what you
are doing.  It is an awful hack, but it works.

Sorry for such a lame answer.

-doug





More information about the Python-list mailing list