DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

set a variable, declared in a diadem script, via OLE

Hello,
 
I am using the OLE interface to communicate with VC++ and Diadem.
I want to load parameters, before running a script-function.
So I decided, first run a script to declare the parameters (using dim instructions) with command:
p_Diadem->CmdExecuteSync(COleVariant("ScriptStart('V:\\Main.vbs')"));
then I load the specific parameters with the command:
p_Diadem->CmdExecuteSync(COleVariant("MyVariable = 55")),
or
p_Diadem->IntegerVarSet("MyVariable",COleVariant(long(55)))
 
now I read back this parameters with command
p_Diadem->IntegerVarGet("MyVariable",&Value) //Value Type: _variant_t
 
but Value don't have the expected result, neither when setting the value in the script directly.
Can you tell me what's the problem?
 
Kind regards,
JB
 
0 Kudos
Message 1 of 2
(2,925 Views)
Hello JB!
 
You can only get/set DIAdem variables, no VBS Variables. Check your code with the 'L1' variable. This will work.
Look in the DIAdem error log. There should be an error message with 'MyVariable'.
You can use the 'OdsValAlloc' command in CmdExecuteSync to declare a variabe.
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 2
(2,920 Views)