|
bool operator () (const std::pair<T1,T2>::first_type& k, std::pair<T1,T2>& rhs) const Maybe you're missing a const here.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
this was just a problem of typing it into this strange window and changing the code, so it looks good in html.. the code i've tried out, had this const..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
If you care to send me (here or by email) more code or even a compilable test I can have a look at it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for your kind offer!
I've sent you an E-Mail with a small testprogram already.
Thanks in advance,
Bernhard
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
In my activex control, I use a message box to give warning information when user is editting the data. but sometimes the messagebox failes to show,
Thank you!
|
|
|
|
|
Hi,
This might sound like an impossible task, but I am attempting it anyway.
I have a project in VC 7 which uses some of the ATL functions that come with VC 7.
I require to compile this project in VC6.
As far as i know, there should be no technical limitations in doing this.
I am currently copying the ATL files which I am dependent on to my project and attempting to compile that on VC 6.
Unfortunately I am getting compile errors, so I was wondering if anyone has any advice.
Maybe they have done this before, or maybe they have done something similar and would like to share some experiences.
Thanks in advance,
Jeremy.
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
You shouldn't assume that there won't be technical issues; VC7 is a different compiler, and is stricter but more compliant. It is likely that the ATL headers might use new features.
What are the features in 7 that you need, and why must you use VC6?
Steve S
|
|
|
|
|
Had similar problems trying to 'port' ATL7 AtlMime classes to VC6. still lokking for a solution.
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - Writing Word addins
Office addin
|
|
|
|
|
hi,
i got the handle of an activex control window, which is in some other application, i want to call the method exposed by the activex control for that i need IUnknown pointer, how can i retrieve it or is there any other way i call the method of an activex in some other application, i have only the handle of activex control.i have the ocx file for that control.
regards
abhay
|
|
|
|
|
I have little confusion that i wanted to clear out. Please see the following code:
//defination
SetMstrRS(IMstrRS * pMS);
CComPtr <IMstrRS> pMS;
pMS.CoCreateInstance(...);
SetMstrRS(pMS);
Now in the last statment is AddRef called by SmartPointer before it is passed to the method.
thanks in advance
qur
|
|
|
|
|
|
Hi!,
Does anybody know how to create dialog bars in WTL? I am looking for a class similar to CDialogBar in MFC.
Thanks in advance.
|
|
|
|
|
|
Hi
I wanted to deploy the CPrintPreviewWnd from the WTL in a MFC project, but got compiling errors due to wrong usage of the CPaintDC class in the WTL headers. The problem boils down to the fact, that a typedef'd class in a namespace does not honor the namespace. The following code is a demonstration of the problem. Compilation will fail with the following error
error C2664: 'f' : cannot convert parameter 1 from 'char [6]' to 'int'
class CPaintDC
{
public:
void f (int i) {};
};
namespace WTL
{
template <bool b>
class CDCT
{
public:
void f (char* i) {};
};
typedef CDCT<true> CDC;
class CPaintDC : public CDC
{
};
class Test
{
public:
Test ()
{
CPaintDC dc;
dc.f ("world");
}
};
};
What you can see from the code is, that the class CPaintDC is once declared in the global namespace (from MFC) and once in the WTL namespace. Both declarations of the class have a different signature for the function f (in the global namespace one int parameter, in the WTL namespace one char*). Then the CPaintDC is used in a new class, again in the namespace WTL. I expected the WTL::CPaintDC class to be used in this context, but I the compiling error tells me that the global class was used.
Changing the local Variable to be of type WTL::CPaintDC doesn't help, since the problem is in the declaration of the class CPaintDC in the namespace WTL. Here the base class for the CPaintDC is taken from the global namespace, even if there is an appropriate type definition just infront the class.
changing the declaration to read
> class CPaintDC : public WTL::CDC
or
> class CPaintDC : public CDCT<true>
everything is ok.
If there isn't any global class of the same name, as within the namespace, the namespace part of the code above will compile correctly.
Is this a documented bug in the compiler, or did I miss something? I'm using the VisualStudio 6.0 with SP5.
Any ideas?
Dirk
|
|
|
|
|
I do not believe WTL and MFC are made to coexist. WTL is kind of an addon to ATL that gives you some of the fucntionality that you miss from MFC.
John
|
|
|
|
|
I wanted to use only the PrintPreview Feature from the WTL. I think this can also be easily rewritten in MFC. But it was available for a fast test. After I rewrote the problematic line to read:
class CPrintDC : public WTL::CDC
{
}
I could compile my project and everything is running fine.
I was more astonished, that the lookup for typedef is first done in the global namespace and then in the local namespace. I think this is more a question concerning the compiler.
Thanks
Dirk
|
|
|
|
|
Thanks for the info.
John
|
|
|
|
|
Well.. i have got a db - query (in a vector). There is one field, which contains an integer. Now i should find out all the unique numbers and get some kind of index. (based on sorting the unique numbers).
Is it good programming style to do this by using a map (unique number -> index) or is it good if i use a sorted vector and get the index by using distance (begin(), iterator).
any recommandations ?
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Bernhard wrote:
Is it good programming style to do this by using a map (unique number -> index)
That doesn't strike me as a style question, more of a "is a map the right tool for the job?" question. I'd say yes, Perl guys do this all the time with hashes. And I just did it myself a couple weeks ago - I have a big list of artist/album names and needed to populate a tree that shows all the names that are present. A map worked perfectly for making a list of unique names.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|
|
well.. i think of a vector as some kind of dynamical array. and so it would be no problem, using the distance method. altough this way of doing it leaves a bad taste in my mouth (even after brushing my teeth this morning )
and i have got the feeling, that it might be faster for a big count of items. (which this query doesn't really have)
.. i just wanted to hear any / some opinions on this topic ..
(backing me that a map is a little bit of an overkill.. but maybe the better choice)
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Hi there,
my requirement is such that i have to have a singleton based exe or dll server. Dll is better choice.
Now when i use the DECLARE_CLASSFACTORY_SINGLETON macro on exe local server no problem happens and i have a singleton allright.
I have done debugging on that and the same object is returned using
CoCreateInstance
now i want to use an inproc server and i want it to be singleton as you know the requirement are but when i debug it there are seperate object formed for each client instance attaching.
and it doesn't care about the macro.
I know that for every process mapping of a dll is done but i want some mechanism of COM which let me have a single instance dll inproc server.
I need a solution to this problem otherwise i have to stick to expensive marshalling.
|
|
|
|
|
Probably, lifetime of the object 1, you created, is not intersecting with lifetime of object 2. Then last reference to COM object released, library were unloaded. Next time Your singleton created againe.
If You still want to use dll and make them really singleton, You should have at least one loaded instance.
But also You can store state of the object on disk, using IPersist* interfaces.
Regards,
Alexander Fedorenko,
Author of DevPlanner - tool for effective planning in development.
mailto:sashaf@arshin.com
|
|
|
|
|
Hi,
this not an answer to your problem, but i'd
like you the read ATL Creators which is very important for singleton objects.
Furthermore, read "Alternative Implementation of ATL Singleton" in MSDN (Q201321).
|
|
|
|
|
Hi,
Using a DLL for the same process you will get the same instance, but for different processes ( exe's), I'm afraid there's no way to do that, the DLL is attached to a process, no way to change that, I tried to make the same thing as you... and smashed on the wall , EXE is slow and bad, but the only way to get a real real singleton on different processes.
Good Luck
Braulio
|
|
|
|
|
Wrong answer!!! It is possible with dlls. Read articles in MSDN about dll nature.
Regards,
Alexander Fedorenko,
Author of DevPlanner - tool for effective planning in development.
|
|
|
|