|
Hello,
I have a problem compiling a project using the MinDependency option.
It gives me all kind of linke errors like these
<br />
Linking...<br />
LIBCMT.lib(crt0dat.obj) : error LNK2005: __osplatform already defined in atlmincrt.lib(atlinit.obj)<br />
LIBCMT.lib(crt0dat.obj) : warning LNK4006: __osplatform already defined in atlmincrt.lib(atlinit.obj); second definition ignored<br />
Creating library .\ReleaseMinDependency/myproj.lib and object .\ReleaseMinDependency/myproj.exp<br />
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup<br />
.\ReleaseMinDependency/myproj.dll : fatal error LNK1120: 1 unresolved externals<br />
Now, if I understand it correctly, this is because _ATL_MIN_CRT is defined.
I goto the project properties, set 'Minimize CRT usage in ATL' to No and 'Use of ATL' to Statically linked.
When I cross check with C/C++ Preprocessor I see _ATL_MIN_CRT is gone from the Inherited Values in the 'Preprocessor Definitions' property.
Now, when I compile and when the linkstep failed, I check the build.log and surprisingly I see the /D "_ATL_MIN_CRT" flag.
Did I do something wrong? Do other options (/GX) flag automatically add it to the cl.exe parameters?
Even when I check the C/C++ commandline in the project preoperties tab, it is not there.
Any clue?
Thanks
Wim
|
|
|
|
|
I'm trying to develop a WTL helper class, that does handle some extra messages, like this:
template <class BASE>
class CInplaceCtrl : public BASE
{
BEGIN_MSG_MAP(CInPlaceCtrl<BASE>)
MESSAGE_HANDLER(WM_KEYDOWN, OnInplaceEditKeydown)
MESSAGE_HANDLER(WM_KILLFOCUS, OnInPlaceEditKillfocus)
CHAIN_MSG_MAP(BASE)
END_MSG_MAP()
};
An instance is created as
CInplaceCtrl<CEdit> m_edInplace;
m_edInplace.Create( , rect, ....);
The edit is created ok, but the message map seems not to be processed at all.
What to do?
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
Try using DECLARE_WND_SUPERCLASS(_T("Your new class name"), _T("BASE class name")) and derive from CWindowImpl<CInplaceCtrl, BASE>.
That works when overriding the behaviour of system classes such as buttons, list views etc. Dunno if it works on a CWindowImpl-based class. I see no direct reasons it shouldn't though.
Also, remember that you're getting the first go at all events. If you intend to pass the event to the base class, either set the fourth argument (BOOL&) to FALSE, or call DefWindowProc() to let the base message map dispatch the event.
--
<british-accent>Pass the jam, would you?
|
|
|
|
|
Thanks!
Works seemingly perfect without the DECLARE_WND_SUPERCLASS
really necessary?
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
Ah. No I guess not. I think I've mixed some concepts up. I need to redo all this some day.
--
<british-accent>Pass the jam, would you?
|
|
|
|
|
Has anyone used this successfully? I need to do something so simple it's pathetic, but I haven't figured out HOW... Here's what I want to do:
I'd like to have a webpage that loads my dll (it's in a cab and all that)... And it's being called like this:
<object classid="clsid:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" codebase="XXXXXX.CAB">
<param name="text" value="Yo man!">
</object>
So here's the deal... All I want said application to do... Is to be able to get that text in the param tag!!! Any hints/code snippets in the right direction? I've been having a bugger of a time, and Microsoft's help pages are of NO help for a newb like me!
I know it's probably something easy, but I can't get it to work! Thanks in advance!
|
|
|
|
|
The problem is that the simple stuff doesn't work with BSTRs
In DevStudio6, If my ATL control had the interface ITestControl & the class name CTestControl , I would do the following...
* Inherit from IPersistPropertyBagImpl
* add COM_INTERFACE_ENTRY(IPersistPropertyBag) to BEGIN_COM_MAP(CTestControl)
* Add a member variable that will store the "Yo man!", maybe CComBSTR m_bsText;
* In workspace view, right click on ITestControl, and select "Add Property"
- Set the property type to BSTR,
- the name to "test",
- uncheck "Get Function"
- leave "Put Function" enabled
- Remember the "id(n)" number displayed in the implementation preview at the bottom of the dialog, you'll need that. It's the dispatch ID
* In your header file, look for BEGIN_PROP_MAP(CTestControl)
- Add the entry PROP_DATA_ENTRY("test",1,CLSID_NULL) . Observe that the number (in this case 1) is THE SAME dispatch ID for the property you just added!
* Modify the newly created "CTestControl::put_test(BSTR newVal) " to assign newVal to the local variable m_bsText .
Now when your control loads, IPersistPropertyBagImpl will call CTestControl::put_test(BSTR newVal) and store the value "Yo man!" in m_bsText
|
|
|
|
|
Wow, thanks SO much. That totally answers my question. I'll give it a try and see what happens. Thanks again, Jason!
|
|
|
|
|
Well, I gave that a try... The only thing is this...
I had to add these two parts in:
(110) BEGIN_COM_MAP(CIEBand)
(111) COM_INTERFACE_ENTRY(IPersistPropertyBag)
(112) END_COM_MAP()
(113)
(114) BEGIN_PROP_MAP(CIEBand)
(115) PROP_DATA_ENTRY("text",1,CLSID_NULL)
(116) END_PROP_MAP()
I didn't have the com or prop maps in there before...
When I went to compile, it crapped out on the PROP_DATA_ENTRY line, with the following error(s):
IEBand.h(115) : error C2059: syntax error : 'constant'
IEBand.h(115) : error C2059: syntax error : ','
IEBand.h(116) : error C2143: syntax error : missing ';' before '{'
IEBand.h(116) : error C2447: '{' : missing function header (old-style formal list?)
IEBand.h(116) : error C2059: syntax error : '}'
IEBand.h(116) : error C2059: syntax error : 'return'
IEBand.h(116) : error C2059: syntax error : '}'
YOUCH! :P Any thoughts on this?
|
|
|
|
|
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
|
|
|
|