|
Yep mnemonic. I even tried an accelerator key that was mapped to code that would set the focus but I haven't gotten that to work either. Back to the drawing board.
|
|
|
|
|
Was successful in mapping an accelerator key to some code that put the focus to a control that had tabstop set to false. It wasn't working originally because I was using a dialog app that probably didn't have the accelerator table attached. Curious if there are other solutions. This seems to work pretty well though.
|
|
|
|
|
i dont see menu on this code . can some1 help me . how can i view a pop-up menu programaticaly
m_menu.m_hMenu = NULL;
m_menu.CreatePopupMenu();
CMenu childmenu;
VERIFY(childmenu.CreatePopupMenu());
m_menu.AppendMenu(MF_STRING | MF_POPUP | MF_ENABLED, (UINT)childmenu.m_hMenu, _T("&Delete"));
childmenu.Detach();
childmenu.DestroyMenu();
///BOOL res1 = m_menu.EnableMenuItem((UINT)childmenu.m_hMenu, MF_ENABLED);
BOOL res2 = SetMenu(&m_menu);
///this->DrawMenuBar();
|
|
|
|
|
I don't really see what you want to do but if you want to show a pop-up menu, you will need to call TrackPopupMenu member function from CMenu.
|
|
|
|
|
|
i'm pushing values inside a vector using push_back()...
then.. to print it can't we use cout< >::*)(void) const'
Error executing cl.exe.
Thanx
V
|
|
|
|
|
That would help a lot if you were using the < tag that is just above the emoticons (your code is impossible to read, and the same for the error message). And also, put the declaration of the vector itself.
|
|
|
|
|
#include <vector>
using namespace std
{
vector<int> vec;
vec.push_back(1);
vec.push_back(2);
vec.push_back(3);
vec.push_back(4);
for(int i=1;i<vec.size;i++)
cout << vec[i];
}
thanks,
V
|
|
|
|
|
The problem is not on cout, the problem is at this line:
Vivekuniq wrote:
for(int i=1;i<vec.size;i++)
You forgot the parenthesis after size. Try this instead:
for(int i=1;i<vec.size();i++)<br />
|
|
|
|
|
It seems that you are trying to write the data where you should evalute the lopp condition ... but if you could write the whole piece of code would be quite more understandable ...
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
marcdev wrote:
It seems that you are trying to write the data where you should evalute the lopp condition
No, it's just because the '<' symbol is interpreted as an HTML tag so a part of his code has been removed.
|
|
|
|
|
Ok, i didn't realise about that !!!
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
|
#include <vector>
using namespace std
{
vector<int> vec;
vec.push_back(1);
vec.push_back(2);
vec.push_back(3);
vec.push_back(4);
for(int i=1;i<vec.size;i++)
cout << vec[i];
}
Thanx
V
|
|
|
|
|
sh*t, this is silly . sorry guys...
Thanks a lot
V
|
|
|
|
|
Stupid STL trick:
std::copy(vec.begin(), vec.end(), std::ostream_iterator<int,char>(std::cout," "));
|
|
|
|
|
|
I first came across that in Josuttis's book.
Kevin
|
|
|
|
|
i got errors.. with
std::copy(vec.begin(), vec.end(), std::ostream_iterator(std::cout," "));
i also tried declaring
vector<int>::iterator ostream_iterator;
but still,
D:\v\CLEAR\Console\Main.cpp(45) : error C2039: 'ostream_iterator' : is not a member of 'std'
D:\v\CLEAR\Console\Main.cpp(45) : error C2039: 'cout' : is not a member of 'std'
D:\v\CLEAR\Console\Main.cpp(45) : error C2064: term does not evaluate to a function
Plz complete the trick
Thanx
V
|
|
|
|
|
i got errors.. with
std::copy(vec.begin(), vec.end(), std::ostream_iterator(std::cout," "));
i also tried declaring
vector<int>::iterator ostream_iterator;
but still,
D:\v\CLEAR\Console\Main.cpp(45) : error C2039: 'ostream_iterator' : is not a member of 'std'
D:\v\CLEAR\Console\Main.cpp(45) : error C2039: 'cout' : is not a member of 'std'
D:\v\CLEAR\Console\Main.cpp(45) : error C2064: term does not evaluate to a function
Plz complete the trick
Regards,
V
|
|
|
|
|
//try this
#include <vector>
#include <iostream>
using namespace std;
main ()
{
vector<int> vec;
vec.push_back(1);
vec.push_back(2);
vec.push_back(3);
vec.push_back(4);
//U should do i=0, or like this u loose the "1"
for(int i=1;i<vec.size();i++)
cout << vec[i];
}
//regerds, gecool
|
|
|
|
|
Hi,
After using ShellExecuteEx and getting HANDLE hProcess of the SHELLEXECUTEINFO Structure, I need to get the CWnd pointer of the program window I opened. I want to use it in SetWindowPos to move and set its size. How can I get CWnd *?
Thanks,
caykahve
|
|
|
|
|
You don't actually need a CWnd* . CWnd will just wrap the handle and convert the calls you make to CWnd methods in calls to the corresponding API function using the handle stored in its m_hWnd member. For example, here is the implementation for CWnd::MoveWindow()
void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
{
ASSERT(::IsWindow(m_hWnd));
::MoveWindow(m_hWnd, x, y, nWidth, nHeight, bRepaint);
}
So, you can always make the call to the API function yourself.
That being said, you can obtain a CWnd* for a given handle, using CWnd::FromHandle() but take note that in your case it will be a pointer to a temporary object, so you can't store it for later use.
Again, if all you want to do is to use some CWnd methods, you can use the corresponding API function directly on the window handle. For CWnd::SetWindowPos , the corresponding API is just ::SetWindowPos . Look in the documentation to see what parameters it expects.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Holy handles, Batman!
After reading Alok's response I now realize that you were talking about a process handle and I took it as a window handle. It's embarrasing considering how clear it is in the thread title itself
No cookies but more coffe for me.
Sorry,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
No cookies but more coffe for me.
Sir, Then please pass that Cookie to me, I am Hungry at this moment .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|