Page 1 of 1

VB6 setvariable

Posted: Wed Jan 14, 2009 6:34 am
by RG
Please help me, what's wrong?
...
Private Const FPCM_SETVARIABLEA As Long = (FPCM_FIRST + 285)

Private Type sfpc_txt
txt As String
len1 As Long
End Type

'SFPCSetVariable ansi
Private Type SFPCSetVariable
name As sfpc_txt
data As sfpc_txt
hr As Long

End Type
...
Dim FPCSetVariable As SFPCSetVariable
FPCSetVariable.name.txt = "cdchecked"
FPCSetVariable.name.len1 = Len(FPCSetVariable.name)

FPCSetVariable.data.txt = "1"
FPCSetVariable.data.len1 = Len(FPCSetVariable.data)

'sendmessage передает в анси кодировке

Call sendMessage(FlashPlayerControlWnd,FPCM_SETVARIABLEA,0&, FPCSetVariable)



But "cdchecked" variable in flash<>1
And ShockwaveFlash2.SetVariable "cdchecked", "1" worked fine.

Posted: Wed Jan 14, 2009 1:10 pm
by Softanics
Thank you for your question.

It would be better to use the following:

Code: Select all

Private Declare Function FPC_SetVariable Lib "f_in_box.dll" _
    Alias "FPC_SetVariableA" _
    (ByVal hwndFlashPlayerControl As Long, _
    ByVal lpName As String, _
    ByVal lpValue As String) As Long

    ' SetVariable
    FPC_SetVariable FlashPlayerControlWnd, "var1", "value1"

    ' GetVariable
    Dim value As String
    value = String$(1024, 0)
    Dim temp As Long
    FPC_GetVariable FlashPlayerControlWnd, "var1", value, temp


Please check it.

Thank you.

Posted: Thu Jan 15, 2009 6:39 am
by RG
Work's fine.
Thank you