mcmcdonald
New Member
Hello!
I have a problem accessing COM-functions of a 3D library (Truevision3D).
Some functions need data structurs in the form of D3DVECTOR, defined as
typedef struct D3DVECTOR {
float x, y, z;
} D3DVECTOR, *LPD3DVECTOR;
when i try to call the function from visual basic, all runs well:
Dim pos As DxVBLibA.D3DVECTOR
pos.x = -1
pos.y = -1
pos.z = -1
TV3D_LightEngine.CreateQuickDirectionalLight(pos, 1, 1, 1, "light", 0)
but trying the same in progress results in an error
"Unexpected error during execution of method CreateQuickDirectionalLight (5889)"
i define the vector as a memptr:
DEF VAR vec3 AS MEMPTR.
SET-SIZE(vec3) = 12.
PUT-FLOAT(vec3,1) = -1.0.
PUT-FLOAT(vec3,5) = -1.0.
PUT-FLOAT(vec3,9) = -1.0.
then i call the function as mentioned in the com-object-viewer:
tv3d_light = tv3d_light_engine:CreateQuickDirectionalLight(INPUT-OUTPUT vec3 BY-POINTER,1.0,1.0,1.0,"light",0.0).
the definition from the com-object-viewer is
[ Integer-Var = ] <com-handle>: CreateQuickDirectionalLight (
INPUT-OUTPUT <user-defined>-Direction BY-POINTER,
Decimal-red AS FLOAT,
Decimal-green AS FLOAT,
Decimal-blue AS FLOAT,
Character-lightname,
Decimal-specularscale AS FLOAT ).
It seems that the vector information does not go properly into to CreateQuickDirectionalLight function.
Are there any ideas what i am making wrong ?
Thanks
Andreas
I have a problem accessing COM-functions of a 3D library (Truevision3D).
Some functions need data structurs in the form of D3DVECTOR, defined as
typedef struct D3DVECTOR {
float x, y, z;
} D3DVECTOR, *LPD3DVECTOR;
when i try to call the function from visual basic, all runs well:
Dim pos As DxVBLibA.D3DVECTOR
pos.x = -1
pos.y = -1
pos.z = -1
TV3D_LightEngine.CreateQuickDirectionalLight(pos, 1, 1, 1, "light", 0)
but trying the same in progress results in an error
"Unexpected error during execution of method CreateQuickDirectionalLight (5889)"
i define the vector as a memptr:
DEF VAR vec3 AS MEMPTR.
SET-SIZE(vec3) = 12.
PUT-FLOAT(vec3,1) = -1.0.
PUT-FLOAT(vec3,5) = -1.0.
PUT-FLOAT(vec3,9) = -1.0.
then i call the function as mentioned in the com-object-viewer:
tv3d_light = tv3d_light_engine:CreateQuickDirectionalLight(INPUT-OUTPUT vec3 BY-POINTER,1.0,1.0,1.0,"light",0.0).
the definition from the com-object-viewer is
[ Integer-Var = ] <com-handle>: CreateQuickDirectionalLight (
INPUT-OUTPUT <user-defined>-Direction BY-POINTER,
Decimal-red AS FLOAT,
Decimal-green AS FLOAT,
Decimal-blue AS FLOAT,
Character-lightname,
Decimal-specularscale AS FLOAT ).
It seems that the vector information does not go properly into to CreateQuickDirectionalLight function.
Are there any ideas what i am making wrong ?
Thanks
Andreas