Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Finding group of function object via PBNI

8 views
Skip to first unread message

frerichraabe

unread,
Sep 1, 2009, 4:56:47 AM9/1/09
to
Hi,

I developed a little PowerBuilder extension in C++ which, in
response to a call to my reimplementation of
IPBX_NonVisualObject::Invoke, attemps to call a global
PowerScript function. However, this fails early since the
group
of the function object cannot be found. My code looks like
this:

PBXResult ExtensionObj::Invoke( IPB_Session *session, ... )
{
pbgroup group = session->FindGroup( "myFn",
pbgroun_function );
// ...
}

The FindGroup() call always returns zero after deploying the
application. However, when launching the application from
within
PowerBuilder, the group is located successfully! Does
anybody
know why that is? Maybe launching PB applications from
within
PB re-uses the virtual machine, so the function group is
'registered' already, but this is not true for deployments?

Any thoughts would be much appreciated!

- Frerich

Jeremy Lakeman

unread,
Sep 1, 2009, 7:20:44 AM9/1/09
to

And have you built the application with pbd's or as an exe?
If the function is not referenced by any PB code it will not be
included by the build process.

frerichraabe

unread,
Sep 1, 2009, 9:00:42 AM9/1/09
to
> And have you built the application with pbd's or as an
> exe? If the function is not referenced by any PB code it
> will not be included by the build process.

Yes, I suspected something like that after I noticed that
the function is found if I make sure that it's called at
some point in my application. Thanks!

- Frerich

Jeremy Lakeman

unread,
Sep 1, 2009, 10:36:55 AM9/1/09
to

BTW you don't have to call it. Just declare a variable of that type;

f_callback lf_callback

Seems odd declaring a variable of a function type doesn't it?
You can also create an instance of a function type.
And if you edit the source you can give the function class instance
variables or local external methods...

But that gives the .net compiler a headache.

0 new messages