ComponentWorks was designed as ActiveX controls that could be used from any
ActiveX container. It is challenging for us to provide language specific
support for the numerous containers out there. So, I will tell you what
theoretically should work.
In VB, the gets and sets are not obvious, since you only use the property
name.
If you want to access an object, such as CWData, use getData. Then you can
modify it using setValue or CopyFrom on the CWData object returned from getData.
You may even be able to chain the calls together, as in CWDataSocket1.getData().setValue
denise
"Matt Hanger" wrote:
>Denise,>>Thanks for your help, but I don't see how I can use the CopyFrom
function in>J++. I know that the ComponentWorks ActiveX controls probably
weren't>designed with J++ in mind, but I'm sure there's a way? If not, then
maybe it>will give the ComponentWorks developers something to work on for
a future>release 🙂 I can't possibly be the first person to use CWDataSocket
with J++>can I?>>Anyhow, I believe I'm beginning to understand DataSocket
a bit more. In>Visual Basic, you don't need to use CopyFrom, you can just
say :>>'CWDataSocket1.Data.Value = some value>>You can also just say :>>'CWDataSocket1.Data
= some value>>It seems that 'Value' is implied in Visual Basic. So, the Data
property is>read-only, but the value can be set by specifying Data.Value
or>Data.CopyFrom, at least in Visual Basic. (Side question, shouldn't the>object
browser specify if a property is read only?).>>However, none of this will
work in J++. Or, if it can, I'm not seeing it. In>J++, when you use an ActiveX
control or plain-old COM object, it creates the>..java files for you automatically.
So, the only way I can access the Data>property is via getData() or setData(),
and that doesn't give me access to>the CopyFrom() method or the Value property.>>Again,
thanks for all your help so far. Hopefully we will be able to find a>solution
soon.>>- Matt Hanger>>>"denise" wrote in message>news:38e3eced@newsgroups.ni.com...>>>>
HI Matt,>>>> As the error message indicates, Data is a read only property.
If you want>> to assign a CWData object to the DataSocket.Data member, use
the CopyFrom>> method:>> 'vb sample>> Dim cwd As New CWData>> 'fill
in cwd>> 'copy cwd to the DataSocket control>> CWDataSocket1.Data.CopyFrom
cwd>> 'update server with new data>> CWDataSocket1.Update>>>> Note that
the help for the CopyFrom function states that Update method>will>> get triggered
automatically after CopyFrom. But I had to explicitly call>> Update in order
to send the data to the server.>>>> Hope that helps,>> Denise>>>