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
Solved

ActiveX + Html + Borland C++ Builder 4

Posted on 2001-08-30
6
1,206 Views
Last Modified: 2013-11-18
Hello!
I have a Html document witch call a activeX Form created with Borland C++ Builder 4.
I want to give some parameters to the activeX in the Html document and I want the activex get the information of these parameters.
Can someone help me to solve my problems?

Thanks a lot for your help!
0
Comment
Question by:ryuken
  • 3
  • 3
6 Comments
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 6439962
As long as the Parameter you are interested in is also an ActiveX Property
of the ActiveForm you should be able to add the Parameter to the OBJECT tag, like you would WIDTH and HEIGHT.

Normally COM requires you to implement an IPesistPropertyBag interface to make this work.
How? See Alex Bakaev's replies to same Q in
www.deja.com. If next link dasn't work, make
search for IPersistPropertyBag.

http://groups.google.com/groups?hl=en&safe=off&threadm=38501BE2.D75BD972%40jetsuite.com&rnum=1&prev=/groups%3Fq%3DIPersistPropertyBagImpl%2BBakaev%26hl%3Den%26safe%3Doff%26rnum%3D1%26selm%3D38501BE2.D75BD972%2540jetsuite.com


0
 

Author Comment

by:ryuken
ID: 6444232
Hello Alex!

Thanks for your help!
I have implemented the IPesistPropertyBag interface in my ActiveX.
But when I give a parameter from the html document to the AxtiveX, the value I get is blank.
I search on www.deja.com how I can get the value of the parameter, but I find nothing interisting!

Could you have any clue to help me, please?

Thanks very much!
Bye!
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 6447369
Next is a bit other code , as in Alex Bakaev(but very close). Check out names in your  PARAM statement in Html
text:
....
This evening I had to research another issue that required that I put
together an ActiveForm sample. I took the opportunity to put together
something illustrating PARAM NAME VALUE support at the same time. Here are
some notes:

(a) Add IPersistPropertyBagImpl to the list base classes:

class ATL_NO_VTABLE TActiveFormXImpl:
VCLCONTROL_IMPL(TActiveFormXImpl, ActiveFormX, TActiveFormX, IActiveFormX,
DIID_IActiveFormXEvents),
public IPersistPropertyBagImpl<TActiveFormXImpl>
{


(b) Add IPersistPropertyBag to your COM_MAP:

BEGIN_COM_MAP(TActiveFormXImpl)
VCL_CONTROL_COM_INTERFACE_ENTRIES(IActiveFormX)
COM_INTERFACE_ENTRY_IMPL(IPersistPropertyBag)
END_COM_MAP()


(c) Add a PROP_ENTRY macro to the PROPERTY_MAP for each property your want
accessible via the PARAM/NAME/VALUE tag, specifying the property name, its
DISPID and the CLSID of your CoClass. For example:

BEGIN_PROPERTY_MAP(TActiveFormXImpl)
// PROP_PAGE(CLSID_ActiveFormXPage)
PROP_ENTRY("Caption", DISPID_CAPTION, CLSID_ActiveFormX)
END_PROPERTY_MAP()


To test the above, I used the following tag in an .HTML file:

<OBJECT
classid="clsid:243A7D2F-1885-11D3-91C2-00C04F8EE514"

codebase="http://oisillon/ActiveX/ActiveFormSample.ocx#version=1,0,0,0"
width=462
height=284
align=center
hspace=0
vspace=0

<PARAM NAME="Caption" VALUE="Caption set via PARAM NAME tags">
</OBJECT>


I also put a button on my form that displays the Caption property when
clicked - to confirm that indeed the "Caption set via PARAM NAME tags" did
work. (NOTE: You'll get additional warnings from IE because the control is
also being initialized).

I hope the above helps. I'll be happy to .zip up the sample and forward you
a copy if you're interested.

Regards,
Jean-Marie Babet
...
By your description seems me problem in next place
<PARAM NAME="Caption" VALUE="Caption set via PARAM NAME tags"> --> all right, and may be you simple forget
VALUE= ?




0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 100 total points
ID: 6500370
I hope, you solved problem with help of my comments.
Alex
0
 

Author Comment

by:ryuken
ID: 6500406
Hello Alex!

Thank you very much for your help!
I am sorry to answer after a few days.
But I have a lot of work to do.
I will try your solution and tell you if it works!

If I am too long to answer, I will give you the points for your help!

Bye bye!
0
 

Author Comment

by:ryuken
ID: 6511845
Hello Alex!

I am sorry.I don't have the time to test your solution.
But I think you give me the good path to resolve it.

Thanks a lot!
See you later!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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
Images for a Website that have different components 3 123
Grunt No Clean Targets 6 184
C++ mouse_event mouse look 7 95
DCT of  2D array using fftw in c++ 9 62
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 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++.

840 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