Writing an activex control to proxy calls to an unregistered activex control

Hi all,

One of my clients needs to support using two versions of an activex
control within Internet Explorer. However, both versions of the control
register to the same CLSID meaning that it is not possible to run both
concurrently without some intervention.

One idea that I had was to create a new activex control under a
different CLSID (and associate that CLSID with a different mimetype) so
that requests to the new mimetype will be sent to the new activex
control, which will in-turn proxy those requests to the unregistered
version of the activex control.

Has anyone had experience doing anything like this before? I have a lot
of research to do on this front and I thought I would see if anyone
could point me in the right direction. I know that I can use
LoadLibrary and GetProcAddress, etc to interact directly with the
unregistered activex dll, but I'm hoping there is a more elegant
solution. Any help would be greatly appreciated.

Cheers,

Joe

0
troutyjoe (3)
7/12/2006 11:49:48 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
602 Views

Similar Articles

[PageSpeed] 42

It sounds like a fundamental error to have two different ActiveX controls with the same
CLSID.  Somebody obviously screwed up big-time.
				joe

On 12 Jul 2006 16:49:48 -0700, "TroutyJoe" <troutyjoe@yahoo.com> wrote:

>Hi all,
>
>One of my clients needs to support using two versions of an activex
>control within Internet Explorer. However, both versions of the control
>register to the same CLSID meaning that it is not possible to run both
>concurrently without some intervention.
>
>One idea that I had was to create a new activex control under a
>different CLSID (and associate that CLSID with a different mimetype) so
>that requests to the new mimetype will be sent to the new activex
>control, which will in-turn proxy those requests to the unregistered
>version of the activex control.
>
>Has anyone had experience doing anything like this before? I have a lot
>of research to do on this front and I thought I would see if anyone
>could point me in the right direction. I know that I can use
>LoadLibrary and GetProcAddress, etc to interact directly with the
>unregistered activex dll, but I'm hoping there is a more elegant
>solution. Any help would be greatly appreciated.
>
>Cheers,
>
>Joe
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/13/2006 12:27:27 AM
This is truly odd.  The whole point of the CLSID is uniqueness, and one 
of the main selling points of COM (which is the superset of ActiveX) is 
version compatibility.  Both rules seem to be broken here.  Good luck 
with this one.

-DF

TroutyJoe wrote:
> Hi all,
> 
> One of my clients needs to support using two versions of an activex
> control within Internet Explorer. However, both versions of the control
> register to the same CLSID meaning that it is not possible to run both
> concurrently without some intervention.
> 
> One idea that I had was to create a new activex control under a
> different CLSID (and associate that CLSID with a different mimetype) so
> that requests to the new mimetype will be sent to the new activex
> control, which will in-turn proxy those requests to the unregistered
> version of the activex control.
> 
> Has anyone had experience doing anything like this before? I have a lot
> of research to do on this front and I thought I would see if anyone
> could point me in the right direction. I know that I can use
> LoadLibrary and GetProcAddress, etc to interact directly with the
> unregistered activex dll, but I'm hoping there is a more elegant
> solution. Any help would be greatly appreciated.
> 
> Cheers,
> 
> Joe
> 
0
d.flathead (11)
7/13/2006 12:53:57 AM
Yeah, it's a real drag. The client's intranet software uses a newer,
"pre-release" version of the activex control that is freely available.
The software I develop uses an older version of the activex control.
Unfortunately, both versions of the control use the same CLSID.

As far as my software is concerned, there are some breaking changes
between the two releases of the activex control and I'd rather not
maintain two codebases to support the two control versions.

So that is the reasoning behind this madness.

At the moment, I'm researching how to create an activex control and
have it be hosted by IE. As a starting point, all I want to be able to
do is have an activex control hosted by IE that puts a msgbox on the
screen when someone drags a file of a particular file format/mimetype
into an IE window.

I don't know what interfaces I need to implement in the control to
support this functionality.

Any pointers or links on how to do this would be appreciated.

Cheers,

Joe

0
troutyjoe (3)
7/13/2006 3:11:36 AM
Key here is that there is no such thing as two different controls with the same CLSID.  As
pointed out in another message, if the interface changes, the CLSID *must* change!  

I agree with the previous post, you're in trouble, and there's probably no resolution.
					joe

On 12 Jul 2006 20:11:36 -0700, "TroutyJoe" <troutyjoe@yahoo.com> wrote:

>Yeah, it's a real drag. The client's intranet software uses a newer,
>"pre-release" version of the activex control that is freely available.
>The software I develop uses an older version of the activex control.
>Unfortunately, both versions of the control use the same CLSID.
>
>As far as my software is concerned, there are some breaking changes
>between the two releases of the activex control and I'd rather not
>maintain two codebases to support the two control versions.
>
>So that is the reasoning behind this madness.
>
>At the moment, I'm researching how to create an activex control and
>have it be hosted by IE. As a starting point, all I want to be able to
>do is have an activex control hosted by IE that puts a msgbox on the
>screen when someone drags a file of a particular file format/mimetype
>into an IE window.
>
>I don't know what interfaces I need to implement in the control to
>support this functionality.
>
>Any pointers or links on how to do this would be appreciated.
>
>Cheers,
>
>Joe
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/13/2006 5:19:45 PM
Hi Joe,

The CLSID represents an immutable interface.  Since it's supposed to
be immutable, certain programming languages store a binary
representation of the interface to speed things up.  When you change
the interface without changing the CLSID, you effectively torpedo you
ACtiveX control.  All clients who have stored notes on the side about
this interface (VB6 does this) will happily call the wrong method
through their now obsolete vector table.  They could also be calling
the right method with the wrong parameter types, or the wrong number
of parameters.  All bets are off.  None of the web pages that rely on
this abomination can be trusted any longer.

Sorry to be the bearer of bad news, but this is icky to the extreme.
About all you can do is to force the server to revert to the
origninal, immutable interface, then attempt to erradicate any clients
use of the new, corrupted one.  This will be difficult in and of
itself because of the way the OS tries to avoid updating a module if
it has a newer version number (which presumably the bad one has).

-Kurt


On 12 Jul 2006 16:49:48 -0700, "TroutyJoe" <troutyjoe@yahoo.com>
wrote:

>Hi all,
>
>One of my clients needs to support using two versions of an activex
>control within Internet Explorer. However, both versions of the control
>register to the same CLSID meaning that it is not possible to run both
>concurrently without some intervention.
>
>One idea that I had was to create a new activex control under a
>different CLSID (and associate that CLSID with a different mimetype) so
>that requests to the new mimetype will be sent to the new activex
>control, which will in-turn proxy those requests to the unregistered
>version of the activex control.
>
>Has anyone had experience doing anything like this before? I have a lot
>of research to do on this front and I thought I would see if anyone
>could point me in the right direction. I know that I can use
>LoadLibrary and GetProcAddress, etc to interact directly with the
>unregistered activex dll, but I'm hoping there is a more elegant
>solution. Any help would be greatly appreciated.
>
>Cheers,
>
>Joe
0
7/14/2006 4:11:12 PM
As others have pointed out, you are on murky ground here. Something you
can think about it supporting another interface (in the same control)
which derives from the older interface which you want to replace. You
can then selectively route calls as needed to older interface or to the
newer one.

---
Ajay

0
ajaykalra (6842)
7/14/2006 4:15:55 PM
Hi all,

Thanks for the replies. Unfortunately, the activex control is 3rd
party. The only control that I have over the situation is in the html
page that I deliver to the client. I was just scoping out possibilities
to support the two different versions of the same control.

Anything I do on this front (e.g. on page load, deliver-up another
control that regsvr32's the version of the control I need to be
registered. When finished page load, re-register the old one) is going
to be pretty ugly. Yep, it's getting hard to sleep at night.

Thanks,

Joe

0
troutyjoe (3)
7/16/2006 8:45:53 PM
Reply:

Similar Artilces:

CFile::Write
Hi I'm tring to write 3 lines to a text file using CFile::Write. I need a carriage-return between each line but don't seem to be able to achieve that. This is my code CFile mac mac.Open("macro.txt", CFile::modeCreate | CFile::modeWrite) CString st st.Format("CHANNEL 1\n") mac.Write(st, st.GetLength()) st.Format("GRAPHTYPE W\n") mac.Write(st, st.GetLength()) st.Format("LOAD FILE=filename.txt") mac.Write(st, st.GetLength()) mac.Close() when I then open the file with notepad, the carriage return "\n" the carriage return just give me a f...

SaveBarState fails when it is called from a thread #7
Hi, In my application, I use SaveBarState() for persisting control bar state. The code fragment is something like this. void CMainFrame::OnSavePersistance() { SaveBarState(_T("My Persistence")); // Saves some information to an xml file } Since my xml saving takes some time I changed the code to execute in a thread UINT ThreadFn(LPVOID pParam) { CMainFrame* pThis = (CMainFrame*)pParam; pThis->SaveBarState(_T("My Persistence")); return 0; } void CMainFrame::OnCntrlbartst() { AfxBeginThread( ThreadFn, this ); } But, now in the thread function SaveBarState...

ActiveX issue in PowerPoint 2003
I used More Tools/"Microsoft Forms 2.0 Frame" to add a scrollbar to one slide's image. This works fine, but now every time I open the saved file I get the following message: "This application is about to initialize ActiveX controls that might be unsafe. If you trust the source of this document, select Yes ..." Well, of course I trust the doc, because I'm the one who created it. The message also states "If you have changed the default setting for ActiveX initialization during the installation process ... the system will perform the initializati...

icon and control list
Hi, can anybody advise me on how to add icon in control list ? thanks in advance, Can you describe in detail? "JSmith" <jsmithmitra@yahoo.com> д����Ϣ���� :uaH7c5lsEHA.3788@TK2MSFTNGP15.phx.gbl... > Hi, > > can anybody advise me on how to add icon in control list ? > > thanks in advance, > > Hello Tianyuan , Sure, I'm going to list keys of a configuration file into a control list so it should have a column as icon. Since every key has an attribute (e.g. system key, non-system and ... ) so I like to insert an icon for each key in regard with its ...

Add edit control to a view derived from CScrollView
I have a view class which is derived from CScrollView. I added a CEdit control to it. But the position of the edit control was not correct. I think it is because I set the map mode to MM_TWIPS for drawing things in the view and the edit control was positioned with a CRect, which values are in MM_TEXT mode. My question is how do I set the correct postion of the edit control in my view class. Thanks! Seems to me that you have the answer already -- convert your CRect values to twips instead of device units. In article <a70600a9.0404021933.60d0c242@posting.google.com>, john_gsr@hotmail.c...

Software recommendations for Document Control, CAPA and PLM
My company is looking for third party software for Document Control, CAPA and PLM. If any of you have any recommendations, please post. It will be nice if these softwares could interface with Great Plains. Stacey ...

How to access a function in a User Control
Hi All, I have created a MFC ActiveX OCX, using VC++ 7.0, which contains a dialog. I have embeded another user created control (this was created with VB6). This VB6 control exposes 2 functions. I would like some help on how to call these functions from my MFC OCX (say on a button click event). Thanks in advance ... Hussain Shabbir > I have created a MFC ActiveX OCX, using VC++ 7.0, which contains a > dialog. I have embeded another user created control (this was created > with VB6). This VB6 control exposes 2 functions. I would like some > help on how to call these functions fr...

Problem with List Control Box
I have a list control with 3 columns. For some reason when I try to insert an entry into the list control, sometimes, only the item's first value gets added, but the values for the 2nd and 3rd column are not there. If i continue to add the same entry consistently, eventually the entry will be added correctly with all three values. Why is that? For example: sometimes I will add (a,b,c) into my List control box, but only (a) gets shown. But if i keep inserting an item, eventually the entry (a,b,c) will be added... >I have a list control with 3 columns. For some reason when I try ...

Ato generated control number
Hi , Thank you for any and all assistance. I have a customer entry form(CustEntryForm) the fields that I want to auto populate are CreationDate, ControlNumber. The CreationDate date/time stamps when the customer request is created. The ControlNumber is my request tracking field. The CreationDate field works. What I am having a problem with is getting the ControlNumber field to auto generate. The ControlNumber is being created based on the CreationDate field by grabbing the year portion of the date. The date is structured like yy-001(10-001) I have the following SQL state...

graph control needed
hi i want a graph control to draw a linear and smooth graph.I am using MFC. any kind of guidance is appreciated.... check this: http://www.codeproject.com/miscctrl/mschartvc.asp regards, Jayender. quickdeveloper wrote: > hi > > i want a graph control to draw a linear and smooth graph.I am using > MFC. > any kind of guidance is appreciated.... This one might be interesting to you as well: http://www.codeguru.com/cpp/cpp/cpp_mfc/general/article.php/c8535/ Tom "quickdeveloper" <nvamshikrishna@gmail.com> wrote in message news:1137499093.575651.292350@g43g...

Write Namevalue pair into Config file
Hi I have this constraint. A help would be greatly apprecitated. I have this Config file. <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="ITASCA"> <section name="ConnectionString" type="System.NamevaluesectionHandler,System" /> </sectionGroup> </configSections> <ITASCA> <ConnectionString> <add key="projcode1" value="database"/> <add key="projcode2" value="database2"/&...

Creating and adding controls
I need to dynamically create and add controls to a property sheet (page). When should this be done. I can't during OnInitDialog because the dialog doesn't have a hwnd at that time. What other function could I do this? Thanks, Do it in OnInitDialog() , after calling the base class OnInitDialog() function. Something like BOOL CYourPage::OnInitDialog() { CPropertyPage::OnInitDialog(); // base class function // Your control creation return TRUE; } -- Cheers Check Abdoul [VC++ MVP] ----------------------------------- "...

MFC ActiveX Control not working
I created this ActiveX control in MFC and put it at http://www.coolgroups.com/activextest9.htm. Unfortunately, it doesn't work. I wasn't sure what to put for the #Version part of the codebase tag, so I just randomly put #Version=1,0,0,001. Can someone please help me? I've looked all over and have found no useful info on this issue. ...

Problem with ActiveX Mousewheel
Hi All, Sorry for posting in the general group. I posted this in the ActiveX group, but it looks like that group is all but extict. I thought I'd try my luck. I've used the MouseWheel control in the past without problem, but now I have one. In trying to understand it, I came up with a question as well. Here's both... The Problem: I use the control to make the mousewheel act on a listbox, called lstGroup, that is on the form. The code I include in the form's module is at the bottom of the post. Whenever I close the form, I get the error: ...

Write to Module While Macro is Running
I have a macro that allows the user to study vocabulary words. At the outset the array is filled with integers, one for each word. A number is randomly selected from the array and the word corresponding to that number is examined. That number is then removed from the array. Only after all words have been examined is the array is repopulated with all of the numbers. This allows to the user to examine all words before a specific word is encountered again. On exiting the workbook, whatever numbers remain in the array are written to a worksheet, so that the array can be filled with o...

Link a Spinner to a combo box control
Hi all, I don't know if my terminology is correct ( i am going by what pops up when I hold my mouse over the controls on the control tool bar) but I am having trouble linking a spinner to a combo box on a worksheet. What i want is a way for a user to cycle through the values in the combo box using the spinner. I am sure there should be an easy way to do this but for now I am stumped. I have tried linking them both to the same cell which works ok if I change the cell value manually but if I change it using the spinner the combo box does not update. Strangely if I change the choice in the c...

Priority on Service Call
Where does the Priority field default from on the Service Call Entry/Update screen. I'm unable to find the setup screen that specifies the Priority Code to use when GP creates a new Service Call. Thanks It defaults from the debtor card if set-up. "jav" wrote: > Where does the Priority field default from on the Service Call Entry/Update > screen. I'm unable to find the setup screen that specifies the Priority Code > to use when GP creates a new Service Call. > > Thanks What is the debtor card? "Chris B" wrote: > It defaults from the de...

Header Control Issue
Hello All, How to make Header Control rectangle size to some value say 15. for me GetItemRect gives height as 22 i want to make it as 15 and then draw it on the list control. I am using Visual Studio 2005, in this the height of header control is 22 and in visual studio 6 the height was 15. how to make it a custom draw rectangle for this so that i can place a bitmap on that header control. Thanks for the help in advance.. Regards, Umesh P Maybe you could show your code. It doesn't make sense to me that going to VS 2005 would make a difference in the header of the list control and se...

Reduce character spacing in an edit or rich edit control?
Summary: I want to alter the text on screen so as to better match what is printed. I would like to use SetTextCharacterExtra on an edit or rich edit control so that the text may be squished together. Is this possible? Details: I am having a WYSIWYG problem with fonts, in particular the Courier New font. The problem is that the horizontal CPI (characters per inch) of the font is different on the screen than it is on the printer. The cause appears to be that the screen does not have as high a density of pixels as the printer. So windows tries to make the font looks nice on screen by giving it...

ANN
ANN - Your Pimp called and you owe $500. Pay up right away. Just FYI. Just FYI. JUST FYI! ...

"Your last call encountered an error"...
I've searched and read through 6 pages of posts and didn't find my question already answered. Here goes.. When the new changes went into effect, I like many other people had problems logging into billpay. I had to go through phone support and they assisted me in changing my password to billpay that I used for Money 2005. I can now log into billpay via the website and see all my account info, etc. However, when I try to go to Tools-->Internet Updates-->Update Now within Money '05, I'm able to update the general news, but my bank account and MSN billpay calls ge...

Discount Control
can i control the discounts in MS RMS 1.3 ex. cashier 1 should can do discounts but not more that 10 % ? -- Moh''''D Abdel-Hadi Exhortech Business Solutions ...

Do I need to use VBA for the following control structure?
Hi all, I have the following control structure from Matlab, do you think I need VBA to handle it, or I can just rely on Excel? Thanks a lot! ----------------------------------------- for t=1:5; CumLoss=CumLoss+sum(DefaultTime(:, t)); if (CumLoss>TotalNotional*Deattachment) break; else PV=PV+y*(TotalNotional-CumLoss)/(1+r)^t; if t==5 PV=PV+(TotalNotional-CumLoss)/(1+r)^t; end; end; end; You can just rely on Excel: In row 1 put the labels t,DefaultTime, CumLoss,PV,TotalNotional,D...

mfc activex
i used the mfc develop a activex control,and i did not add any code in it and make the activex control into the html.but when i closed the internet explore,one error was showed.Why? "chuangyl" <msnews.microsoft.com> wrote in message news:utMNIHn8GHA.4012@TK2MSFTNGP04.phx.gbl... > i used the mfc develop a activex control,and i did not add any code in it > and make the activex control into the html.but when i closed the internet > explore,one error was showed.Why? What does the error say? -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com ...

Problem bringing up Group Policy on Domain Controller
I loaded the Group Policy snap in on my xp machine and got the following error on my Server 2000 domain controller: "The following entry in the [strings] section is too long and has been truncated" error message when you try to modify or to view GPOs in Windows server 2003, Windows XP Professional or Windows 2000. This is a well-documented and there is a hot fix. After I applied the hot fix the error was gone, but I still cannot access some group policies. Why and what can I do. My boss likes to work ar the server console and he cannot do that and is furious. You need to...