|
|
I would like to convert the following code to return the values of m_data as a return value of Display, instead of using 'cout'. Can I for example, return a list of strings, by inheriting from CGenericList itself? Any ideas?
GenericList.h
--------------------
template<class T>
class CGenericList
#pragma once
#include ".\GenericNode.h"
#include <iostream>
using namespace std;
...
T Display()
{
CGenericNode<T> *pTemp = m_pFirst;
while(pTemp != NULL)
{
cout << pTemp->m_data << _T(" ");
pTemp = pTemp->m_pNextNode;
}
cout << endl;
}
GenericNode.h
-----------------------------
#pragma once
#include <stdlib.h>
Also, these errors were not showing up before I inherited CGenericList, what is the problem here?
GenericList.h(99): error C3861: '_T': identifier not found, even with argument-dependent lookup.
GenericList.h(99): error C2593: 'operator <<' is ambiguous... I haven't overloaded '<<'.
Jon
|
|
|
|
|
I have no problem getting at controls in a window using the handle, but does anyone know how I may get at the labels or memory that might contain them?
|
|
|
|
|
Billydo wrote: get at the labels or memory that might contain them?
what do u mean?
If u want to get the text in that control, u can use GetWindowText().
nave
|
|
|
|
|
|
Can anybody help me with this error?
During debug mode I have receive this error message:
MSVCRT.DLL: Access Violation.
But if i Run my application on Release Mode. No error occured.
Your help is appreciated.
|
|
|
|
|
|
The best approach is always to use the debugger. Run your program under the debugger (Build, Start Debug, Go). Do whatever you did to make the error occur. You'll get a dialog box reporting a 'First chance exception in MSVCRT.DLL (code 0xc0000005)'. Note the position of the instruction pointer. Look at the call stack window to see which part of your program called into the C runtime.
You probably passed a NULL or invalid pointer into the C runtime somewhere. Most commonly this is due to an uninitialised variable: the debug version of the C runtime will initialise the stack to 0xCCCCCCCC, while the release version does not do this. The reason for doing this in debug mode is specifically to catch uses of bad pointers.
|
|
|
|
|
how to set a dialog to be modal dialog??? i want to set a pop up dialog to be modal dialog, can i set it by code?
|
|
|
|
|
just create and object of that dialog and call DoModal function.
eg:
CMydialog MyDlg;
MyDlg.DoModal();
nave
|
|
|
|
|
But i can't.
because i create the dialog by pointer
CMydialog* MyDlg;
And i use
this->MyDlg->ShowWindow(SW_SHOW);
to show the window...
But it is not modal window...
I want to set it to be model window...
how can i do it?
Thx
|
|
|
|
|
CMydialog* MyDlg = new CMydialog();
MyDlg->DoModal();
What prevent u from calling like this...?
nave
|
|
|
|
|
|
But i can't.
because i create the dialog by pointer
CMydialog* MyDlg;
And i use
this->MyDlg->ShowWindow(SW_SHOW);
to show the window...
But it is not modal window...
I want to set it to be model window...
how can i do it?
Thx
|
|
|
|
|
Did you get your answer with Naveen R answer
|
|
|
|
|
Anybody who is very familiar with WIN CE 4.2 emulator? I 'm using VC++ 6.0, together with embedded VC++ 4 to develope 2 programs, one on the desk top, using VC++6.0, and the other on emulator platform, on the same desktop. These 2 programs are to communicate with each other using sockets. However, there seems to be limitation on the emulator as it prevents such communications.
-- modified at 2:52 Tuesday 15th August, 2006
|
|
|
|
|
Ensure that you have a virtual network adapter enabled. In eVC, go to Tools, Configure Platform Manager, select the emulator from the tree, click Properties, then click Configure next to 'Emulator Startup Server'. From here, select either 'NAT (Outgoing only)' if the emulated CE device has to connect to the PC, or 'VirtualSwitch'. Selecting 'VirtualSwitch' makes the device effectively appear as an additional network card on your machine.
You then may need to configure the network card inside the emulator.
You might need the Virtual Machine Network Driver[^] to make VirtualSwitch work.
|
|
|
|
|
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?
|
|
|
|