|
I have a class
template<class T>
class foo()
{
template<typename T> friend ostream& operator<< (ostream& os, TestTemplateCollection<T>& r)
{...
}
int main(int argc, char * argv)
{
foo<T>;
foo<B>; //error c2995 operator<< allready defined
}
order doesn't matter both T and B work without the other is there something special you must do to friend template classes work. I do have the header in cased in a #pragma once statmen so its not in the preprocess output twice.
-- modified at 22:08 Tuesday 17th April, 2007
a programmer traped in a thugs body
|
|
|
|
|
I fixed this.
If any one wants to know
friend function of template classes should be defined outside the class definition but in the header file or you liker will crap its pants.
a programmer trapped in a thugs body
|
|
|
|
|
I have native C++ XMLTranslator (dll) built using VC8 compiler in VS2005 IDE.
This dll basically imports msxml4.dll as shown below:
#import "msxml4.dll" named_guids implementation_only
When native clients using VC6 compiler link to my XMLTranslator.lib I found below linker errors in imports:
XmltxtorTest.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class _com_ptr_t<class _com_iiid<struct="" msxml2::ixmldomdocument2,&struct="" __s_guid="" _guid_2933bf95_7b36_11d2_b20e_00c04f983e60=""> > __thiscall altova::CDoc::Load
FromString(class std::basic_string<unsigned short,struct="" std::char_traits<unsigned="" short="">,class std::allocator<unsigned short=""> > const &)" Debug/XmltxtorTest.exe : fatal error LNK1120: 2 unresolved externals
The export signature of VC8 dll:
class _com_ptr_t<class _com_iiid<struct="" msxml2::ixmldomdocument2,&struct="" __s_guid="" const="" _guid_2933bf95_7b36_11d2_b20e_00c04f983e60=""> > altova::CDoc::LoadFromString(class std::basic_string<unsigned short,struct="" std::char_traits<unsigned="" short="">,class std::allocator<unsigned short=""> > const &)
Basically the difference I found is the word "const" between imports and exports.
VC8 compiler exports additional const key word in whereas VC6 compiler doesn't expect const key word during imports.
How to make msxml exports/imports compatible across VC6 and VC8 compilers??
Thank you so much for any help in this aspect. I have been trying to get around this problem over a week.
Thanks again & Regards,
-- modified at 13:29 Tuesday 17th April, 2007
|
|
|
|
|
LIBs are not backward-compatible, since any version of the compiler/linker can change internal details that end up breaking compat with older linkers. You'll need to build a LIB yourself using VC 6.
|
|
|
|
|
Now i have lots of text files in a folder,i want to combine them into one large file,but the problem is that it is must be order the formation rule.
for instancethe txt file order)
the first text file list item"1c.txt,2c.txt,.........
the second text file list item"1e.txt,2e.txt,........
now the combine file order must be "1c.txt,1e.txt,2c.txt,2e.txt........."
and so on!
I want use STL implicat it!
Waiting for ur help!
Thx advance!
Where did the good times go?
Don't try it, just do it!
*Archibald*rever dragon!
|
|
|
|
|
Amidst of development of toolbar, a requirment came to colour toolbar.
As we can colour explorerbar easily with OnPaint, we can colour the
toolbar also,but after colouring the Toolbar buttons Vanish. Code is totally
based on ATL\ COM and not MFC.
The reason I found is NM_CUSTOMDRAW not getting called . Even if I
post the message WM_ERASEBKGND.
Can anyone tell how to overcome this problem. Even if we call
TB_INSERTBUTTON at end of OnPaint it does not prove fruitful.
-- modified at 8:38 Monday 16th April, 2007
|| ART OF LIVING ||
|
|
|
|
|
Purpose is to prevent writing sensitive data to hard drive, so after shutting down the computer, sensitive data will be lost (in RAM) THANKS A LOT FOR YOUR REPLY
marcelse
|
|
|
|
|
Hi.
Let us say, we have a banner on some site, embedded as a flash object. In my BHO I need to catch some events from this banner. I do this way:
1. Wait until the document is completed.
2. Enumerate all OBJECT elements.
3. On the needed element perform this:
Code:
<br />
CComQIPtr<IHTMLObjectElement> pObj=pElem;<br />
CComPtr<IDispatch> pD;<br />
pObj->get_object(&pD);<br />
if (pD==NULL) return;<br />
CComObject<CFlashSunk> *sink;<br />
sink=new CComObject<CFlashSunk>();<br />
<br />
CComQIPtr<IConnectionPointContainer> pCont;<br />
HRESULT hr;<br />
pCont=pD;<br />
CComPtr<IConnectionPoint> pPoint; <br />
hr = pCont->FindConnectionPoint(ShockwaveFlashObjects::DIID__IShockwaveFlashEvents, &pPoint);<br />
if (FAILED(hr)) return;<br />
DWORD dwCookie;<br />
hr = pPoint->Advise((ShockwaveFlashObjects::_IShockwaveFlashEvents *)sink, &dwCookie);<br />
if (FAILED(hr))return;<br />
4. Here the class CFlashSink:
<br />
#import "C:\\WINDOWS\\system32\\Macromed\\Flash\\Flash.ocx" named_guids <br />
<br />
#include "Debug\Flash.tlh"<br />
<br />
class ATL_NO_VTABLE CFlashSunk :<br />
public CComObjectRootEx<CComSingleThreadModel>,<br />
public CComCoClass<CFlashSunk>,<br />
public IDispatchImpl<ShockwaveFlashObjects::_IShockwaveFlashEvents, &ShockwaveFlashObjects::DIID__IShockwaveFlashEvents,&ShockwaveFlashObjects::LIBID_ShockwaveFlashObjects> <br />
{<br />
<br />
public:<br />
<br />
<br />
BEGIN_COM_MAP(CFlashSunk)<br />
COM_INTERFACE_ENTRY(IDispatch)<br />
COM_INTERFACE_ENTRY(ShockwaveFlashObjects::_IShockwaveFlashEvents) <br />
END_COM_MAP()<br />
<br />
<br />
<br />
STDMETHOD(Invoke)(DISPID, REFIID, LCID, WORD, DISPPARAMS*,VARIANT*, EXCEPINFO*, UINT*); <br />
<br />
<br />
<br />
<br />
STDMETHOD(OnReadyStateChange) (long newState); <br />
STDMETHOD(OnProgress) (long percentDone);<br />
STDMETHOD(FSCommand) (BSTR command, BSTR args);<br />
STDMETHOD(FlashCall) ( BSTR request);<br />
};<br />
Problem: neither in Invoke nor in FSCommand nothing comes at all!
Where is the trouble ?
|
|
|
|
|
HOW TO SEND AND RECEIVE SMS BY PC
I WILL BE THE FIRST
|
|
|
|
|
hi,
Can any body tell to me, how i add a checkBox in MMC snapin(Throught ATL)in result Pane.Plz help me.
thanks in advance....
Monica
|
|
|
|
|
I am using the command line to pass values. The values are numbers or "ni" for negative infinity (& pi for positive).
This is my code:
if (argv[1] == "ni")
But it fails. It never evaluates to true . Why is this? "ni" is a char array and so is argv[], is it just me or is something going on.
I tried this on Windows and Unix and the same thing happened.
Download here[^] for the full source
|
|
|
|
|
That's not how you compare C-style strings. Use strcmp() instead.
|
|
|
|
|
yes, i fixed the problem. I just converted to string.
I forgot that C-strings are just pointers, so you are actually comparing the memory locations. However, i could have sworn i had seen it written before (unless it was to specifically compare memory locations)
Customer in computer shop: "Can you copy the Internet onto this disk for me?"
|
|
|
|
|
We have built a com based application in VC5, VC6 in debug mode & works fine.
when migrated to VC++ 8.0, com register class is failing.
VC6 binary is built which atl6.0.dll and works fine. but when the application is built with atl8.0 com register class is failing.
We are using CComModule class in atl6.0. But it looks like the same class is change to CAtlComModule in atl8.0
Is there any option which will enable backward comptible in atl8.0?
Thanks
|
|
|
|
|
You need to read the documented breaking changes that have been put in effect in ATL version 7. There were very few notable changes from 7 to 8! CComModule was replaced with several different module classes: CatlModule, CatlExeModuleT, CatlDllModuleT and CatlServiceModuleT. According to "ATL Internals", Second Edition, page 811:
<quote>..., there's not much to be gained in removing your ATL 3 modules and replacing them with the ATL 8 modules when you migrate your project. ... If you need (...) to rewrite the module-related code in your ATL 3 server to match and ATL 8 server, your best bet is to run the new VS05 wizard with the names and settings you need and then move over your ATL 3 classes.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I need to convert a UTF8 string (stored in a std::string) to a UTF16 string (and store the result in a std::wstring) and vice-versa, in a portable way (so ::MultiByteToWideChar, etc. are out of the question). Anyone have any tips, pointers to samples, etc.? I am currently porting a Windows app to Linux (!) which uses the STL/Boost, and this is one area where I would appreciate some advice.
|
|
|
|
|
I am not 100% certain..but it wouldn't surprise me if ICU[^] had UTF8 <-> UTF16 converters. In fact, with a little help from Google, we find this page[^] that says:
ICU provides UTF-8↔UTF-16 transformation functions. (u_strFromUTF8() and u_strToUTF8() in unicode/ustring.h )
HTH!
|
|
|
|
|
See my signature
|
|
|
|
|
Hi.
I'm writing a small Windows CE ActiveX app using an ActiveX container class "based on a Button" (generated by the Wizard). This "CMyButton" class has a CContainedWindow member, m_ctlButton, and I am overriding the OnDraw() method to hand-draw the button with rounded corners. CMyButton also handles WM_LBUTTONUP and WM_LBUTTONDOWN to do some other special stuff. This all works fine, however....
I'm accepting input from an alternate source (a controlwheel) and want to controlwheel press handler to force a button click down to my ATL button class. Problem is, I need the actual m_ctlButton (the contained ATL button control) to receive the button click message so it does it's normal button-ish stuff and then passes WM_LBUTTONUP/DOWN up to the container. Here's where I'm stuck.
One thing I tried was to create a COM interface in CMyButton that the controlwheel handler calls. This works. Then I thought in that interface method I could just force the contained CContainedWindow member to "click". So in the CMyButton::ButtonPress interface method I've tried things like:
::SendMessage(m_ctlButton, WM_LBUTTONDOWN);
SendDlgItemMessage(controlID, WM_LBUTTONDOWN);
PostMessage(WM_LBUTTONDOWN);
Problem is, all of these just post the message to the container. It's not like the contained ATL button actually gets presses. So my question is, how can I cause the actual contained button to click? If I can do that, the normal button-ish stuff will happen, the contained button will pass WM_LBUTTONDOWN up to the CMyButton container, and everyone will be happy (me included!). Can someone give me some advice here?
Thanks,
Mark.
Mark Malin
Software Developer
GE Healthcare
|
|
|
|
|
hi all,
I have a series of JPEG file coming from a source. I have to create a MPEG file from the series of JPEG file, which can be played in Media Player. How can I do this. What algorith i have to use or else i have to use COM and ActiveX control for the same. Can u give any idea regarding this.
Thanks and Regards
Yudhisthira Attry
|
|
|
|
|
hi. I create a web form with c# asp.net but I cant locate mouse position with c#. please help me.
|
|
|
|
|
Hi All,
I need to write some Composite control in my ATL project.
My question is how i control the GUI ?
What I mean is - in MFC i define some control variable that i can control the GUI control in easy why - can i do it also in Composite control ?
Until now i use "ListView_SetColumn" or those command to change/add/find something in my list Control - but this way is not the simple way - does there is some simple way to use the control ?
I also could not do casting from the control the list view type.
Thanks for any help.
|
|
|
|
|
ListView_SetColumn is how things were done in C. I thought ATL offered some wrapper classes for UI ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can you please explain ?
How its can be done in ATL ?
I realy need help with that.
Thanks.
-- modified at 4:57 Wednesday 28th March, 2007
|
|
|
|
|
I am trying to display data from a list box and an entry field in list box. how do i do that?
|
|
|
|