[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Finding the path to the page that is calling my ATL ActiveX Control

Posted on 2006-06-12
3
Medium Priority
?
379 Views
Last Modified: 2010-04-01
How do I find the URL to the file that is calling my ActiveX control.  I want to have <param>'s similar to flash which specify a file to download but I don't want the user to have to specify a full URL.

<object>
   <param name="swf" value="myflash.swf">
</object>

and then in my ActiveX control I initiate a download at:
http://www.example.com/sub/dir/myflash.swf
0
Comment
Question by:GENTP
[X]
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
3 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 16887498
If you're hosting at the same domain, you can use a path relative to the root, e.g.

<object>
   <param name="swf" value="/sub/dir/myflash.swf">
</object>
0
 
LVL 5

Author Comment

by:GENTP
ID: 16887562
I am, but I'm looking to find the path, server, and port info inside of the control.
0
 
LVL 2

Accepted Solution

by:
MechanTOurS earned 2000 total points
ID: 16888114
LPSTR getBase()
{
   USES_CONVERSION; // for OLE2A

   LPMONIKER clientMoniker = NULL;
   
   if ( S_OK == m_spClientSite->GetMoniker(OLEGETMONIKER_ONLYIFTHERE,OLEWHICHMK_CONTAINER,&pClientMoniker) )
   {
      LPOLESTR oleClientBaseUrl = NULL;
      IBindCtx *pBindContext = NULL;
     
      if (CreateBindCtx( 0, &pBindContext ) == S_OK )
      {
         // resolve the path
         pClientMoniker->GetDisplayName( pBindContext, NULL, &oleClientBaseUrl );
         
         // convert it to LPSTR
         LPSTR clientBaseUrl = OLE2A(oleClientBaseUrl );
         
         // do whatever u want with it.
         // ......
         
         return clientBaseUrl;
      }
   }
}
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 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.

649 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