Solved

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

Posted on 2002-07-21
7
243 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Compile GLUT with Visual Studio 2015 1 201
C++ Class Serialization, Encapsulation and Formatted Output 8 89
C++ question 3 74
gdb doesn't stop on breakpoint 2 108
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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

679 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