Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2002-07-21
7
Medium Priority
?
249 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
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
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.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

963 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