Compile error in StructGet?

I cannot figure out what I am doing wrong here.

I can do this ...

    pvname = cwfile + "_ProcessVariables"
    string/G $pvname
    StructPut/S spv, $pvname

But this throws a compile error ... (Can't use $ in this way in a function).

    pvname = cwfile + "_ProcessVariables"
    string/G $pvname
    StructGet/S spv, $pvname

Igor Pro 8.04

StructGet wants an SVAR in this situation:

    pvname = cwfile + "_ProcessVariables"
    string/G $pvname
    SVAR pv=$pvname
    StructGet/S spv, pv

(Storing into a string is different than reading from a string expression, which is why StructGet compiles differently.)