|
Hehe, it's here[^]
We all love crossposts, don't we?
|
|
|
|
|
Well, at least it's on topic in both.....
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
|
|
|
|
|
Sorry ,never again.
Scratch
|
|
|
|
|
I guess you have to import somehow the IXMLDomNode definition into your IDL definition. This is more clear than just passing the IDispatch or IUnknown pointers (more typecontrol, passing IUnknown is similar to using void* pointers in the C/C++).
You can probably achieve this by adding the following line to the beginning of idl:
import "msxml.idl";
or something similar
|
|
|
|
|
Hi,
I've written a simple ActiveX control using ATL 3.0 ... and everything works fine... until I want to print the document that is hosting my control. In this case, its Excel. Everything on the excel sheet prints EXCEPT my activeX control. What am I missing here? Any ideas? I've tried searching online, in MSDN, etc etc... nothing.
Any help would be greatly appreciated...
Thanx
-------------------------------------------
99 little bugs in the code, 99 little bugs,
Fix 1 bug, recompile....
101 little bugs in the code...
|
|
|
|
|
I have meet the same problem, and I am working on it.
Here, I want to introduce my idea.
In the OnDraw(ATL_DRAWINFO& di) proceed, the default di give the HDC of the CRT. So, we should change it to the print device HDC.
I still have no answer on it yet.
|
|
|
|
|
Ok... heres to solution to getting your ATL components to print from within Office Applications. It seems as if Office Applications still use the old 16bit Metafile format when printing. This is a problem because it limits you to using only the GDI functions that are supported by the old Metafile DC.
For a list of functions that you CAN use, see this Microsoft document.
I've rewritten all my drawing code to support these functions and my control is printing fine Should work for yours aswell.
Thanx to Microsoft for documenting this little issue so nicely *sarcasm* :P
Cheers,
Peter
-------------------------------------------
99 little bugs in the code, 99 little bugs,
Fix 1 bug, recompile....
101 little bugs in the code...
|
|
|
|
|
Help! I have use the function
SetGraphicsMode(hDC,GM_ADVANCED)
and I must use it! What could I do?
I make a defalut ATL peoject, and the draw item just is a Textout(), and I print it in document of word. But, failed, the text "ATL 3.0:xxx" is much larger than it on the display CRT.Will you please sent me your Ondraw() code, I want to have an experiment.
Thank you
|
|
|
|
|
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.
|
|
|
|
|