Solved

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

Posted on 2002-07-21
7
238 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 22

Expert Comment

by:ambience
Comment Utility
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
Comment Utility
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
Comment Utility
I've found the solution: IPropertyBag.
0
 

Accepted Solution

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

Regards,

ComTech
Community Support Administrator  
Experts-Exchange  
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

762 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

7 Experts available now in Live!

Get 1:1 Help Now