ImagePro>Re: Can a IPBasic macro call a Macro made with the SDK?


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ImagePro>Re: Can a IPBasic macro call a Macro made with the SDK?



Normally we don't recommend calling macros from C/C++ code. There's no
guarantee that the appropriate macro is available! However, it's quite easy
to call C/C++ code from a macro. If you have the SDK, the .BAS files define
functions and their arguments, along with the DLL they are in, and expose
their functionality to macros. Look at Bas\ipc32.bas for examples.

In terms of converting macros to C/C++ code, the ShearStk example in the SDK
is there for that very reason. The shearstack code was first written as a
macro, then converted to C for compilation. Note that the calls to IPP
operations copy over very directly, with the only real changes being
variable types (Single->float, Integer->short), the use of pointers for
return values (&val instead of val where it's passed by "As Any"), and
semicolons after each line. BASIC commands and structural items such as
Select, If-Then-Else, etc. must be converted to the matching C commands such
as "switch", "if () {} else {}", and so on.

Creating functions with the SDK wizard will generate a few macro calls,
which can be converted to .BAS files using the .BAT file in the wizard
generated directory, and if copied to the \Bas directory expose the C/C++
functions to IpBasic. Additional macro functions can be added by editing the
template-generated code in a few sections.

If you need to call something that doesn't have an IPBasic interface (rare,
but there are a _few_ examples), look at IpAppMenuSelect( ), IpAppCtl( ),
and the other IpApp... commands. In general, there's a direct IpBasic call
for just about anything, and the IpApp commands are there as a last resort.

-- Kevin Ryan
kevin@mediacy.com
Sr. Project Manager
Media Cybernetics, Inc.

> -----Original Message-----
> From: Image-Pro Plus Users Email List
> [mailto:imagepro-users@lists.mediacy.com]On Behalf Of Michael Plonski
> Sent: Wednesday, November 14, 2001 10:13 PM
> To: Image-Pro Plus Users Email List
> Subject: ImagePro>Can a IPBasic macro call a Macro made with the SDK?
>
>
>
> Is there a way to call macros that are made in C using the SDK kit from
> within IPBasic.
>
> I tried to record a macro where I selected items from menus that were made
> using the SDK;
> If it was a macro made with the MFC SDK template, it would record an
> incorrect name with an argument of 1.  If you then try to run the macro it
> generates an error.
>
> If it was a simple macro - like the SDK simple C example, nothing gets
> recorded when you call the macro from the pulldown menu.
>
> It seems like there should be a way to generate a menu pulldown call from
> IPbasic.
>
> My problem, it seems like there is no way to fully automate a
> task - 1 click
> using a combination of SDK generated C routines and IPBasic macros.
>
> The C routines can't call the IPBasic Macros and vice-versa?  I
> didn't find
> anything in the SDK about calling user defined macros.  It does have some
> routines _IPCCALL (etc.) to allow the C-code to call IP functions, but it
> doesn't have a complete working example (like a MS project file).  It also
> seems like this only can call native IPfunction and not IPBasic macros.  I
> would be more interested in having my IPBasic function being able to call
> some generic C routine with generic arguments that can be passed.  The
> IpMail example in the SDK alludes to this, but again it is not
> complete. It
> seems like there should be a way to do this, as the SDK has a
> means to have
> a pull down menu call a C function.
>
> It seems like if there is a way to do it with clicking items, you
> should be
> able to do it in code.  Are there any automated tools for
> converting IPBasic
> Auto-Pro macros to C Auto-Pro calls.  Several times in the
> documentation it
> suggests, you prototype things in IPBasic interface to AutoPro
> and then you
> can write it in C interface to AutoPro later for more
> flexibility.  Some of
> the samples even say this was done in IPBasic and then ported to
> C.   THere
> should at least be some way to call the "Interfacefunction" from
> IPBasic in
> a way similiar to what happens when it gets called from a pull down menu.
>
> Is there some Auto-Pro manual that I am missing.  The SDK help
> files seem to
> refer to manual chapters for more detail, but I don't have / know what
> manual they are referring to.  THe "Auto-Pro Guide for windows" (table on
> page 7-3) refers to a "Getting started with Auto-Pro" disk that I
> didn't see
> in my package.
>
> Any suggestions as to how I can combine IPBasic and C Auto-Pro without
> having the user having to click everything.
>
> Mike Plonski


***********************************************************
Need an Image-Pro macro or driver? Find it at http://www.Solutions-Zone.com
Got an Image-Pro macro or driver? Add it to http://www.Solutions-Zone.com
***********************************************************

This message is sent to you because you are subscribed to <imagepro-users@lists.mediacy.com>.
To unsubscribe, email to: <imagepro-users-off@lists.mediacy.com>
To switch to the DIGEST mode, email to <imagepro-users-digest@lists.mediacy.com>
To switch to the INDEX mode, email to <imagepro-users-index@lists.mediacy.com>
Send administrative queries to  <imagepro-users-request@lists.mediacy.com>
To subscribe or unsubscribe visit http://www.solutions-zone.com/ipednld/subscriber.asp



Search this Archive