|
I have created a MFC dialog based application.
I tried to use shared pointer, but it not geting compiled.
std::tr1::shared_ptr<CSharedpointerDlg> sharedpointer;
How to rectify this error
: error C2039: 'tr1' : is not a member of 'std'
: error C2065: 'shared_ptr' : undeclared identifier
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
VC++6 doesn't include TR1 - how could it? It shipped before the original C++ standard came out, never mind TR1!!!!
To get TR1 features, use VC++2008 or Boost's[^] implementation[^].
Oh and by the way - VC++6 is no longer supported in much of Boost, so you may have problems there.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
tr1 is not a part of the STL that ships with VC6.
try boost.
(heh... too late)
|
|
|
|
|
Hey guys,
I got a linker problem.. I have written some .h files and .cpp files for being used in any project, and put them to a folder named "common".
Now I have a project and I set up the vc directories. I add include and source file folders to there. And I include the main .h header file. Compiling is ok but when it comes to linking linker says unresolved external symbol ... So it couldn't find the body in the cpp file.
So how can I tell the linker to use the cpp file?
Thank you...
|
|
|
|
|
You don't tell the linker to use the cpp file - the cpp file's source code, but the linker wants object code...
What you need to do is give the linker a command line that tells it all the object files that are produced by the compiler, plus any import libraries for system libraries (DLLs) that you reference.
BTW - just suggesting here, but we might be able to help even more if you gave an exact error message.
|
|
|
|
|
Error 1 error LNK2019: unresolved external symbol "public: __thiscall CXControl::~CXControl(void)" (??1CXControl@@QAE@XZ) referenced in function "public: __thiscall CXDesktop::~CXDesktop(void)" (??1CXDesktop@@QAE@XZ) DX.obj
This is one of the errors...
SO how can I tell Linker/Compiler to do that
|
|
|
|
|
I should have read your original message more closely - anyway - what Code-o-mat said, add the cpp files to your VC++ project. It'll compile them and link their object files into the final executable.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
You need to add your cpp files to your project otherwise it won't know where it should look for the actual implementations of the methods and rest declared in the header files.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Actually this is exacly I am trying to avoid... I do not want to add .cpp files.
But if I have to then I will..
So any other suggestions?
|
|
|
|
|
Well, you could build libraries of your implementations and link to these using #import or such. I never did this so i don't know how it works but i believe that is one way of doing it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Create a separate static library project for the CPP files and get that to build a static library from the cpp files for you. Then, tell the project that uses that functionality to link against the static library.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yeah that's what I did.. Thank you.
I create a static library put all my .h and .cpp files in it and compile create my .lib file. And put it into my application. Now it works..
Thank you again.
|
|
|
|
|
Ribbon application crash on some systems while it works fine on others. I have statically linked to MFC. Still it crashes on random systems. I debugged it on the system on which it crashed and found that the FindByID returns NULL for CMFCRibbonSlider in OnUpdate.. function. Other ribbon controls are working fine.
CMFCRibbonBar* pRibbon = ((CMainFrame*) GetTopLevelFrame())->GetRibbonBar();<br />
ASSERT_VALID(pRibbon);<br />
CMFCRibbonSlider* pSlider = DYNAMIC_DOWNCAST(CMFCRibbonSlider, pRibbon->GetCategory(0)->FindByID(ID_EDIT_EXPAND_COLLAPSE));
Why does it return NULL only on some systems ?
What might be the problem?
Thanks in Advanc
|
|
|
|
|
i want to open particular (C directoy in separate browser window .how i do this?
|
|
|
|
|
Hello Pooja,
You can use ShellExecute() . Please see the code snippet.
ShellExecute( NULL, _T("explore"), _T("c:\\"), 0, 0, SW_SHOW );
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi i am using a grid in feature .
My requirement is to make a first 3 columns read only. and last i.e 4 th column
write only.
Please tell me which property should i use..
I am not able to find it . Please help
|
|
|
|
|
Finally i got the answer after lot of Hit & Trial methods..
if we have a pointer to VSFlexGrid say
m_pGrid ;
then
call m_pGrid->AutoSize (0,ComVariant(1L)) in the OnInitDialog()
|
|
|
|
|
#include "stdafx.h"
#include "MyPar.h"
#include "MyParDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX);
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
CMyParDlg::CMyParDlg(CWnd* pParent )
: CDialog(CMyParDlg::IDD, pParent)
{
m_sCity = _T("");
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CMyParDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_IMAGE, m_Image);
DDX_Control(pDX, IDC_COMBO_CHECKOUT_MONTHYEAR, m_cbCheckoutMonthYear);
DDX_Control(pDX, IDC_COMBO_GUEST_ROOMS, m_cbGuestRooms);
DDX_Control(pDX, IDC_COMBO_HOTELS, m_cbHotels);
DDX_Control(pDX, IDC_COMBO_STATE_PROV, m_cbStateProv);
DDX_Control(pDX, IDC_COMBO_CHECKIN_DAY, m_cbCheckinDay);
DDX_Control(pDX, IDC_COMBO_CHECKIN_MONTH_YEAR, m_cbCheckinMonthYear);
DDX_Control(pDX, IDC_COMBO_CHECKOUT_DAY, m_cbCheckoutDay);
DDX_Control(pDX, IDC_COMBO_COUNTRY, m_cbCountry);
DDX_Control(pDX, IDC_COMBO_SEARCH_WITHIN, m_cbSearchWithin);
DDX_Text(pDX, IDC_EDIT_CITY, m_sCity);
}
BEGIN_MESSAGE_MAP(CMyParDlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON1, OnStart)
END_MESSAGE_MAP()
BOOL CMyParDlg::OnInitDialog()
{
CDialog::OnInitDialog();
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
m_BMP.LoadBitmap(IDB_HILTON);
m_Image.SetBitmap(m_BMP);
FillSearchWithin();
FillStateProv();
FillCountry();
FillCheckinDay();
FillCheckinMonthYear();
FillCheckoutDay();
FillCheckoutMonthYear();
FillHotels();
FillGuestRooms();
m_cbSearchWithin.SetCurSel(4);
m_cbHotels.SetCurSel(0);
m_cbGuestRooms.SetCurSel(0);
m_cbCountry.SetCurSel(89);
UpdateData();
return FALSE;
}
void CMyParDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
void CMyParDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this);
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
HCURSOR CMyParDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CMyParDlg::OnOK()
{
CDialog::OnOK();
}
void CMyParDlg::OnStart()
{
BSTR bsStatus;
m_bReady=0;
m_bNextPage = 1;
CString sTemp;
UpdateData();
CString mPass("*****");
CString mUser("*****");
CString mCity("London");
CString mTopDestination("Test");
CString mState("Washington");
CString mCountry("United Kingdom");
CString mCheckInDay("28");
CString mCheckInMonthYr("Dec 2007");
CString mCheckOutDay("29");
CString mCheckOutMonthYr("Dec 2007");
BSTR bsCity = m_sCity.AllocSysString();
BSTR bsTopDestination = mTopDestination.AllocSysString();
int i = 0;
i = m_cbStateProv.GetCurSel();
i = m_cbCountry.GetCurSel();
i = m_cbCheckinDay.GetCurSel();
i = m_cbCheckinMonthYear.GetCurSel();
i = m_cbCheckoutDay.GetCurSel();
i = m_cbCheckoutMonthYear.GetCurSel();
CString mStr;
HRESULT hr1 ;
hr1 = CoInitialize(NULL);
if(!SUCCEEDED(hr1))
return ;
hr1 = CoCreateInstance (CLSID_InternetExplorer,
NULL, CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2, (LPVOID *)&m_pBrowser);
if(hr1==S_OK)
{
VARIANT_BOOL pBool=true;
m_pBrowser->put_Visible( pBool ) ;
COleVariant vaURL("http://www.hilton.com/") ;
COleVariant null;
m_pBrowser->Navigate2(vaURL,null,null,null,null) ;
while(!m_bReady)
{
m_pBrowser->get_StatusText(&bsStatus);
mStr=bsStatus;
if(mStr=="Done")m_bReady=1;
}
IDispatch* pDisp;
hr1=m_pBrowser->get_Document(&pDisp);
if (pDisp != NULL )
{
IHTMLDocument2* pHTMLDocument2;
HRESULT hr;
hr = pDisp->QueryInterface( IID_IHTMLDocument2,
(void**)&pHTMLDocument2 );
if (hr == S_OK)
{
IHTMLElementCollection* pColl = NULL;
hr = pHTMLDocument2->get_all( &pColl );
if (hr == S_OK && pColl != NULL)
{
LONG celem;
hr = pColl->get_length( &celem );
if ( hr == S_OK )
{
for ( int i=0; i< celem; i++ )
{
VARIANT varIndex;
varIndex.vt = VT_UINT;
varIndex.lVal = i;
VARIANT var2;
VariantInit( &var2 );
IDispatch* pDisp;
hr = pColl->item( varIndex,
var2, &pDisp );
if ( hr == S_OK )
{
IHTMLElement* pElem;
hr = pDisp->QueryInterface(
IID_IHTMLElement,
(void **)&pElem);
if ( hr == S_OK )
{
BSTR bstr;
hr = pElem->get_tagName(&bstr);
CString strTag;
strTag = bstr;
IHTMLInputTextElement* pUser;
hr = pDisp->QueryInterface(
IID_IHTMLInputTextElement,
(void **)&pUser );
if ( hr == S_OK )
{
pUser->get_name(&bstr);
mStr=bstr;
if(mStr=="city"){
pUser->put_value(bsCity);
}
pUser->Release();
}
else
{
IHTMLSelectElement* pUser;
hr = pDisp->QueryInterface(
IID_IHTMLSelectElement,
(void **)&pUser );
if ( hr == S_OK )
{
pUser->get_name(&bstr);
mStr=bstr;
if(mStr=="topDestination"){
}
else if(mStr == "state"){
pUser->put_selectedIndex(m_cbStateProv.GetCurSel() + 1);
}
else if(mStr == "country"){
pUser->put_selectedIndex(m_cbCountry.GetCurSel() + 1);
}
else if(mStr == "checkInDay"){
pUser->put_selectedIndex(m_cbCheckinDay.GetCurSel() + 1);
}
else if(mStr == "checkInMonthYr"){
pUser->put_selectedIndex(m_cbCheckinMonthYear.GetCurSel() +1);
}
else if(mStr == "checkOutDay"){
pUser->put_selectedIndex(m_cbCheckoutDay.GetCurSel() + 1);
}
else if(mStr == "checkOutMonthYr"){
pUser->put_selectedIndex(m_cbCheckoutMonthYear.GetCurSel() + 1);
}
}
IHTMLAnchorElement* pButton;
hr = pDisp->QueryInterface(
IID_IHTMLAnchorElement,
(void **)&pButton );
if ( hr == S_OK )
{
pButton->get_name(&bstr);
mStr=bstr;
}
}
pElem->Release();
}
pDisp->Release();
}
}
}
pColl->Release();
}
pHTMLDocument2->Release();
}
pDisp->Release();
}
}
MoreSearchOptions("fnSetRoomsReqSubmit");
}
void CMyParDlg::MoreSearchOptions(CString sLink)
{
BSTR bsStatus;
CString mStr,mLocation;
m_bReady=0;
HRESULT hr1;
IDispatch* pDisp;
hr1=m_pBrowser->get_Document(&pDisp);
if (pDisp != NULL )
{
IHTMLDocument2* pHTMLDocument2;
HRESULT hr;
hr = pDisp->QueryInterface( IID_IHTMLDocument2,
(void**)&pHTMLDocument2 );
if (hr == S_OK)
{
IHTMLElementCollection* pColl = NULL;
hr = pHTMLDocument2->get_all( &pColl );
if (hr == S_OK && pColl != NULL)
{
LONG celem;
hr = pColl->get_length( &celem );
if ( hr == S_OK )
{
for ( int i=0; i< celem; i++ )
{
VARIANT varIndex;
varIndex.vt = VT_UINT;
varIndex.lVal = i;
VARIANT var2;
VariantInit( &var2 );
IDispatch* pDisp;
hr = pColl->item( varIndex, var2, &pDisp );
if ( hr == S_OK )
{
IHTMLElement* pElem;
hr = pDisp->QueryInterface(
IID_IHTMLElement,
(void **)&pElem);
if ( hr == S_OK)
{
IHTMLAnchorElement* pLink;
hr = pDisp->QueryInterface(
IID_IHTMLAnchorElement,
(void **)&pLink);
if ( hr == S_OK)
{
BSTR bstr;
hr = pLink->get_href(&bstr);
if(hr == S_OK){
CString strTag;
strTag = bstr;
if(strTag.Find(sLink)>=0 ){
pElem->click();
i=celem;
}
}
pLink->Release();
}
pElem->Release();
}
pDisp->Release();
}
}
pColl->Release();
}
}
pHTMLDocument2->Release();
}
pDisp->Release();
}
CString statustext="OK";
m_pBrowser->put_StatusText(statustext.AllocSysString());
m_bReady=0;
while(!m_bReady)
{
m_pBrowser->get_StatusText(&bsStatus);
mStr=bsStatus;
if(mStr=="Done")m_bReady=1;
}
while(m_bNextPage)
{
GoToNextPage("next.gif");
}
AfxMessageBox("Completed!");
}
void CMyParDlg::GoToNextPage(CString sLink)
{
BSTR bsStatus;
CString mStr,mLocation;
m_bReady=0;
HRESULT hr1;
IDispatch* pDisp;
hr1=m_pBrowser->get_Document(&pDisp);
if (pDisp != NULL )
{
IHTMLDocument2* pHTMLDocument2;
HRESULT hr;
hr = pDisp->QueryInterface( IID_IHTMLDocument2,
(void**)&pHTMLDocument2 );
if (hr == S_OK)
{
IHTMLElementCollection* pColl = NULL;
hr = pHTMLDocument2->get_all( &pColl );
if (hr == S_OK && pColl != NULL)
{
LONG celem;
hr = pColl->get_length( &celem );
if ( hr == S_OK )
{
for ( int i=0; i< celem; i++ )
{
VARIANT varIndex;
varIndex.vt = VT_UINT;
varIndex.lVal = i;
VARIANT var2;
VariantInit( &var2 );
IDispatch* pDisp;
hr = pColl->item( varIndex, var2, &pDisp );
if ( hr == S_OK )
{
IHTMLElement* pElem;
hr = pDisp->QueryInterface(
IID_IHTMLElement,
(void **)&pElem);
if ( hr == S_OK)
{
IHTMLImgElement* pLink;
hr = pDisp->QueryInterface(
IID_IHTMLImgElement,
(void **)&pLink);
if ( hr == S_OK)
{
BSTR bstr;
hr = pLink->get_href(&bstr);
if(hr == S_OK){
CString strTag;
strTag = bstr;
if(strTag.Find(sLink)>=0 ){
pElem->click();
i=celem;
m_bNextPage = TRUE;
}
else
{
m_bNextPage = FALSE;
}
}
pLink->Release();
}
pElem->Release();
}
pDisp->Release();
}
}
pColl->Release();
}
}
pHTMLDocument2->Release();
}
pDisp->Release();
}
CString statustext="OK";
m_pBrowser->put_StatusText(statustext.AllocSysString());
m_bReady=0;
while(!m_bReady)
{
m_pBrowser->get_StatusText(&bsStatus);
mStr=bsStatus;
if(mStr=="Done")m_bReady=1;
}
}
void CMyParDlg::FillSearchWithin()
{
m_cbSearchWithin.AddString("5");
m_cbSearchWithin.AddString("10");
m_cbSearchWithin.AddString("25");
m_cbSearchWithin.AddString("30");
m_cbSearchWithin.AddString("40");
m_cbSearchWithin.AddString("50");
}
void CMyParDlg::FillStateProv()
{
m_cbStateProv.AddString("AE (Area Europe)");
m_cbStateProv.AddString("Alabama");m_cbStateProv.AddString("Alaska");
m_cbStateProv.AddString("AP (Area Pacific)");m_cbStateProv.AddString("Arizona");
m_cbStateProv.AddString("Arkansas");m_cbStateProv.AddString("California");
m_cbStateProv.AddString("Colorado");m_cbStateProv.AddString("Connecticut");
m_cbStateProv.AddString("Delaware");m_cbStateProv.AddString("District of Columbia");
m_cbStateProv.AddString("Florida");m_cbStateProv.AddString("Georgia");
m_cbStateProv.AddString("Hawaii");m_cbStateProv.AddString("Idaho");
m_cbStateProv.AddString("Illinois");m_cbStateProv.AddString("Indiana");
m_cbStateProv.AddString("Iowa");m_cbStateProv.AddString("Kansas");
m_cbStateProv.AddString("Kentucky");m_cbStateProv.AddString("Louisiana");
m_cbStateProv.AddString("Maine");m_cbStateProv.AddString("Maryland");
m_cbStateProv.AddString("Massachusetts");m_cbStateProv.AddString("Michigan");
m_cbStateProv.AddString("Minnesota");m_cbStateProv.AddString("Mississippi");
m_cbStateProv.AddString("Missouri");m_cbStateProv.AddString("Montana");
m_cbStateProv.AddString("Nebraska");m_cbStateProv.AddString("Nevada");
m_cbStateProv.AddString("New Hampshire");m_cbStateProv.AddString("New Jersey");
m_cbStateProv.AddString("New Mexico");m_cbStateProv.AddString("New York");
m_cbStateProv.AddString("North Carolina");m_cbStateProv.AddString("North Dakota");
m_cbStateProv.AddString("Ohio");m_cbStateProv.AddString("Oklahoma");
m_cbStateProv.AddString("Oregon");m_cbStateProv.AddString("Pennsylvania");
m_cbStateProv.AddString("Puerto Rico");m_cbStateProv.AddString("Rhode Island");
m_cbStateProv.AddString("South Carolina");m_cbStateProv.AddString("South Dakota");
m_cbStateProv.AddString("Tennessee");m_cbStateProv.AddString("Texas");
m_cbStateProv.AddString("Utah");m_cbStateProv.AddString("Vermont");
m_cbStateProv.AddString("Virginia");m_cbStateProv.AddString("Washington");
m_cbStateProv.AddString("West Virginia");m_cbStateProv.AddString("Wisconsin");
m_cbStateProv.AddString("Wyoming");m_cbStateProv.AddString("Alberta");
m_cbStateProv.AddString("British Columbia");m_cbStateProv.AddString("Manitoba");
m_cbStateProv.AddString("New Brunswick");m_cbStateProv.AddString("Newfoundland");
m_cbStateProv.AddString("Northwest Territories");m_cbStateProv.AddString("Nova Scotia");
m_cbStateProv.AddString("Nunavut");m_cbStateProv.AddString("Ontario");
m_cbStateProv.AddString("Prince Edward Island");m_cbStateProv.AddString("Quebec");
m_cbStateProv.AddString("Saskatchewan");m_cbStateProv.AddString("Yukon Territory");
}
void CMyParDlg::FillCountry()
{
m_cbCountry.AddString("Canada");m_cbCountry.AddString("Algeria");
m_cbCountry.AddString("Argentina");m_cbCountry.AddString("Australia");
m_cbCountry.AddString("Austria");m_cbCountry.AddString("Bahamas");
m_cbCountry.AddString("Bahrain");m_cbCountry.AddString("Barbados");
m_cbCountry.AddString("Belgium");m_cbCountry.AddString("Brazil");
m_cbCountry.AddString("British Ind. Ocean Territory");m_cbCountry.AddString("Bulgaria");
m_cbCountry.AddString("Cameroon");m_cbCountry.AddString("Canada");
m_cbCountry.AddString("China");m_cbCountry.AddString("Colombia");
m_cbCountry.AddString("Costa Rica");m_cbCountry.AddString("Croatia");
m_cbCountry.AddString("Curacao");m_cbCountry.AddString("Cyprus");
m_cbCountry.AddString("Czech Republic");m_cbCountry.AddString("Denmark");
m_cbCountry.AddString("Dominican Republic");m_cbCountry.AddString("Ecuador");
m_cbCountry.AddString("Egypt");m_cbCountry.AddString("El Salvador");
m_cbCountry.AddString("Estonia");m_cbCountry.AddString("Ethiopia");
m_cbCountry.AddString("Fiji");m_cbCountry.AddString("Finland");
m_cbCountry.AddString("France");m_cbCountry.AddString("Germany");
m_cbCountry.AddString("Greece");m_cbCountry.AddString("Guam");
m_cbCountry.AddString("Honduras");m_cbCountry.AddString("Hungary");
m_cbCountry.AddString("Iceland");m_cbCountry.AddString("India");
m_cbCountry.AddString("Indonesia");m_cbCountry.AddString("Ireland");
m_cbCountry.AddString("Israel");m_cbCountry.AddString("Italy");
m_cbCountry.AddString("Ivory Coast(Cote D'Ivoire)");m_cbCountry.AddString("Jamaica");
m_cbCountry.AddString("Japan");m_cbCountry.AddString("Kenya");
m_cbCountry.AddString("Kuwait");m_cbCountry.AddString("Lithuania");
m_cbCountry.AddString("Luxembourg");m_cbCountry.AddString("Madagascar");
m_cbCountry.AddString("Malaysia");m_cbCountry.AddString("Maldives");
m_cbCountry.AddString("Malta");m_cbCountry.AddString("Mauritius");
m_cbCountry.AddString("Mexico");m_cbCountry.AddString("Mongolia");
m_cbCountry.AddString("Morocco");m_cbCountry.AddString("Netherlands");
m_cbCountry.AddString("New Zealand");m_cbCountry.AddString("Nicaragua");
m_cbCountry.AddString("Nigeria");m_cbCountry.AddString("Norway");
m_cbCountry.AddString("Oman");m_cbCountry.AddString("Peru");
m_cbCountry.AddString("Philippines");m_cbCountry.AddString("Poland");
m_cbCountry.AddString("Portugal");m_cbCountry.AddString("Puerto Rico");
m_cbCountry.AddString("Romania");m_cbCountry.AddString("Russian Federation");
m_cbCountry.AddString("Saint Lucia");m_cbCountry.AddString("Saudi Arabia");
m_cbCountry.AddString("Seychelles");m_cbCountry.AddString("Singapore");
m_cbCountry.AddString("South Africa");m_cbCountry.AddString("South Korea");
m_cbCountry.AddString("Spain");m_cbCountry.AddString("Sri Lanka");
m_cbCountry.AddString("Sudan");m_cbCountry.AddString("Sweden");
m_cbCountry.AddString("Switzerland");m_cbCountry.AddString("Taiwan");
m_cbCountry.AddString("Thailand");m_cbCountry.AddString("Trinidad/Tobago");
m_cbCountry.AddString("Tunisia");m_cbCountry.AddString("Turkey");
m_cbCountry.AddString("U.A.E");m_cbCountry.AddString("United Kingdom");
m_cbCountry.AddString("Uruguay");m_cbCountry.AddString("USA");
m_cbCountry.AddString("Venezuela");m_cbCountry.AddString("Vietnam");
}
void CMyParDlg::FillCheckinDay()
{
m_cbCheckinDay.AddString("1");m_cbCheckinDay.AddString("2");
m_cbCheckinDay.AddString("3");m_cbCheckinDay.AddString("4");
m_cbCheckinDay.AddString("5");m_cbCheckinDay.AddString("6");
m_cbCheckinDay.AddString("7");m_cbCheckinDay.AddString("8");
m_cbCheckinDay.AddString("9");m_cbCheckinDay.AddString("10");
m_cbCheckinDay.AddString("11");m_cbCheckinDay.AddString("12");
m_cbCheckinDay.AddString("13");m_cbCheckinDay.AddString("14");
m_cbCheckinDay.AddString("15");m_cbCheckinDay.AddString("16");
m_cbCheckinDay.AddString("17");m_cbCheckinDay.AddString("18");
m_cbCheckinDay.AddString("19");m_cbCheckinDay.AddString("20");
m_cbCheckinDay.AddString("21");m_cbCheckinDay.AddString("22");
m_cbCheckinDay.AddString("23");m_cbCheckinDay.AddString("24");
m_cbCheckinDay.AddString("25");m_cbCheckinDay.AddString("26");
m_cbCheckinDay.AddString("27");m_cbCheckinDay.AddString("28");
m_cbCheckinDay.AddString("29");m_cbCheckinDay.AddString("30");
m_cbCheckinDay.AddString("31");
}
void CMyParDlg::FillCheckinMonthYear()
{
m_cbCheckinMonthYear.AddString("Dec 2007");m_cbCheckinMonthYear.AddString("Jan 2008");
m_cbCheckinMonthYear.AddString("Feb 2008");m_cbCheckinMonthYear.AddString("Mar 2008");
m_cbCheckinMonthYear.AddString("Apr 2008");m_cbCheckinMonthYear.AddString("May 2008");
m_cbCheckinMonthYear.AddString("Jun 2008");m_cbCheckinMonthYear.AddString("Jul 2008");
m_cbCheckinMonthYear.AddString("Sep 2008");m_cbCheckinMonthYear.AddString("Oct 2008");
m_cbCheckinMonthYear.AddString("Nov 2008");m_cbCheckinMonthYear.AddString("Dec 2008");
}
void CMyParDlg::FillCheckoutDay()
{
m_cbCheckoutDay.AddString("1");m_cbCheckoutDay.AddString("2");
m_cbCheckoutDay.AddString("3");m_cbCheckoutDay.AddString("4");
m_cbCheckoutDay.AddString("5");m_cbCheckoutDay.AddString("6");
m_cbCheckoutDay.AddString("7");m_cbCheckoutDay.AddString("8");
m_cbCheckoutDay.AddString("9");m_cbCheckoutDay.AddString("10");
m_cbCheckoutDay.AddString("11");m_cbCheckoutDay.AddString("12");
m_cbCheckoutDay.AddString("13");m_cbCheckoutDay.AddString("14");
m_cbCheckoutDay.AddString("15");m_cbCheckoutDay.AddString("16");
m_cbCheckoutDay.AddString("17");m_cbCheckoutDay.AddString("18");
m_cbCheckoutDay.AddString("19");m_cbCheckoutDay.AddString("20");
m_cbCheckoutDay.AddString("21");m_cbCheckoutDay.AddString("22");
m_cbCheckoutDay.AddString("23");m_cbCheckoutDay.AddString("24");
m_cbCheckoutDay.AddString("25");m_cbCheckoutDay.AddString("26");
m_cbCheckoutDay.AddString("27");m_cbCheckoutDay.AddString("28");
m_cbCheckoutDay.AddString("29");m_cbCheckoutDay.AddString("30");
m_cbCheckoutDay.AddString("31");
}
void CMyParDlg::FillCheckoutMonthYear()
{
m_cbCheckoutMonthYear.AddString("Dec 2007");m_cbCheckoutMonthYear.AddString("Jan 2008");
m_cbCheckoutMonthYear.AddString("Feb 2008");m_cbCheckoutMonthYear.AddString("Mar 2008");
m_cbCheckoutMonthYear.AddString("Apr 2008");m_cbCheckoutMonthYear.AddString("May 2008");
m_cbCheckoutMonthYear.AddString("Jun 2008");m_cbCheckoutMonthYear.AddString("Jul 2008");
m_cbCheckoutMonthYear.AddString("Sep 2008");m_cbCheckoutMonthYear.AddString("Oct 2008");
m_cbCheckoutMonthYear.AddString("Nov 2008");m_cbCheckoutMonthYear.AddString("Dec 2008");
}
void CMyParDlg::FillHotels()
{
m_cbHotels.AddString("Hilton Hotels");m_cbHotels.AddString("All Hilton Family Hotels");
}
void CMyParDlg::FillGuestRooms()
{
m_cbGuestRooms.AddString("1-4");
m_cbGuestRooms.AddString("5");m_cbGuestRooms.AddString("6");
m_cbGuestRooms.AddString("7");m_cbGuestRooms.AddString("8");
m_cbGuestRooms.AddString("9");m_cbGuestRooms.AddString("10");
m_cbGuestRooms.AddString("11");m_cbGuestRooms.AddString("12");
m_cbGuestRooms.AddString("13");m_cbGuestRooms.AddString("14");
m_cbGuestRooms.AddString("15");m_cbGuestRooms.AddString("16");
m_cbGuestRooms.AddString("17");m_cbGuestRooms.AddString("18");
m_cbGuestRooms.AddString("19");m_cbGuestRooms.AddString("20");
m_cbGuestRooms.AddString("21");m_cbGuestRooms.AddString("22");
m_cbGuestRooms.AddString("23");m_cbGuestRooms.AddString("24");
m_cbGuestRooms.AddString("25");m_cbGuestRooms.AddString("26 or more");
}
|
|
|
|
|
|
1. I got bored after the 83rd paragraph.
2. We play by rules[^] here.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
What is it?
if its an article you can submit it on the codeproject
if you have any question please say it
if you have any bug in this code please dont copy all your code.
and please use of correct title.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
42....well someone had to do it.
|
|
|
|
|
Hi all
i m using GotoDlgCtrl for set focus on button control in dialog box.becoz setfocus function not working on button control.
but GotoDlgCtrl is not working in form view.
so please tell me what can i use for setfocus on button control in formview.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
If this is MFC, a formview is just a wrapper around a modeless dialog box.
So, rather than setfocus...
WM_NEXTDLGCTL
This message performs additional dialog box management operations beyond those performed by the SetFocus function WM_NEXTDLGCTL updates the default pushbutton border, sets the default control identifier, and automatically selects the text of an edit control (if the target window is an edit control).
Hope that helps!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thanks sir its done now.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
modified on Friday, February 27, 2009 7:22 AM
|
|
|
|
|