?
Solved

Can I use ActiveX to embed my C++ application into a web page?

Posted on 2005-04-06
5
Medium Priority
?
152 Views
Last Modified: 2010-04-24
Hello all,

I've had some experience with C++ in the past, but unfortunately almost no experience at all with VC++ .NET, which is what I've got to use for a project I've been handed.

Currently, the application pops up as a windows dialog box to perform a number of functions. One request for this project was to embed that application into a web page if possible. Now, the only way I think that could be possible is using ActiveX (which I haven't really worked with either).

My question is...can I have a windows-style dialog box within a web page via ActiveX? And most importantly, can I do it within VC++ .NET?

Any suggestions and/or examples would be much appreciated, I'm trying to get this ported over asap if possible, and I need some crash-coursing fast.

Many thanks.
0
Comment
Question by:Inward_Spiral
  • 3
4 Comments
 
LVL 9

Accepted Solution

by:
rcarlan earned 2000 total points
ID: 13722143
Well, it's not as simple as that.

First of all, if you have access to the source code for the application, and depending what technologies it uses, it can be modified to be hosted in an ActiveX. This may be more or less difficult, depending on the technologies, but more often than not it is not an easy task.

Secondly, if you're happy with the ActiveX to display a Windows dialog box, that's fine. If you want the dialog box itself to be embedded in the web page, you have to convert it to something like a form - again, it depends how the dialog was implemented in the first place.

Is the application a .NET app, an MFC app, or what?
Finally, you may have security issues if the app accesses local system resources (e.g. Registry, files, etc). You may also have security issues if the app talks to COM components. When you’re hosting the ActiveX on a web page, it will run in the security context of the browser (e.g. Internet Explorer). You will not be able to alter the COM/OLE security settings from the DLL.

Radu

0
 

Author Comment

by:Inward_Spiral
ID: 13783945
Sorry for the late reply, Radu.

I was pretty sure it wouldn't be all that easy, but I had to ask. The application is really VC++ 6.0 source that I "upgraded" into a .NET application.
I know there would definitely be security issues to face...I'm not a fan of ActiveX by any stretch, but I've got to be able to access certain dlls from IE.

0
 

Author Comment

by:Inward_Spiral
ID: 13784112
Update: I'm currently trying to implement it by creating the project as a .NET "Windows Control Library".  
That way, I can implement it as a UserControl (System::Windows::Forms::UserControl), and reference the compiled dll via a web page:
 
                         <html>
                             <body>
            <OBJECT id="myID" height="275" width="425" classid="http:bin/Debug/CPlusApp.dll#CPlusApp.UserControl1"
                  VIEWASTEXT>
            </OBJECT>
                             </body>
                         </html>

I don't think this is ActiveX per se, but I think this could serve the purpose if I can get it it run. Unfortunately, I haven't been able to get that to initialize properly yet. I can this to work fine if I'm working from C#, but something's different when I try this in VC++.

If I'm trying to reference my C++ dll via a web page, do I need to specifically initialize something to get a UserControl to run from IE?
0
 

Author Comment

by:Inward_Spiral
ID: 13977693
Thanks for posting this, TheLearnedOne.

I still haven't found a way to do what I want in ActiveX, so right now I'm researching ways to emulate a workaround thru Java.
No clear-cut solution yet.

I'm awarding Radu the points, he brought up some points that steered me in my current direction.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 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