|
Your operator is missing some stuff that should be there - check out my article for info:
http://www.codeproject.com/vcpp/stl/iostreaminserters.asp[^]
To be honest, it's long enough since I did this sort of thing that I don't know if any of that will help, but it will improve your implimentation anyhow.
Don't forget that std::endl sends an endline AND flushes the stream. I don't know if this could cause your problem, but it's something that is often overlooked.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Many thanks - excellent article as well. Some cut'n'pasting here I reckon to improve my implementation - thanks again!
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Note what the error message says about endl : cannot use function template 'class std::basic_ostream<_Elem,_Traits> &__cdecl std::endl(class std::basic_ostream<_Elem,_Traits> &)'
You're trying to pass a template to the function, not an instantiation of a template , which is not legal because a template all by itself isn't anything, it's just... well, a template.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
How did I not see that ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I am busy with developing an ActiveXControl for analysis of data from a Database.
One option shall be the visualization of data as a chart. Therefor I would like to use e.g. the ActiveX-ChartControl from MS (the MSChart Control).
How can I create during runtime an ActiveX Control like MSChart in an ActiveX Control?
Thanks,
Thomas
|
|
|
|
|
Hello,
I created an ActiveX (DLL file) with VC++ & ATL. Il works perfectly, but when I install it via a webpage, it appears that according to IE, this ActiveX has a "damaged" status.
I don't know exactly what "damaged" means, as the ActiveX runs perfectly, and that it has been numerically signed with a Verisign certificate.
Can somebody tell me what does "damaged" status mean, and what should I do to make this ActiveX have a normal status within Internet Explorer ?
Thank you.
|
|
|
|
|
one CDateSource instance ,can it use in multithread ?
if it can't ,how to resolve?
|
|
|
|
|
Hi
I am developing web service as well as a Winform client for transferring some data.
I just wand to know some of the exceptions during the transactions say for example
1. If web service as well as client is running in the same machine, if the IIS is not running means which exceptions will be thrown in the client side
2. If an error (say access violation or any other error) happened in the web service which exception will be thrown from the web service and how to catch in the client program
3.If the web service is running in the remote machine if the cline is unable to find the web service which exception will be thrown
4. If the web service is running in the remote machine and there is no network connection between the web service and the client , how it is possible to detect from the client side.
5.Each and every exception at run time is important for me for the cases like above.
Could any one provide some information or code sample regarding the same?
|
|
|
|
|
Hi,
I need to have a dipath message mapppin. In MFC there is BEGIN_DIPATCH_MAP whereas my program is in wtl how can i use the macro in it. Pls provide a solution or an alternate.
Regards
saravanan
|
|
|
|
|
Hi,
I need to convert the mfc code to atl for connecting to the windows shell. Please provide me some ideas or sample coding regarding this. I've enclosed the MFC coding below.
LPCONNECTIONPOINTCONTAINER pContainer;
LPCONNECTIONPOINT pXConnection = NULL;
DWORD dwCookie = 0;
CoInitialize(NULL);
if(m_pInterface == 0)
{
if(m_pInterface.CreateInstance(__uuidof(SHDocVw::ShellWindows)) == S_OK)
{
if ((m_pInterface != NULL) && SUCCEEDED(m_pInterface->QueryInterface (IID_IConnectionPointContainer,(LPVOID*)&pContainer)))
{
if (SUCCEEDED( pContainer->FindConnectionPoint (__uuidof(SHDocVw::DShellWindowsEvents, &pXConnection)))
{
ASSERT(pXConnection != NULL);
pXConnection->Advise( GetIDispatch(FALSE), &dwCookie);
pXConnection->Release();
}
pContainer->Release();
}
}
}
Regards
saravanan
|
|
|
|
|
Is there any ATL template/ wizard to implement a Outgoing IDispatch Interface at the client side.
If not how should it be implemented in the client side.
Preetham Raghunanda
|
|
|
|
|
I write a nt service, it need connect to database to update data.
I use CDataSource|CSession|CDynamicAccesor to implement it, it can't work, in other program, it just works fine. I can't know how to resolve it!
I can run the service.exe on CMD, it works, but from MMC to start the service, it can't work. return "Unknown error", why???
big is big...
|
|
|
|
|
what are you talking about ?
what database do you use ?
what error is returned ? any description ?
how do you proceed ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Probably you cannot authenticate on database server. Possibly you set SSPI authentication and when you start your service manually it use your account in your domain (and you have access to the database). When you start as service, it has LOCAL SYSTEM account and cannot login to database server.
|
|
|
|
|
Can u give me code for putting Icon(Bitmap Images) which is in a file,pasting on the toolbar button of Outlook
|
|
|
|
|
Hi,
I'm using the ATL OLEDB classes and I get the following error:
"Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
when I query the database with a query that uses the "DISTINCT" keyword. Here is a sample of my code.
<br />
HRESULT hr;<br />
CDataSource ds;<br />
CSession session;<br />
CCommand<CDynamicAccessor, CRowset, CMultipleResults> m_Accessor;<br />
<br />
<br />
CComBSTR bstrUser(strUserId);<br />
CComBSTR bstrPassword(strPasswd);<br />
CComBSTR bstrServer(strSvrName);<br />
CComBSTR bstrDatabase(strDbName);<br />
<br />
CDBPropSet dbinit(DBPROPSET_DBINIT);<br />
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, bstrPassword);<br />
dbinit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false);<br />
dbinit.AddProperty(DBPROP_AUTH_USERID, bstrUser);<br />
dbinit.AddProperty(DBPROP_INIT_CATALOG, bstrDatabase);<br />
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, bstrServer);<br />
<br />
hr = ds.Open(_T("SQLOLEDB"), &dbinit);<br />
<br />
if ( SUCCEEDED(hr) )<br />
{<br />
hr = session.Open(ds);<br />
}<br />
else<br />
{<br />
session.Close();<br />
ds.Close();<br />
exit(1);<br />
}<br />
<br />
CDBPropSet propset(DBPROPSET_ROWSET);<br />
propset.AddProperty(DBPROP_IRowsetChange, true);<br />
propset.AddProperty(DBPROP_IRowsetScroll, true);<br />
propset.AddProperty(DBPROP_CANFETCHBACKWARDS, true);<br />
propset.AddProperty(DBPROP_UPDATABILITY, <br />
DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE );<br />
<br />
char Query[] = "select distinct dl_num from deal"<br />
LONG lRowsAffected = 0;<br />
<br />
hr = myAccessor.Open(m_session, Query, &propset, lRowsAffected);<br />
If I remove the DISTINCT keyword, the query works fine
Are there some things I need to set for the DISTINCT and GROUP BY keywords to work? We are using SQL Server 2000. Thanks for your help.
|
|
|
|
|
I am new to WTL/ATL, and I am trying to make a popup style window like MSN Messenger has. I have a class that has CWindowImpl as it's base. When I try to create the window, the error I get is: The system cannot find the file specified.
In my .h file, I have:
DECLARE_WND_CLASS("CInfoPopup")
and then to create the object, I have
this->mParent = theParent;<br />
HWND hwndMain;<br />
<br />
HINSTANCE hInstance = _AtlBaseModule.GetResourceInstance();<br />
WNDCLASSEX wcx;<br />
<br />
ZeroMemory(&wcx,sizeof(WNDCLASSEX));<br />
wcx.cbSize = sizeof(WNDCLASSEX);<br />
wcx.style = CS_HREDRAW|CS_VREDRAW | CS_DBLCLKS;<br />
wcx.lpfnWndProc = ::DefWindowProc;<br />
wcx.cbClsExtra = 0;<br />
wcx.cbWndExtra = 0;<br />
wcx.hInstance = hInstance;<br />
wcx.hIcon = NULL;<br />
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);<br />
wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW);<br />
wcx.lpszMenuName = NULL;<br />
wcx.lpszClassName = "CInfoPopup";<br />
wcx.hIconSm = NULL;<br />
<br />
if (!RegisterClassEx(&wcx))<br />
return 0;<br />
<br />
hwndMain = CreateWindowEx(WS_EX_NOPARENTNOTIFY | WS_EX_TOPMOST, "CInfoPopup", "", WS_POPUP, 0, 0, 0, 0, this->mParent->m_hWnd, NULL, hInstance, NULL);<br />
I have also tried registering the class, and then
CWindowImpl<CInfoPopup>::Create(this->mParent->m_hWnd, rect, "", CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS, WS_EX_NOPARENTNOTIFY | WS_EX_TOPMOST, 0U, NULL);
When I do that, I get: The specified module could not be found.
Any help would be appreciated!
|
|
|
|
|
Don't call RegisterClass() yourself, ATL does that the first time you create a window using that C++ class - look at the code behind DECLARE_WND_CLASS and you'll see it.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Thanks for the reply. Unfortunately I am still having problems. If I use
CreateWindowEx(WS_EX_NOPARENTNOTIFY | WS_EX_TOPMOST, "CInfoPopup", NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, hInstance, NULL);
I get "Cannot find window class".
If I use
CWindowImpl<CInfoPopup>::Create(this->mParent->m_hWnd, rect, "CInfoPopup", WS_POPUP, WS_EX_NOPARENTNOTIFY | WS_EX_TOPMOST, 0U, NULL);
I get "The system cannot find the file specified".
Which call should I use, and do you have any idea why I am getting those errors? Thanks!
|
|
|
|
|
Use the CWindowImpl window traits parameter to set the default styles:
typedef CWindowTraits<WS_POPUP, WS_EX_NOPARENTNOTIFY|WS_EX_TOPMOST> InfoPopupTraits;
class CInfoPopup : public CWindowImpl<CInfoPopup, CWindow, InfoPopupTraits>, ...
{ ... }; Then create a window using CInfoPopup which makes ATL register the window class:
CInfoPopup wnd;
wnd.Create ( mParent->m_hWnd, rect );
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
I did exactly what you said and I get the error "The system cannot find the file specified." Is there something wrong with my class? I am trying to convert "Taskbar Notification dialog" By John O'Byrne (http://www.codeproject.com/dialog/TaskbarNotifier.asp)from MFC to WTL. Thank you so much for your help. Sorry for being such a dope.
|
|
|
|
|
|
Would this error have something to do with the fact that this class is being used in a deskband dll, and this class needs to be registered?
|
|
|
|
|
hi
I have created the outlook addins with ATL/COM I am havung problem in adding the custom icons to the cusom outlook toolbars which are created. or can we put the custom icons to menubar items.
cheers
jhon
|
|
|
|
|
I've made a dll,and i wanted to call a function which has a parameter that is a data structure which was defined by me.It can't be compile!
Q:Why i could not call the function from a dll?
Any help would be greatly appreciated!
|
|
|
|
|