|
What I can suggest is this. The GM_ADVANCED flag is not supported in anything below Windows 2000, so first, get your OnDraw() function to check if you're drawing to an old style metaDC. You can do this like this :
bool bMetaDC = false;
if ( GetObjectType(hdc) == OBJ_METADC )
bMetaDC = true;
Now that you know that you're rendering to an old metaDC, create another DC, do all your drawing to that and then BitBlt() to your metaDC. I don't know if it will work, but its worth a try...
-------------------------------------------
99 little bugs in the code, 99 little bugs,
Fix 1 bug, recompile....
101 little bugs in the code...
|
|
|
|
|
After doing several weeks of "practice" with ATL I've just realized that there are quite a lot of com components referenced in my registry that no longer exist.
Is it best to manually remove them, or is there some tool / feature in VS.net or elsewhere that would do this cleanly?
(I've heard about regclean utility, but rumor has it that it's a bad thing to run on Windows 2000)
|
|
|
|
|
There are 3rd-party tools for finding broken reg entries (Norton Utilities has one). It wouldn't be hard to make a program that iterates through HKCR and HKCR\CLSID, looking for EXE/DLL names (such as in the InprocServer32 keys) and seeing which ones point to binaries that don't exist.
--Mike--
Thing #9 to say when mad at work: "Therapy is expensive. Popping bubble plastic is cheap. You choose."
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Follow MSDN I modify ocidl.idl but that have not effect.
|
|
|
|
|
I am eager to know the answer since I am facing the same question.
I design a COM object, and it has a Property:
[propget, id(9), helpstring("property GDArray")] HRESULT GDArray([out, retval] float* *pVal);
I want to use it to return the address of an FLOAT array, and set the returned address to an other control.
Is there any side effect. I appreciate your answer.;)
|
|
|
|
|
Hi.
How do you define a functor that handles elements in an STL map? For example:
-----
std::map<int, char="" *=""> testMap;
char *testChar = new char[10];
_strcpy(testChar, "November");
testMap.insert(std:air<int, char="" *="">(0, testChar));
...
// Now I want to deallocate all values in testMap.
std::for_each(testMap.begin(), testMap.end(), DeleteValue());
-----
How do you define DeleteValue functor that handles elements in an STL map?
Thanks,
Kuphryn
|
|
|
|
|
The iterator returns a std::pair, does your functor take a pair ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Thanks.
No, the object does not take a pair. How do you identify with a pair object?
class DeleteValue
{
public:
void operator()(std::pair<int, char="" *=""> pairObject)
{
// How do you use the pairObject?
}
};
Kuphryn
|
|
|
|
|
pairObject->first and pairObject->second.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Nice!!! Thanks.
One last question. Is the following implementation correct with a unary function?
class DeleteValue : public std::unary_function<<std::pair<<int, char="" *="">>, void>>
{
public:
void operator()(std::pair<<int, char="" *="">> pairObject)
{
...
}
};
Kuphryn
|
|
|
|
|
Excdpt that if you have two < or >, you need a space between them, or your compiler will think they are shift operators, and in this case, only one is required in every case. I'm also not sure why the , void ?
But my son is pulling on me, so I can't look it all up now. :P
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
It's always a mess to get const ness right with functors. The correct implementation is:
class DeleteValue : public std::unary_function<std::pair<int const,char *>&, void>
{
public:
void operator()(std::pair<int const,char *>& pairObject)
{
delete [] pairObject.second;
}
};
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Off-topic question here, but why do you need unary_function as a base class? And how does the base relate to the operator() ? I thought the operator() , with the correct signature of course, was what made the class a functor.
--Mike--
Thing #9 to say when mad at work: "Therapy is expensive. Popping bubble plastic is cheap. You choose."
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Actually, unary_function is not strictly needed. It is a shortcut to get argument_type and result_type inner types defined, which can be useful when doing metaprogramming. For instance, consider the following composite operator:
template <class func1_type,class func2_type>
struct composite: public unary_function<func2_type::argument_type,func1_type::result_type>
{
composite(func1_type f1=func1_type(),func2_type=func2_type()):f1(f1),f2(f2){}
func1_type::result_type operator()(func2_type::argument_type a)
{
return f1(f2(a));
}
private:
func1_type f1;
func2_type f2;
};
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
*scratches head*
See now, this is one of those times where STL makes my head hurt.
--Mike--
Thing #9 to say when mad at work: "Therapy is expensive. Popping bubble plastic is cheap. You choose."
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Once you get used to STL, it is like speaking German --one has a lot of fun just getting the syntax right.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Sort of like stomping on an open box of needles. Once you get use to it, it is fun.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
By default, class factory create a new object for every request, this is not good when a application that should using a COM object as global var. I don't understand ATL deep, so how to modify class factory of special COM object?
|
|
|
|
|
Follow the thread of DECLARE_CLASSFACTORY_SINGLETON through the documentation.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
|
I'm looking for a good how-to book and a good reference (in-depth) book for ATL in VS.NET. (ATL 7?)
Thanks.
-Sean
----
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -- Albert Einstein.
I saw a woman wearing a sweatshirt with 'Guess' on it. I said, "Thyroid problem?" -- Emo Philips.
Love is two minutes, 52 seconds of squishing noises. -- Johnny Rotten.
|
|
|
|
|
Reasonable Developer
i wanted to download the SDK of Microsoft Project, i try my best but fail(it give overview of MS Project 2002) pls help me. So nice of u
Note
i have already test it but it was just an overview of sdk whereas i have to integrate the MS Project & therefore i need to download the complete sdk, now pls try for it & if u find any solution inform me
So nice of u OK
|
|
|
|
|
Please do not cross post.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|