|
Aaron,
GetUnits_IPJ is
actually a macro:
#define
GetUnits_IPJ(A,B,C) IGetUnits_IPJ(A,B,C,sizeof(C))
In all functions
that return a string, we use a macro to insure that the function is called
correctly. The macro forces you to pass a string variable for "C", because
the sizeof() function will give a syntax error on a constant, such as
"3".
Your example 3 can
cause the system to completely fail because the returned string can over-run the
constant in "3" into unknown memory.
In short, always use
the macro versions of all functions that return a string, which is why your
example 1 works.
Best
Regards.
Erik
I've been trying to figure out how to create and
display a map without having to go to the NEWMAP.GX or the DEFMAP.GX through
iRunGX_SYS(). I've been looking at DEFMAP.GXC trying to find out how to do it.
I've almost got it working but I'm confused as to the syntax of the
GetUnits_IPJ method.
- In DEFMAP.GXC, the command is GetUnits_IPJ(hIPJ, rConv,
sTmpl); and it works
- If I change it to GetUnits_IPG(hIPJ, rConv,
"3"); i.e. replacing sTmpl by an explicit string, I get an
error
- If I change it to IGetUnits_IPG(hIPJ, rConv,
"3", STR_DEFAULT); i.e. replacing sTmpl by an explicit string and
define the length, it works
- If I change it to IGetUnits_IPG(hIPJ, 1.0, "3",
STR_DEFAULT); i.e. replacing rConv by an explicit real number, I
get an error.
Can anyone figure out what's going on here? or is
my percieved syntax problem mopst likely due to something else that I'm not
illustrating here?
Aaron Balasch Sky Hunter Technologies
Inc. Suite 101, 1725 10th Avenue S.W. Calgary, Alberta T3C 0K1 Phone:
(403)228-2175 Fax: (403)244-7955 email: [EMAIL PROTECTED]
|