|
Okay.
NM_DBLCLK does not work either.
I tested ON_NOTIFY and ON_NOTIFY_REFLECT using NM_DBLCLK and LBN_DBLCLK.
Kuphryn
|
|
|
|
|
Okay. I figured out the bug. The bug was a human-error, not an MFC error.
I made an error during creation of the CListCtrl object.
Here is the error.
// Here is the incorrect creation code.
-----
m_LB_Box.Create(WS_CHILD | WS_VISIBLE | WS_BORDER | LVS_REPORT | LVS_SORTASCENDING, CRect(0, 100, 100, 50), this, 1);
-----
Notice the "1" in the last parameter.
// Here is the solution.
-----
m_LB_Box.Create(WS_CHILD | WS_VISIBLE | WS_BORDER | LVS_REPORT | LVS_SORTASCENDING, CRect(0, 100, 100, 50), this, IDC_LB_BOX);
-----
Thanks everyone,
Kuphryn
|
|
|
|
|
How can i open a default internet browser in new window ???
|
|
|
|
|
Use the opennew verb, intead of open.
How low can you go ? (MS retrofuck)
|
|
|
|
|
ShellExecute("open", "http:\\www.copdeproject.com", NULL, NULL, SW_SHOW);
|
|
|
|
|
Hey all. I'm working on a MFC Single Doc program. I have included:
<br />
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);<br />
m_pMainWnd->UpdateWindow();<br />
It is maximizing the program correctly. My problem is that when it loads, it is not the active program. Any help on how to fix this is appreciated.
Brad Jennings
|
|
|
|
|
|
Thanks a lot. Not exactly what I was looking for but the answer wasn't far off. I just needed to add the line:
<br />
m_pMainWnd->SetForegroundWindow();<br />
Later.
Brad Jennings
|
|
|
|
|
Hello, can anyone tell me how to minimize a dialog box programatically to
the system tray on start up. Like MSN messanger or ICQ.
Thank You
|
|
|
|
|
if you want a taskbar icon, see http://www.codeproject.com/shell/cjbtaskbarapplet.asp
-c
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
It crashes at the update().I checked to see that there was valid data in in the fields after being assigned.
while (!m_db1.m_pRecordset->GetadoEOF ())
{
m_db3.Open(DatabaseName3);
int n = m_db3.m_pRecordset->RecordCount;
m_db3.m_pRecordset->AddNew();
std::set<CString>::iterator itA = m_set3.begin();
for(; itA != m_set3.end(); itA++)
{
tempStr = *itA;
char* fldIt1 = new char [tempStr.GetLength() + 1];
strcpy(fldIt1, tempStr);
CString strTemp((char*)(_bstr_t)(m_db1.m_pRecordset->Fields->Item[fldIt1]->Value));
m_db3.m_pRecordset->Fields->Item[fldIt1]->Value = m_db1.m_pRecordset->Fields->Item[fldIt1]->Value;
;
delete[] fldIt1;
}
m_db1.m_pRecordset->MoveNext();
m_db3.m_pRecordset->Update();
m_db3.m_pRecordset->Close();
m_db3.m_pRecordset = NULL;
m_db3.Close();
}
|
|
|
|
|
You have MoveNext before the Update.
|
|
|
|
|
Thanks. But actually thats the movenext for a different database. I'm cycling through 1 and adding to another.....but thank you anyway
ns
I did find my problem a few minutes ago (hurrah!). I had added and populated a field in the new databse, but didnt realize I had to close and reopen it for the change to be visible to the program. Once I did that things are going along fine!
|
|
|
|
|
nss wrote:
Thanks. But actually thats the movenext for a different database. I'm cycling through 1 and adding to another.....but thank you anyway
ns
Ooops.
nss wrote:
I did find my problem a few minutes ago (hurrah!). I had added and populated a field in the new databse, but didnt realize I had to close and reopen it for the change to be visible to the program. Once I did that things are going along fine!
Which database are you using, and what version of ADO? I had a similar problem with an Access 97 database, with the field not updating unless I closed and reopened the recordset. It turned out to be a bug in the Jet driver for 97, so moving to Access 2000 DB fixed it, so that when I called update the correct value was there.
|
|
|
|
|
Access 2000. What it was unhappy about was that I was trying to access a value from the ew column, and even though if I looked in Access, the new column was added, apparently the code was clueless. Its msado25.tlb. Was using a later version, with msado15, but it wouldnt run on some machines - an MDAC mismatch.
I should add that the problem was with the database I was reading from (to which I'd added a column), but once the open-close thing was resolved, tht database I was writing to, and updating had no problem. I didnt have to close and open it multipe times...
|
|
|
|
|
Hi,
I would need some fuction like FromHandle but only in Win32.
???
R.
|
|
|
|
|
If you're using the APIs, then there are no wrapper classes. HWND is all there is.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
What do you mean? There is no CWnd in plain Win32 API if you do not use MFC extensions
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I just wanted to do this conversion in a non CWnd derived class (e.g: CMyApp).
R.
|
|
|
|
|
The class needs not be derived from CWnd, but you need MFC to convert a HWND to CWnd
modified 12-Sep-18 21:01pm.
|
|
|
|
|
But in CMyWinApp
CWnd::FromHandle() is unavailable.
But I need to convert a handle to a pointer.
R.
|
|
|
|
|
a pointer to what?
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
CWnd::FromHandle() is a static member
function. It will, if necessary, create
a temporary CWnd object and return a
pointer to that. Like so:
CWnd* pTmpWnd=CWnd::FromHandle(hSomeWnd);
Call it from anywhere.
|
|
|
|
|
Scott,
thanks for the solution!
R.
|
|
|
|
|
A CWnd is a wrapper for a HWND, and if you're in Win32, you won't have anything that takes or uses a CWnd. Perhaps if you explained what you were trying to do, I suspect the problem is your approach in general, and not the specific question you're asking.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|