|
Thank you for the help given!
However, I'd followed your instructions given and my PC program (developed using CSocket, under VC++) still cannot establish connection with my WIN CE program (developed using CSocket, under eVC++) , running within the emulator. Approach taken in the program development is very similar with programs reside on 2 different desktop PC. I've set the port number to be 4000 and host name as the emulator.
|
|
|
|
|
The error I got is WSAEINVAL:10022
|
|
|
|
|
I want to load data from my database in my CListCtrl fast ! How ?
I remind you i want all the data to be loaded like my code if you now how please help me ! I will wait your answer because i don t have any ideea how ( now i wait 3 - > 10 min. to load my data in my CListCtrl )!
this is my code :
void CMyList::FillList()
{
CDataBase22 *pDataBase22 = new CDataBase22();
pDataBase22->Open();
CString sName;
if (pDataBase22->GetRecordCount())
pDataBase22->MoveFirst();
while(!pDataBase22->IsEOF())
{
int nItem = m_list.GetItemCount();
sName.Format("%d",pDataBase22->m_name);
m_list.InsertItem(nItem,sName);
m_list.SetItemText(nItem,0,pDataBase22->m_name);
m_list.SetItemText(nItem,1,pDataBase22->m_city);
pDataBase22->MoveNext();
}
pDataBase22->Close();
}
PLEASE HELP ME !!!!!!!!
Please give me an example !
Bravoone
|
|
|
|
|
I have CDialog base aplication with many CEdit and i want to jump from one CEdit to another with enter key ! You now how ?
And i want when i jump from a particulary CEdit to another to do something lets say : "Hello !" You now How ?
Bravoone
|
|
|
|
|
Flaviu_2006 wrote: i want to jump from one CEdit to another with enter key
overide the PreTranslateMessage message function and put the following code there
eg :
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg) <br />
{<br />
if( WM_KEYDOWN == pMsg->message )<br />
{<br />
if( VK_RETURN == pMsg->wParam )<br />
{<br />
pMsg->wParam = VK_TAB;<br />
}<br />
}<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}
nave
|
|
|
|
|
thanks but i have this problem :
when i jump with enter key and i rich to (lets say : m_edit) i want onchange lets say getwindowtext and setwindowtext to m_edit2 i want to jump forward to m_edit3 when i press enter key ! how ?????
thanks !!!
Bravoone
|
|
|
|
|
when the cursor came into m_edit, u will get the WM_SETFOCUS message. u can do the getwindowtext and setwindowtext from there..
eg:
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if( WM_KEYDOWN == pMsg->message )
{
if( VK_RETURN == pMsg->wParam )
{
pMsg->wParam = VK_TAB;
}
}
else if( WM_SETFOCUS == pMsg->message )
{
HWND hWindowHandle = (HWND)pMsg->wParam;
if( hWindowHandle == m_rich.m_hWnd )
{
// do GetWindowText or SetWindowText or what ever u want
}
}
return CDialog::PreTranslateMessage(pMsg);
}
nave
|
|
|
|
|
Is this previous question?
|
|
|
|
|
please someone help me please !
whitesky maybe you now how please tell me !
Bravoone
|
|
|
|
|
if its previous question you get two answers do you check those answers if yes whats happen if no whats question
|
|
|
|
|
yes both questions !!!!!!!!!!!!!!!!!!!!!!!i need answers !!!!!
plese help me with this !!!
Bravoone
|
|
|
|
|
i remember you have a loop but you can use from a thread in your code and you can read your databse in the thread
|
|
|
|
|
no is not work he jump forward to next edit and nothing is hapening !
you no how ?
this is the code :
BOOL CMyList::PreTranslateMessage(MSG* pMsg)
{
if( WM_KEYDOWN == pMsg->message )
{
if( VK_RETURN == pMsg->wParam )
{
pMsg->wParam = VK_TAB;
}
}
else if( WM_SETFOCUS == pMsg->message )
{
HWND hWindowHandle = (HWND)pMsg->wParam;
if( hWindowHandle == m_city.m_hWnd )
{
UpdateData();
CWaitCursor wait; // Display a wait cursor
//---------------------------------HEADER------------------------------------------//
int x = m_list2.GetItemCount();
for (int j = 0; j < x; j++) // For each item in the list
{
CString strWord;
strWord = m_list2.GetItemText(j, 0); // Get the word
strWord.TrimLeft(); // Remove leading spaces
strWord.TrimRight(); // Remove trailing spaces
// Overwrite the old word with the new trimmed word
m_list2.SetItemText(j, 0, strWord);
}
//----------------------------------------------------------------------------------//
CString sName, sCity, sCountry;
m_name.GetWindowText(sName);
m_city.GetWindowText(sCity);
sCountry.Empty();
for(int nItem = 0; nItem < m_list2.GetItemCount(); ++nItem)
{
CString const sFirstColumnText = m_list2.GetItemText( nItem, 0 );
CString const sSecondColumnText = m_list2.GetItemText( nItem, 1 );
if( sName == sFirstColumnText & sCity == sSecondColumnText)
{
sCountry = m_list2.GetItemText( nItem, 2 );
m_rezult.SetWindowText(sCountry);
}
}
}
}
return CDialog::PreTranslateMessage(pMsg);
}
he jump to m_rezult and ...nothig !
Bravoone
|
|
|
|
|
your problem is editbox or read databse?
|
|
|
|
|
i have 2 problems editbox and read database fast (load more fast in my CListCtrl )
Please help !!!!
Bravoone
|
|
|
|
|
remain one problem : (because i get the answer from somewere alse)anyway ... thanks but this is a serious question : how can i load data from my database more fast ? ( i need all the data to be loaded in my CListCtrl at one time...not 10 or 50 data at time when i scroll the list -- >> ALL DATA !!! )
PLEASE HELP ME !!!!!!!!!
Bravoone
|
|
|
|
|
if you want to read all records instead 10 to 10 or 10 to n see WM_TIMER that is a low priority message,see i say again thread AfxBeginThread or CWinThread::CreateThread
|
|
|
|
|
i don t understand please whitesky help me with my code !
give me an example please!!! (my code -> loop)
Bravoone
|
|
|
|
|
There is nobody how can help me PLEASE !!!!!!!!!!!!!!!!????????
Bravoone
|
|
|
|
|
Its not hard you can see an example WM_TIMER or a thread in codeproject after if you have error if i can i answer to you
|
|
|
|
|
Flaviu_2006 wrote: if( sName == sFirstColumnText & sCity == sSecondColumnText)
This is incorrect.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Your while loop should be:
int x = 0;
while (! pDataBase22->IsEOF())
{
int nItem = m_list.InsertItem(x, pDataBase22->m_name);
m_list.SetItemText(nItem, 1, pDataBase22->m_city);
pDataBase22->MoveNext();
x++;
}
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
this is not speed ! is the same thing is slow and take 5 - 10 min. to load my data !
You have any ideea on how can i done this ?????????
Please someone help me !!!!!!!!!!!!!!!!
Bravoone
|
|
|
|
|
Flaviu_2006 wrote: this is not speed ! is the same thing is slow and take 5 - 10 min. to load my data !
Speed issues aside, your code was plainly wrong. That's what I was correcting. You can surely handle the speed issues.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All,
I have implemented an 'auto version' into my resource file, the only problem is the .rc files needs to be recompiled for each build. As it is, VC6 has a "minimal rebuild" (/Gm and /GX flags) which will build partial and build clean, but a build clean takes too much time. Is there any way to force VC6 to compile and build a single file without building all of them?
|
|
|
|