Solved

how to get the html object paramaters in atl activex dll?

Posted on 2002-07-21
7
240 Views
Last Modified: 2012-06-21
hi,
I've created an atl dll project, added a lite control to it. I would like to pass parameters to the control like this:
<object id=....>
<param name="Message" value="Hello word...">
</object>
How to get the parameter value in the component?


0
Comment
Question by:cosie
7 Comments
 

Expert Comment

by:LeprA
ID: 7168399
You could use a SAX parsers to parse out the values...

Microsofts SAX parseser Reference:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm/sax2_reference_4y3p.asp

//LeprA
0
 
LVL 22

Expert Comment

by:ambience
ID: 7168964
parameters are infact properties of the object. i.e. you just add property to your control, and from HTML you can set that property using PARAMS tag.

No need at all for parsing or whatever.

Try adding a new property say MyString (type BSTR), with get and put functions.

In HTML add

<param name="MyString" value="Hello word...">

and thats all ...
0
 

Author Comment

by:cosie
ID: 7179995
it does not work....
the put code of the property haven't been called in ie....
STDMETHODIMP CMyObject::put_MyString(BSTR newVal)
{
     AFX_MANAGE_STATE(AfxGetStaticModuleState())
     AfxMessageBox("put_MyString");
     return S_OK;
}
no dialogbox....
why?

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:ambience
ID: 7184384
there doesnt seem to be a problem with what you have described so far.

perhaps you can try to put

::MessageBox instead of AfxMessageBox, though this should not be an issues but just for trying out.

Another way to test  it to put a property of type VARIANT.
0
 

Author Comment

by:cosie
ID: 7184447
I've tryed the VARIANT, does not work at all. The debugger stops in the constructor, but does not stop in the put_MyString. If I set it from javascript, it shows the messagebox...
Could you send me a working source code, please???
0
 

Author Comment

by:cosie
ID: 7190173
I've found the solution: IPropertyBag.
0
 

Accepted Solution

by:
ComTech earned 0 total points
ID: 7191535
This question will be placed in PAQ, and points refunded.

Regards,

ComTech
Community Support Administrator  
Experts-Exchange  
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now