|
Whoops!
PROP_ENTRY("test", 1, CLSID_NULL)
Did I mention that individual milage may vary?
|
|
|
|
|
Heheheh. Yeah, figured that out JUST a second ago. :P Thanks a ton, buddy.
|
|
|
|
|
Hi
I’ve got an ATL control (ActiveX) which currently exposes a property page that is used to manipulate all the properties in the control (This property page is launched in the usual manner by the user activating the ‘Custom Properties’ item in the container).
However, instead of displaying a property page to manipulate my control, I need to execute an arbitrary piece of code that displays a custom built editor dialog. My problem is that I cannot find out how to execute an arbitrary piece of code in response to the user clicking the “(custom)”
button on the control container’s property pane (or a similarly easy method of the user activating the editor).
One approach that I have considered is to create and show the dialog from the property page’s InitDialog handler, then destroy the property sheet after the custom dialog has exited (The problem here is knowing how to close the entire property sheet and not just the page) - I'm sure there must be other approaches to this problem though.
Thanks
|
|
|
|
|
I want to call a atl component from vbscript dynamically how can i do it please explain it briefly or give me some articles links
ThanX in advance
Inam
|
|
|
|
|
Your ATL component must expose a dispinterface or dual interface.
--
C'est normal!
|
|
|
|
|
How do you Sign an ActiveX Control?
Where Can i get the Certificate required?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
The first thing you'll need is an Authenticode Code Signing Certificate. I bought mine from Thawte - I think it runs 160 USD for two years.
You'll have to jump through some hoops. You need to supply the cert vendor with your business and web domain info to verify your identity.
|
|
|
|
|
|
I have an ATL ActiveX DLL control & in Internet Explorer, on an XP system with themes enabled - any dialogs that my control displays do not have any themes active!
I've themed my EXE projects before with no issues. (manifest resource type=24 id=1, InitCommonControls, comctl32.lib, ect..).
But for some reason when I apply the same modifications to my DLL - it doesn't work.
The dialogs that I display from the control have a themed non-client area (the caption & 'x' close button), but the dialog client controls are not themed.
I attempted to use the theme library (uxtheme.dll) to force the themeing of the dialog & its child controls, but that failed horribly (probably from a lack of understanding the theme lib), the best(???) I was able to accomplish is the removing of the theme from the non-client area.
Does any one know why my control's dialog doesn't show up as being themed in IE??
Thanks
|
|
|
|
|
|
I think I'm missing something else. I tried resource id's 1-16 for my manifest file & it still didn't work
So as a sanity check I created to following quick ActiveX project in DevStudio6SP5
* File>New>Projects>ATL COM AppWizard
* DLL Project, nothing checked, finish
* Insert>New ATL Object,Category "Controls", Full Control
* ATL Object Wizard Properties > ShortName = TestBob, left everything else as default
* Add a WM_LBUTTONDBLCLK handler that displays a simple MessageBox
OR if you're lazy & don't want to double click all the time...
* Add a Button control to the window in your WM_CREATE handler (be sure to enable m_bWindowOnly)
* Added a manifest resource, type 24, id=2
* Added ComCtl32.lib to the linker
* In the constructor, added AtlInitCommonControls(ICC_WIN95_CLASSES|ICC_DATE_CLASSES|ICC_USEREX_CLASSES|ICC_COOL_CLASSES|ICC_INTERNET_CLASSES|ICC_PAGESCROLLER_CLASS|ICC_NATIVEFNTCTL_CLASS); Wanted to make sure I wasn't missing anything
Unfortunatly the buttons are still not themed.
I even added 511 manifests to the project, numbered 1-512. Sort of a buckshot approch. Still no luck.
Is there some obsure interface I need to implement?
FYI: CPLs (Control Panel Applets) should have a manifest resource of 123
|
|
|
|
|
|
Wow, thanks Michael - that did the trick!
I removed my ComCtl32.lib linker entry & the call to InitCommonControls & it still worked!
So for future users that are having similar issues, All I needed for my ActiveX control was..
* A valid manifest resource type=24 with an ID=2
* #define ISOLATION_AWARE_ENABLED 1 in stdafx.h before all other #includes
(I think that this is the article[^] you ment)
Now I just want to know what the heck all this isolation stuff is & why it added 4k to the size of my DLL I'll google for it later.
|
|
|
|
|
(This is the correct version, with < >) )
Hi,
Consider the following template
template<typename T>
class X
{
//...
};
Now, I would like to put pointers to the different instantiations of the above template for ex
X<int>* xi;
X<double> *xd;
in a single stl container, let's say a vector. Can I do it in an elegant way ?
(Well, actually I can, using a vector<void*>. But after that how do I get back my objects ?)
Thank you,
Andras
|
|
|
|
|
This can be handled in a number of ways that depend on what you want to do with these objects later. Probably the most obvious solution is to write an abstract class from which all X instantiations derive from, and use this as the type of the pointers stored in te container:
class X_base
{
virtual foo()=0;
...
}
template <class T>
class X: public X_base
{
...
};
vector<X_base*> X_vector; Is this suitable for you?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yes, making an abstract base class solves my problem.
But I'm curiuos what other solutions might exist.
Andras
|
|
|
|
|
Hello Joo,
I think Joaquin's solution is really cool. But I think we may have missed your earlier concern : how to obtain the actual derived class object contained within the vector.
If we used a vector of pointers to X_base objects, we will obtain only pointers to X_base objects when we iterate through the vector.
We need to be able to determine at runtime the following information :
1. What is the X_base-derived-template-class of each vector item.
2. What is the type that is actually used to instantiate the X_base-derived template class (in your earlier example, this is actually 'int' or 'double').
Inspired by Joaquin, I went on to refine his example source codes and produced the following :
#include <vector>
#include <iostream>
#include <typeinfo.h>
using namespace std;
class X_base
{
public :
X_base()
{
}
virtual operator const type_info&() = 0;
};
template <class T>
class X: public X_base
{
public :
typedef T MyType;
X(MyType t) :
m_t(t),
m_ti(typeid(t))
{
}
virtual operator const type_info&()
{
return m_ti;
}
MyType& GetValue()
{
return m_t;
}
protected :
MyType m_t;
const type_info& m_ti;
};
typedef X<int> X_int;
typedef X<double> X_double;
typedef std::vector<X_base*> X_base_vector;
int _tmain(int argc, _TCHAR* argv[])
{
X_int* pxi = new X_int(5);
X_double* pxd = new X_double(0.85);
X_base_vector x_base_vector;
X_base_vector::iterator theIterator;
const type_info& ti_int = typeid(int);
const type_info& ti_double = typeid(double);
int i = 0;
cout << ti_int.name() << endl;
cout << ti_double.name() << endl;
x_base_vector.push_back(pxi);
x_base_vector.push_back(pxd);
for (theIterator = x_base_vector.begin(); theIterator != x_base_vector.end(); theIterator++)
{
X_base* px = *theIterator;
if (ti_int == (const type_info&)(*px))
{
X_int* pxi = dynamic_cast<X_int*>(px);
cout << "px == X<int>" << endl;
cout << "Value : " << pxi -> GetValue() << endl;
}
if (ti_double == (const type_info&)(*px))
{
X_double* pxd = dynamic_cast<X_double*>(px);
cout << "px == X<double>" << endl;
cout << "Value : " << pxd -> GetValue() << endl;
}
cout << ((const type_info&)(*px)).name() << endl;
}
return 0;
}
Essentially, I used Run-Time-Type-Information (RTTI) to help determine the class (X_base-derived) of each vector item as well as to determine the type that is actually used to instantiate the X_base-derived template class.
Hope the above code will be helpful to you and Joaquin.
Thanks,
Bio.
|
|
|
|
|
You could also use the boost::any as container item type. Please see http://www.boost.org/doc/html/any.html[^] for more information.
If you think this is something you would like to use, then you do not need to download the entire boost source code. You can download any.hpp and use it. No link libraries required.
--
Seraphim Shock. Gold for your ears.
|
|
|
|
|
Hi,
Consider the following template
template<typename t="">
class X
{
//...
};
Now, I would like to put pointers to the different instantiations of the above template for ex
X<int>* xi;
X<double> *xd;
in a single stl container, let's say a vector. Can I do it in an elegant way ?
(Well, actually I can, using a vector<void*>. But after that how do I get back my objects ?)
Thank you,
Andras
|
|
|
|
|
Hello everyone
How to load a MFC dll to a WTL project? If having some sample, could you send me by email?
Thank you .
-Freehawk
|
|
|
|
|
If it's an MFC extension DLL, you can't. An extension DLL can only be used by an MFC app. (You could add MFC support to the WTL app, though).
If it's an MFC regular DLL, there's nothing special you have to do to use it.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0.1! | RightClick-Encrypt
"Just because the box has 2 gigabytes of memory doesn't mean you get to use it all!"
-- Rico Mariani, CLR perf guy
|
|
|
|
|
Hello.
Could you teach me the details about "add MFC support to the WTL app"?
Thank you.
-Freehawk
|
|
|
|
|
It'd be easier if you made a dummy ATL project with the appwizard, and check the "support MFC" checkbox so you can see where the CWinApp object is created & initialized.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0.1! | RightClick-Encrypt
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Hello
Thank you for the reply.
Now I am using WTL7.1, and I cannot find "check the "support MFC" checkbox ".
how to do?
-Freehawk
|
|
|
|
|