|
Nebulous Person wrote:
listing of all of over 600 Systems Calls that can be made from user processes to kernel mode address space (not even really sure what that is).
Here you displayed this book isn't for you. If you don't even know what it is, stick to Win32. When Win32 limits you, then, maybe, these calls might be of use.
Why would this information be useful from a program design standpoint?
It wouldn't, and thereby the question is wrong. The Correct question would be "Is this information of use from a program design standpoint?" and the answer is: no, at least not now for you. Read, and understand, the sourcecode at sysinternals (former winternals) first.
how could this program be altered to work correctly on older versions of Windows
How the heck would we know without neither seeing the code, nor knowing what it really does? Since you yourself don't even know what the program does (or at least not how it's done), is this question even relevant?
If you want to use a function call available from later OSes in an older OS (that doesn't implement this call itself), you'd have to write that code yourself like any good hacker.
|
|
|
|
|
|
I've got a dialog docked and it contains 2 CButtons. They show up and act as though they were disabled, but when I check IsWindowEnabled() it comes back true. Also, under properties for both buttons, disabled is UNchecked.
I can't figure out how to get these buttons working.
Can someone please point me in a direction? Preferably the right one.
If it helps, I had an issue with a group box on this same dialog, but it showed up transparent even though it wasn't selected that way.
I'm using Christi Posea's docking controls http://www.datamekanix.com/[^].
Thanks in advance!
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|
|
you have to add command handling functions to the buttons
to do that, i think you double-click the buttons in the dialog editor if you made a class for the dialog
- Roman -
|
|
|
|
|
The button is actually greyed out when the dialog comes up, as though it were disabled. I know how to add OnButtonClicked(), etc. The button however is not at a state where clicking even works.
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|
|
1. I made the AboutBox modeless for a test.
2. I added a CEdit to it.
Ran it, entered text, and pressed Enter.
Code in OnCommand of CAboutDlg
if( wParam == IDOK && lParam == 0 )
{
CString strText;
CWnd* p = GetFocus();
p->GetWindowText(strText);
strCommand.Format(_T("Command from editbox: %s"), (LPCTSTR)strText);
AfxMessageBox(strText);
}
No response.
I had renamed the OK button as IDNOTOK instead of IDOK. wParam and lParam are definitely not 1 (IDOK) and 0. SO it never enters the if block.
WHat do I need to do if I want to Enter key with this mechanism ? I'm doing it this way because I have many textboxes and the user might enter in any one of them....so I cant say m_text1.GetWindowText(strT); etc....
Appreciate your help,
ns
|
|
|
|
|
Change
if( wParam == IDOK && lParam == 0 ) to
if( LOWORD(wParam) == IDOK )
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I think our friend ns is really confused. see the thread "WM_COMMAND and wParam" immediately below this one
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Yup. Sometimes it is not clear to me whether answering this simple, out-of-context questions is of any use to anybody.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi Joaquin,
I got really alarmed reading your thought that maybe your answers to my simple questions are not too useful. To your experienced eyes my queries are simple, but I do want to tell you that I struggle long and hard before I post, so to me they are really tough issues for which I could not find an answer or a sample to guide me. So PLEASE PLEASE keep responding. I consider you as one of my very valuable resources. CP has been extremely useful to me and has nudged me along with my project, which runs into a zillion problems everyday. I've got a dozen books, some access to a C++ but not MFC programmer, and of course the web and MSDN, and you folks at CP, and these are what I turn to to get things done.
Appreciate your help,
ns
|
|
|
|
|
First of all, accept my excuses if you felt in any way offended by my post. What I meant is that sometimes the questions are about so minute details and so detached from a general context that possible answers, even if correct, may lead to unexpected side results later on. I know sometimes one just gets dropped into the mainstream of a project with tight completion dates and has no time to learn about the general scheme of things, but IMHO it pays to save some time away from the project and dedicate it to careful reading of tutorials and books so as to grasp the general concepts behind MFC and other huge libraries.
That said, rest assured I will be happy answering as many questions as I think I have an answer for.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I tried the LOWORD idea, and still it wont go into the if(LOWORD (wPAram) == IDOK) loop because lParam and wParam come into the OnCOmmand as some really large positive integers....
SO I will do like P J says and use the OnOK of the CDialog. I was doing this method because I saw it done for a combobox on a toolbar and it works for that. So it surprises me that the same mechanism wont work if the control is on a CDialog....
Thank you for your suggestion.
Appreciate your help,
ns
|
|
|
|
|
Dude, what are you doing
CToolBar and CDialog are totally different beasts. To handle the enter key in a dialog, override the CDialog::OnOk() function.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Ah! Well, like you gys said...this stuff is new. The way I pick up things is by seeing samples> I saw the toolbar combobox and thought - oh! Thats how you trap the enter key press! And there was no information telling me that thats NOT the way for a CDialog (none that I have access to....). So now I know.....you treat the two Enter differently. SOrry if I 'm a pain, but your responses truly get me to learn. As for the HIWORD, LOWORD....yes I did understand that post> What I didnt do ( ) was implement your information right away, so hence my duplicate sounding thread.
How did you learn about treating the two different Enters differently? Just curious, but if WM_COMMAND is such a universal sort of message why cant we do that in the CDialog as well? I hope I dont annoy you with this question...I'm trying to generalize as much info as I can because I keep forgetting the individual details....
Appreciate your help,
ns
|
|
|
|
|
At the risk of confusing you more....
ns wrote:
Just curious, but if WM_COMMAND is such a universal sort of message why cant we do that in the CDialog as well
If you create a dialog with no buttons, or any controls that handle the enter key themselves (in other words, a dialog with only simple static controls), then you can handle the enter key this way. But it is not advicable, because CDialog will, by default, call your OnOk() handler.
It's not a matter of it will never work, it's just that it will only work in very special circumstances.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
So I'll stumble upon these special circumstances as I grow in my coding experience......
Appreciate your help,
ns
|
|
|
|
|
I am importing OIP22.TLB in one of my header file. I am trying to connect to a oracle database which is on unix box through by VC++ application.
The following is the code I am using:
BSTR bstrDb = m_strOraDb.AllocSysString ();
BSTR bstrUser = m_strOraUser.AllocSysString ();
m_pOraDatabase = m_pOraSession->GetOpenDatabase( bstrDb, bstrUser, ORADB_DEFAULT);
m_strOradDb , m_strOraUser are Const CString
Values in m_strOraDb and m_strOraDb are : "omst", "oms/oms" (Our database name, userid/password, ORADB_DEFAULT = 0)
From above it goes into this routine of OIP22.TLI file:
#pragma implementation_key(36)
inline IDispatch * OraSession::GetOpenDatabase ( BSTR dbname, BSTR connect, long options ) {
IDispatch * _result;
_com_dispatch_method(this, 0x60010002, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&_result,
L"\x0008\x0008\x0003", dbname, connect, options);
return _result;
}
It fails just before return_result saying:
First-chance exception in MYAPP.EXE (KERNEL32.DLL): 0xE06D7363
ravi
|
|
|
|
|
From MSDN:
wParam
The high-order word specifies the notification code if the message is from a control. If the message is from an accelerator, this value is 1. If the message is from a menu, this value is zero.
The low-order word specifies the identifier of the menu item, control, or accelerator.
In a sample code I see:
BOOL CToolBarWithCombo::OnCommand(WPARAM wParam, LPARAM lParam)
{
if( wParam == IDOK && lParam == 0 )
Here wParam is just one thing (is IDOK an example of what they call the notification code ?) . I dont see them doing a hiword(wPAram) and loword(wPAram). I'm a bit lost...
Appreciate your help,
ns
|
|
|
|
|
He's taking a shortcut. The only way wParam can be equal to IDOK (1) is if the loword is 1 and the hiword is 0. (looks like he is handling the user pressing the enter key)
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
THe toolbar has a combobox, and this code is when the user enters text in the edit part of the combobox. The combo has an ID_COMBO1. SO according to MSDN I thought it would be:
LOWORD (wParam) = ID_COMBO1
HIWORD (wParam) = notification code for pressing Enter.
I looked up IDOK and it seems to be the ID of the OK button on a CDialog. So I can even convince myself that LOWORD(wParam) = IDOK because its like pressing an OK button when you hit enter. The notification code for pressing a button is BN_CLICKED = 0. SO your answer makes sense.
====================================
Heres my next followup question
In that case say I had a textbox, a richtextbox and a combobox on my toolbar. Then I enter text in any one of them. According to what I have gathered from you, what I should be looking for is the WM_COMMAND handler is IDOK and BN_CLICKED. SO nothing is telling me what the control was which had text entered in it.....
===========================================
From the combotoolbar sample, they do:
if( rgComboBox[index]->GetEditSel() != 0 )
{
AfxMessageBox("aaa");
} .
I read about GetEDitSEl in mSDN and its associated with highlighted (selected ) text. Yet if I simply enter text in the combobox and hit enter, the text vanishes (it shows up in the dropdown), and the code enters the if block and I get the AfxMessageBox. I have not selected anything !!!!! Yet GetEditSel returns nonzero value!
If I can understand this, then maybe i can use something similar to see if the CEdit had stuff using GEtSEl. Though why that should work is as mysterious as why GetEDitSEl works. The mystery being that I did not select anything...just entered text and hit return!!!!!!
Appreciate your help,
ns
|
|
|
|
|
Ok, I downloaded the code you are refering to. I looked at it, and the code you are refering to is a real hack, it does not always work. Just for the heck of it, enter some text in the comboboxes edit control, now hit the <Home> key on your keyboard to move the caret to the start of the text you just entered. Now hit <Enter>.
Notice that nothing happens? GetEditSel() is returning 0 so the test fails. You are better off using GetFocus() and use that pointer.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
I did:
CWnd * pWnd = GetFocus();
and it compiled okay. How does a pointer tell me about what control its a pointer of? I've got a CEdit as well as a CComboBox. I tried this:
if (p == TypeOf(CComboBox))
{
AfxMessageBox("kkk");
}
as a guess but there is nothing called TYpeOf.....how do I recognize my pointer?
Appreciate your help,
ns
|
|
|
|
|
Your toolbar has member variables for the controls, right?
Just compare the returned CWnd* to your member variable.
CWnd *pWnd = GetFocus();
if (pWnd == MyToolBarPointer->m_TheEditControl)
{
}
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
it should read:
if (*pWnd == ...
The pointer has to be dereferenced.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Gosh! I am so sorry I didnt see the obvious. I got so carried away with your new information that I started looking for even newer ways of doing stuff and forgetting the old stuff...
MAny thanks!
Appreciate your help,
ns
|
|
|
|