Solved

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

Posted on 2002-07-21
7
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

752 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