|
Perhaps you could try using the standard library stack adapter.
#include <stack>
and replace StackType<CString> hy_back with std::stack<CString> hy_back;
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I doubt that the error has anything to do with the template for StackType but in my opinion it will be much better to do this. Unless your teacher or boss told you how to implement this I see no reason to reinvent a standard c++ template class...
John
|
|
|
|
|
Process of elimination.
If it won't work, delete the classwizard file and try to rebuild it...
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
The reason why I asked is that these are the tags that the classwizard uses to parse your code.
Move the line :
StackType<CString> hy_back;"
somewhere else in your class definition.
John
|
|
|
|
|
Thank you. That was the problem. It was in the view header between the afx comment tags. I moved it below and It worked. Before, I had been looking in another place. Thanks again.
Missing: Wonder Cow, LooseScrew, Clark, Screwage, AlterEgo, packingascwdriver, Rob Irtson, IB, George Harrison? I weep. (please, never ask...to painful.)
|
|
|
|
|
Thanks all for the tips. I will try a couple of these. I am sure that one will work.
Thanks a bunch.
Missing: Wonder Cow, LooseScrew, Clark, Screwage, AlterEgo, packingascwdriver, Rob Irtson, IB, George Harrison? I weep. (please, never ask...to painful.)
|
|
|
|
|
CMyFormview is a View in my dll.it is derived from CFormView.Why it does not respond to on_keydown message,also it does not respond to the overrided function PreTranslateMsg .
gucy
|
|
|
|
|
Hello all
I'm writing an application which needs to have name of application which is using serial port. Can any one tell me how to retrieve application name which is using serial port.
Thanks for your help.
Hari
|
|
|
|
|
I can't give you a better guide than to point you in the direction of HandleEx on www.sysinternals.com[^].
Iain.
|
|
|
|
|
How can I execute a function in the context of another thread?
I know about APCs, but these require that the target thread becomes alertable at some point in time. I can not (or do not want to) change the source to the other thread to call SleepEx(0) every so often.
Kernel-mode APCs are ideal for this, because the thread does not need to be alertable. However, it seems like they can only be used by ring 0 apps, and are platform-specific.
Is what I want to do even possible?
|
|
|
|
|
If the thread is a UI thread, use PostThreadMessage() and pass it a registered message, or a WM_APP+n value. You'll need to arrange some communication to have the sending thread wait until the second thread has finished.
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Yes, I thought of that. The only problem there is that I want this to work for any thread, whether it has a message loop or not.
|
|
|
|
|
In that case, you want fibers. They are like threads but you control the scheduling of when they run. Start by reading the docs on ConvertThreadToFiber()
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
I'm creating a map editor for a game engine i've been working on. I'm hoping to create the interface in a similar fashion to photoshop. Basically, I have my MDI setup... and i'm creating and displaying small WS_EX_TOOLWINDOW'd dialogs, which will contain information and interaction tools for level editing. But, I'm having a couple problems.
Main Question:
In photoshop, when you click one of the palette windows, focus is not taken from the document. How can I do the same thing? As soon as I click on of my tool windows, no CDocument is active.
Secondary Question:
Also, I can get the small windows to show on top of the application (TOPMOST), and when the app is minimized, i hide the tool windows. But, if I put my app behind others, the tool windows are on top of EVERY window. I only want them on top of MY application, not every running window of every app.
Extra Question:
Also, is there a graceful way to detect when the active document has changed? An event handler, perhaps?
|
|
|
|
|
I keep getting the following error upon linking:
"error LNK2001: unresolved external symbol "public: class CString __thiscall CMyDoc::FKeyReset(int)"
This happens when I try to instantiate a function template. The code snippets are below. Does any one spot an obvious problem in it? Thanks,
Ralf.
MyDoc.h:
template<class t=""> CString FKeyReset(T RecSet);
MyDoc.cpp
template<class t=""> CString FKeyReset(T RecSet) {
CString str;
if(T > 0)
str.Format("message 1");
else
str.Format("message 2");
return str;
}
Elsewhere outside MyDoc:
CMyDoc *pMyDoc = (CFisheriesDoc *) //pointer to MyDoc
((CFrameWnd*) AfxGetApp()->m_pMainWnd)->GetActiveDocument();
CString szAstr;
int i = 2;
szAstr = pMyDoc ->FKeyReset(i); //offending line
ralf.riedel@usm.edu
|
|
|
|
|
|
I'm creating one of the biggest project I have undertaken N I'm a newbie, so I need lots of help. Because it's so big, I break it down into multiple parts (multiple projects, 1 DSP for 1 DSW), which I call utilities.
Now I want to use a "Utility", eg MyCustomStringCls, in another project. I have compiled N tested the "utility" so I have the OBJ file already.
Now here are my Q:
1. When I want to use an utility (eg MyCustomStringCls), in VC++, do I need to "Add To Project > Files" the MyCustomStringCls.h and the .CPP?
2. I want to call include with Angle bracket instead of DoubleQuote, do I just need to "Settings > C/C++ tab > Preprocessor" and add the path to "Additional Include directories" ?
I have done this, but everytime I add new method, which returns MyCustomStringCls object, in my new class, VC++ always add new #include with double quote. I'm fighting with it by manually delete that new include.
eg. For the new class, I want to have:
#include <mycustomstringcls.h>
BUT, VC++ always add this:
#include "..\Prj_MyCustomStringCls\MyCustomStringCls.h"
3. Every time I compile my new Project, it creates the MyCustomStringCls.OBJ and puts it in my new project folder. How do I tell VC++ compiler to skip creating OBJ for particular .H .CPP? And how do I tell linker to use the OBJ from MyCustomStringCls project folder?
Hope I don't confuse anybody. Please Help.
cheers,
Jo
|
|
|
|
|
consider creating LIB files for stuff you want to reuse.
A "lib" (library) is just a single file that contains one or more OBJ files. They are packaged into a single lib file, the linker can selectively pull obj files that are needed into your other projects....
To link this lib into other projects -- you'll need to update the settings on your project to generate a lib for a set of files. And also you'll need to create one or more H files to include in those other projects....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Peter,
I have never made LIB file. I'm reading the VC++ help on creating LIB, but I'm kinda of lost. Can you give me more pointer on how to do it, please?
cheers,
Jo
|
|
|
|
|
The only way I ever do it, is in the new project wizard. You'll have to do it that way. The process is mostly: compile c/cpp files to .objs, and the "librarian" combines those into a lib file.
Start at File|NewProject and look for a ".lib" type thingy in there.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
When you do VC++ DLL project.
The outcome will be a *.dll and a *.lib. The VC++ will automatically do it for you. If you are using Borland C++. You could specify to create a LIB project.
Basically, to use you lib. You just link it using you project configuration or do it in the code. And also, to include your *.h file (your header file)
hope this helps.
|
|
|
|
|
Thanx guys,
Following you guys' suggestion, I have successfully created .LIB(use VC++ Static DLL Project) and used it in my other project.
After understanding the procedure, it's actually extremely simple.
Jo
|
|
|
|
|
Hi all,
i am using MFC, i've created a Tree ctrl with the check boxes style.
how do i disable the checkboxes from the root item (the rest item should have it , but root should not)???
can any1 help?
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
For each node(Tree item) u need to set the style !
|
|
|
|
|
what do u mean? can u give an example?
|
|
|
|