|
Hello. Is it somehow possible to disable the linking between VK_RETURN and CDialog::OnOK? Whenever I press ENTER in my dialog, it calls the OnOK, and I would like to avoid this.. Is it possible?
|
|
|
|
|
1) Give the OK button another ID besides IDOK.
2) In the OnOK() handler, don't call the base class CDialog::OnOK() .
http://www.codeproject.com/cpp/cppforumfaq.asp#mfc_dlgclosekeys
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I tried to override OnOK, and yes, the dialog doesn't close, but if I then add an OnKeyDown-handler to my dialog, it never receives any VK_RETURN-notifications.. Is this beacuse MFC "grabs" the VK_RETURN, and sends it to OnOK, or just beacuse I'm doing something wrong?
|
|
|
|
|
Depending on which control has focus, the dialog may not even "see" the key presses. Tell us more of what you are trying to do.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
VK_RETURN actually invokes a default button in your dialog, which happens to be your OK button.
You could unchek "default button" property for it in the resource editor, or at a run time.
|
|
|
|
|
I have a block of data, say name, address, etc (could be 1000's of chars long) that wish to encrypt using a key and then decrypt using the same key. WHERE can I get some source. I checked out Codeproject, doesn't seem to have what I need.
Any help?
TIA
Ralph Krausse
|
|
|
|
|
|
Thanks but that seems a bit over the top for a novice like me...
|
|
|
|
|
|
Hi !! I'm programming under Linux and compiling with GCC (C and C++ code). Where can I find manuals for all the functions and libraries that I can use ??
I've tried to use the gotoxy(int, int) function but there's not "conio.h" and if I include it, it begins to send error messages.
I need a manual (if its downloadable much better) where I can find all the functions and libraries.
Thanks in advance !!
|
|
|
|
|
Your Linux install should have all the documentation you could need. Look into the optional parts of the distribution.
In the area of what I assume 'gotoxy' (which is not any sort of standard C/C++) might mean try 'man curses'.
Paul
|
|
|
|
|
It was only an example, that function sets the cursor to the column and file wherever you want to go. But I would like to know how can I call the documentation about programming... I tried "man gcc" and it told me lots of things but there's anything about all the allowed functions and so on.
I'm programming under downloaded Linux Mandrake 10.0.
Thanks in advance !!
|
|
|
|
|
Can anyone point me to some examples of how to write multithreaded serial comm classes in vc++ and mfc?
Thanks in advance,
John Horstkamp
|
|
|
|
|
I have tried using ios:: app to read from name.dat but it wont read it I have errased it out because i could get read from data or to it
This is the code bellow
cout <<"\n Enter the item Name ";
cin >> ItemName;
cout << "\n Enter the quantity in store ";
cin >> QtyInStore;
cout << "\n Enter the stocks in ";
cin >>StocksIn;
cout << "\nEnter the stocks out ";
cin >> StocksOut;
QtyRem = QtyInStore + StocksIn - StocksOut;
cout << " \nThe Quantity remaing is: " <<qtyrem;
cout="" <<="" "\nenter="" the="" unit="" price="" ";
="" cin="">> UnitPrice;
TotalPrice = UnitPrice * QtyRem;
cout << "The Total price is: " << TotalPrice;
cout << "\nEnter G for GlassWare , S for stone ware, T for tools ";
cin >> select;
|
|
|
|
|
ifstream myFile ("name.dat");
myFile >> ItemName;
etc.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
i want to use GetWindowsDirectory to get the windows paths,but my end aim to get notepad.exe path,so i want to know how to combine them to satisfy my final aim.
in addition, i want to call painter paths ,how to first use the way of get registry path ,then combine them
|
|
|
|
|
vividtang wrote:
i want to use GetWindowsDirectory to get the windows paths...
char szBuffer[MAX_PATH];
GetWindowsDirectory(szBuffer, sizeof(szBuffer)); vividtang wrote:
...but my end aim to get notepad.exe path,so i want to know how to combine them to satisfy my final aim.
There is no guarantee that notepad.exe exists in any particular directory.
vividtang wrote:
in addition, i want to call painter paths
What are "painter paths?"
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
the program is to display NotePad ICON on the left up corner in window.
void CSampleView:
OnDraw(CDC * pDC)
{UINT stFileInfo;
if( :: SHGetFileInfo(_T("c:\\windows\\notepad.exe"),0,
&stFileInfo,sizeof(stFileInfo),SHGFI_ICON))
{
pDC ->DrawIcon(10,10,stFileInfo.hIcon)
}
}
BUT COMPILE ERROR:
arning C4652: compiler option 'Generate Browser Info' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
F:\control learing\517evening\517eveningView.cpp(61) : error C2664: 'SHGetFileInfoA' : cannot convert parameter 3 from 'unsigned int *' to 'struct _SHFILEINFOA *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
F:\control learing\517evening\517eveningView.cpp(63) : error C2228: left of '.DisplayName' must have class/struct/union type
Error executing cl.exe.
517evening.exe - 2 error(s), 1 warning(s)
|
|
|
|
|
Change
UINT stFileInfo;
to
SHFILEINFO stFileInfo;
Bikram Singh
|
|
|
|
|
hi:chopchop,thx your kindness
but when i changed ,the following error:
warning C4652: compiler option 'Generate Browser Info' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
F:\control learing\517evening\517eveningView.cpp(63) : error C2039: 'DisplayName' : is not a member of '_SHFILEINFOA'
c:\program files\microsoft visual studio\vc98\include\shellapi.h(570) : see declaration of '_SHFILEINFOA'
|
|
|
|
|
You should do a bit more work and look it up in MSDN...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/structures/shfileinfo.asp
Anyway, the member is not DisplayName, rather it is szDisplayName
Bikram Singh
|
|
|
|
|
SHFILEINFO stFileInfo;
if(::SHGetFileInfo(_T("c:\\windows\\notepad.exe"),0,&stFileInfo,sizeof(stFileInfo),SHGFI_ICON))
{
pDC->DrawIcon(40,10,stFileInfo.hIcon );
}
ALL OK,THX
REGARDS
|
|
|
|
|
hi i added a list view control made it report style and mapped a variable list view variable to it in mfc
now when i go to add a column it wont cooperate
i tried m_List.InsertColumn(0, "Hello");
and sometimes itll do nothing other times itll do a sliver of a column with nothing in it
what is the proper way to set up columns?
thanks
|
|
|
|
|
The column has probably been added, but its width is too small. Change the call to this to verify:
m_List.InsertColumn(0, "Hello", LVCFMT_LEFT, 100);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
lol yeah i figured it out i accidently had the code after a return how stupid is that rofl thanks for helping out tho
|
|
|
|