|
I set the font to Tahoma in resource editor and the problem dissapeared
Thanks guys!
|
|
|
|
|
Hi,
i am facing some problem while working with streams in my C++ program using STL
main(){
..
..
char buf[256];
stringstream infLine(buf);
infline<
|
|
|
|
|
Hi. First of all, the line
infline<<string1<<string2<<infline; is a little suspicious. You sure you want to insert infline into itself? Won't you mean the following?
infline<<string1<<string2<<endl; Now with the rest. I guess (only guess since you provide little info) you are trying to postprocess the results inspecting buf , but this is not how stringstream works. When constructing infline , the contents of buf are copied to its internal buffer, so infline won't use buf anymore. If you want to postprocess what's left inside of infline , use the str() member function:
stringstream infline;
infline<<string1<<string2<<endl;
string result=infline.str(); Does this help?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
yeah..it did helped..
Thansk a lot
|
|
|
|
|
I am trying to develop an NT Service, novice in the field and running into following problems.
Let me simplify all the steps to explain problem i am facing, please let me know if i am doing anything wrong
I create a NT Service using Visual Studio 6 ATL Com wizard without a single line of my own code added here. Only thing i change is remove command from Project/Settings/Custom Build that re-registers the service. After that I compile the project. Let say name of the service is MyService. I use following commands to register and unregister service.
MyService -Service
.. start and stop the service
MyService -Unregserver
after this unregserver command this service goes in "Diabled" mode as shown in SCM and now if i want to re-register the service i can "Service cannot be deleted" message box. To only way to register the service again is to logoff the box.
Since I haven't added any of my code in this test project, there shouldn't be case of any dangling handle.
Any ideas?
|
|
|
|
|
hi,
yes, after we delete an NT service the SCM behaves this way. it is true for services created as console app also - not only for ATL NT services. Otherwise one thing we can do is:
Instaed of unregistering the service programaticaly do the following,
1) Close SCM if it is open
2) Go to the service database and directly remove it from there. service databse is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.
3) Open SCM. Now that service will not be listed there in the SCM with that 'disabled' status.I had done some services around two yr back and i think i solved it this way -i dont remember exactly.
rgds...mil10
|
|
|
|
|
Hi All,
I want to create a Toolbar in a Activex control. Activex Control is being created as a DLL which will be invoked in a HTML page and I am working on Visual C++ 7.1 version.... I am trying with the following code but te toolbar is not getting displayed on the dialog...I am trying out this code in OnInitDialog()...
-------------------------
HWND hWnd;
hWnd = CFrameWindowImplBase<atl::cwindow, atl::cframewintraits="">::CreateSimpleToolBarCtrl(m_hWnd, IDR_MARKUPTOOLBAR,
FALSE, dStyle);
CFrameWindowImplBase<atl::cwindow, atl::cframewintraits=""> *myFrame = new CFrameWindowImplBase<atl::cwindow, atl::cframewintraits="">;
myFrame->Attach(hWnd);
if(hWnd)
MessageBox("Working");
--------------------------------------------------
Can any one suggest me what is wrong or any other way to do the same....
|
|
|
|
|
Do anybody know a convenient way to compare a variant string to constant string?
VARIANT varName;
VariantInit(&varName);
// varName is given a string value here
// Now I want to find out if the string contained in varName equals to a const string
VariantClear(&varName);
Thanks
|
|
|
|
|
A VARIANT that holds a string has the type VT_BSTR , you can compare a BSTR with wcscmp() :
if ( 0 == wcscmp ( varName.bstrVal, L"some string" ) )
{ }
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Thanks, exactly what I need
|
|
|
|
|
Hi,
While i want to use CComSafeArray by adding "atlsafe.h",i encounter some compilation error.
#include "atlsafe.h"
CComSafeArray<char> sa;
How can i resolve this problem.Could you tell me please what problem is about "atlsafe.h"? Even if i dont add
"CComSafeArray<char> sa;" in code page,i am getting some errors.
//////////////////////////////////////////////////////////////////////
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(84): error C2913: explicit specialization; 'ATL::_ATL_AutomationType' is not a specialization of a class template
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(84): error C2974: 'ATL::_ATL_AutomationType' : invalid template argument for 'T', type expected
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(85): error C2913: explicit specialization; 'ATL::_ATL_AutomationType' is not a specialization of a class template
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(86): error C2913: explicit specialization; 'ATL::_ATL_AutomationType' is not a specialization of a class template
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(87): error C2913: explicit specialization; 'ATL::_ATL_AutomationType' is not a specialization of a class template
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(215): error C2039: 'type' : is not a member of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(215): error C2039: 'type' : is not a member of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(87) : see declaration of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(215): error C2065: 'type' : undeclared identifier
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(215): error C2955: 'ATL::_ATL_AutomationType' : use of class template requires template argument list
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(87) : see declaration of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(572) : see reference to class template instantiation 'ATL::CComSafeArray<t>' being compiled
with
[
T=BSTR
]
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(215): error C2975: '_vartype' : invalid template argument for 'ATL::CComSafeArray', compile-time evaluatable constant expression expected
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(135) : see declaration of '_vartype'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(215): error C3861: 'type': identifier not found, even with argument-dependent lookup
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(220): error C2039: 'type' : is not a member of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(220): error C2039: 'type' : is not a member of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(87) : see declaration of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(220): error C2955: 'ATL::_ATL_AutomationType' : use of class template requires template argument list
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(87) : see declaration of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(220): error C2975: '_vartype' : invalid template argument for 'ATL::CComSafeArray', compile-time evaluatable constant expression expected
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(135) : see declaration of '_vartype'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(220): error C3861: 'type': identifier not found, even with argument-dependent lookup
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(220): error C3861: 'type': identifier not found, even with argument-dependent lookup
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(240): error C2039: '_typewrapper' : is not a member of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(87) : see declaration of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(240): error C2039: '_typewrapper' : is not a member of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(87) : see declaration of 'ATL::_ATL_AutomationType'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(240): error C2143: syntax error : missing ';' before '&'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(240): error C2143: syntax error : missing ';' before '&'
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(240): error C2955: 'ATL::_ATL_AutomationType' : use of class template requires template argument list
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsafe.h(87) : see declaration of 'ATL::_ATL_AutomationType'
|
|
|
|
|
Hi can we use the .NET assemblies in ATL.
Regards
Tarun
Blue Pill or Red Pill........??
|
|
|
|
|
If a .NET assembly is registered for COM interop (using regasm , the facilities from Windows Installer, or using the appropriate option in VS.NET), you can use it in the same way as any other COM object.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
I am new in web services programming.
I followed a sample. It seems worked on my local computer (with IIS).
But I don't know how to put the program online (internet)? Which file should I use?
Any settings? (the sample book didn't say anything.)
The Visual Studio 2003 seems did some setting on the local machine.
One more question is "How to do debug?"
I built a test client. But how can I know if the web service (server) followed the correct steps when the client asked a data process?
thanks a lot,
larry
|
|
|
|
|
Hi
I worked with ATL and i believe it has advantages over MFC when creating controls , COMponents..
Q1 :
what about WTL as an alternative for MFC for dialog based apps ?
the only advantage I know is it's available for download from MS site.. But no support..
Q2 :
Supposed I have a good knowledge of ATL..Is it easy to switch to WTL from MFC ?
|
|
|
|
|
|
thank you...
the small EXE compared to MFC statically linked EXE is a top feature..
but seems i'll have to re-write some classes provided in MFC.
it'll be a good practice anyway
|
|
|
|
|
hspc wrote:
what about WTL as an alternative for MFC for dialog based apps ?
WTL has several advantages. One of whch is that it is template based which allows you to change the base class of many of the GUI classes. WTL also does not have the DLL hell that mfc does. MFC is bloated, it contains functionality that STL and even C++ have better implementations but these are here to maintain backward compatibility. The Doc/View in mfc is very annoying/difficult to use in multithreaded applications as all windows must be created and accessed in the main thread. But WTL also has disadvantages. Not being supported or documented are big problems. Also look at code project. How many controls are MFC and then look how many are WTL?
John
|
|
|
|
|
hi all,
I have two ActiveX one parent and other child ActiveX.
I want the to establish communication between the two i.e parent and child control.(the container for Parent control is IE ).
To my knowledge. you have to provide a ClientSite for the Object so that you can host the Object in a container.
But I don't know how to create a Site Object in a Parent ActiveX so that I can give the ref of child Object.
Can anyone please help me,
Thanks in advance,
Abhishake
|
|
|
|
|
What I understand from above question is....You want to put Some Child ActiveX on Parent ActiveX and Communicate between them..if this is so...
Then use AtlAxCreateControl(....IUnKnown);
through this IUnknown pointer you can Advise/Addref to the child ActiveX)
regards
Balkrishna Talele
|
|
|
|
|
I am trying to add a status bar to my WTL dialog, and I'm not quite sure how to go about it. I tried this code in my OnInitDialog:
int indicator = ID_SEPARATOR;
m_statusBar.Create(m_hWnd);
m_statusBar.SetParts(1, &indicator);
m_statusBar.ShowWindow(SW_SHOW);
However, when dialog is created the status bar is created outside of the window floating at the top of the screen, which is very strange. All of the code samples show how to add it to CFrameWindowImpl, and I'd like to have the dialog editable in the dialog editor. Any ideas?
|
|
|
|
|
I'd think it was close to the same solution for MFC and adding toolbars to dialog based apps. I saw a ton of replies to that on a Google search yesterday when I was looking for something else.
|
|
|
|
|
Here is one solution, but it has a caveat.
Add a custom control in the VC resource editor, setting the class name to be "msctls_statusbar32". Positioning doesn't matter, it will get moved to the bottom of the dialog anyway.
However, the dialog's gripper is now obscured. I think I'm going to move to a frame window for this, it is a bit ridiculous.
|
|
|
|
|
OS: Win2K
Compiler: Visual Studio 6 sp5 and sp6, C++, Platform SDK Oct 2001.
I have created an ATL/COM EXE. It has a single, simple COM Object. I can build the component through the IDE. When I use nmake, the project builds and links but fails to return from the registration of the component--it hangs the server as though there were a memory leak. The COM Object does nothing--I could include it here, but if you created a new ATL/COM EXE and select from msdev menu Insert/New ATL Object... and select Simple Object, you would have what I have.
I have installed sp6 on my machine but that did not clean it up.
Has anyone else seen this problem? Solutions?
Thanks,
|
|
|
|
|
#include <atlmisc.h>
class NewNoteWindow;
typedef CWinTraits<WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE> CMyWindowTraits;
typedef CFrameWindowImpl<NewNoteWindow, ATL::CWindow, CMyWindowTraits> CMyFrameWindow;
class NewNoteWindow : public CMyFrameWindow, public CUpdateUI<NewNoteWindow>,
public CMessageFilter, public CIdleHandler
{
public:
DECLARE_FRAME_WND_CLASS(NULL, 0)
char buf[5000000];
virtual BOOL PreTranslateMessage(MSG* pMsg)
{
return CMyFrameWindow::PreTranslateMessage(pMsg);
}
virtual BOOL OnIdle()
{
return FALSE;
}
BEGIN_UPDATE_UI_MAP(NewNoteWindow)
END_UPDATE_UI_MAP()
BEGIN_MSG_MAP(NewNoteWindow)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
CHAIN_MSG_MAP(CUpdateUI<NewNoteWindow>)
CHAIN_MSG_MAP(CMyFrameWindow)
END_MSG_MAP()
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
return 0;
}
virtual void OnFinalMessage(HWND hWnd) {
delete this; // This is not working very well..
}
LRESULT OnCreate(LPCREATESTRUCT lparam) {
m_hWndClient = CreateWindowEx(WS_EX_CLIENTEDGE, NULL,"" , WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN,20, 20, 20, 20, m_hWnd, NULL, NULL, NULL);
// register object for message filtering and idle updates
CMessageLoop* pLoop = _Module.GetMessageLoop();
pLoop->AddMessageFilter(this);
pLoop->AddIdleHandler(this);
SetMsgHandled(false);
return 0;
}
};
When running the app under debug i get an Access Violation when I close the window. Why? It doesn't happen without delete this; but i see using my 5 meg buffer(in task manager) that the NewNoteWindow-object hasn't been deleted so i obviously have to delete it myself. Can someone help me make this work correctly?
|
|
|
|