perhaps you should use CStringArray m_pszMyString m_pszMyString.Add("1"); m_pszMyString.Add("2"); m_pszMyString.Add("3"); if(m_pszMyString.GetAt(0) == "1") { .. bla } hope it helps for people who think life is like a comedy for people who feel is a tragedy Whapole
DanielO
Posts
-
pointer to a CSTring? -
How to connect to a databasehi, i suppose you can do like this... go windows, control panel, data sources obbc (via system/admin tools in W2K) tab system dns add new choose sql server... etc. in MFC 6.0 Add a new class, derived of CRecordSet, choose your new made sql server connection and pick your table hope it helps, DanielO
-
SDKHi, is your software unicode compiled ? japanese,chinese do use extension char sets DanielO
-
Beep function doesn't work corretly !!Hi, perhaps: see in your msdn SystemParametersInfo with SPI_SETBEEP, SPI_GETBEEP DanielO
-
ODBC & SQL - Modify the "Table" name in Excelhi, perhaps you could use automation execel look at www.microsoft.com - knowledge base HOWTO: Create Automation Project Using MFC and a Type Library (Q178749) HOWTO: Use MFC to Automate Excel and Create/Format a New Workbook (Q179706) hope it helps Daniel O
-
How to connect to a databasehi, There are many ways, but first what kind of database you use? (Oracle or MS Access database) and what development envir. you are using? (VC++ 6.0 or VB6) DanielO
-
SQL - SELECT DISTINCT myfieldhi, you could try the following SELECT DISTINCT CUSTOMER_NAME ID CHECKED FOUNDWITH FROM Emails WHERE checked = False ORDER BY foundwith for all fields except url or SELECT DISTINCT URL FROM Emails WHERE checked = False ORDER BY foundwith for url field only you are right about "Select * Distinct .." won't work Daniel O
-
Weirdness comes again, Open via ADOhi, i just tested your idea, and you are right!! thank you ;) DanielO
-
Weirdness comes again, Open via ADOhi, i have a access database with serveral tables, one of the table was named "Language" While opening via ADO like: pRecordset->Open ((IDispatch *) pCommand, vtMissing, adOpenForwardOnly, adLockReadOnly, adCmdUnknown); which generates a unknown error (" (1)") -> try catch after almost two hours of debugging i couldn't figured out why it didn't work but then i renamed the table in "LangTexts" and everything works fine! i wonder what another names shouldn't be used........... DanielO :confused:
-
the connection object and recorsetshi, Look at article: ADO at a glance on this website for better understanding DanielO
-
Dialog windowshu? CParentDlg::ShowChild() { dialog dlg ShowWindow(SW_HIDE) if( dlg.DoModal()== IDOK) { //bla bla } ShowWindow(SW_SHOW) -Drawing on that plain dlg that OnPaint (WM_DRAW) message should do no harm Daniel O
-
COleSafeArrayhi, if you use a function like this where you give in strValue your "Lastname" void FillSafeArray(CString strValue, int iRow, int iCol, COleSafeArray* sa) { VARIANT v; long index[2]; index[0] = iRow; index[1] = iCol; VariantInit(&v); v.vt = VT_BSTR; v.bstrVal = strValue.AllocSysString(); sa->PutElement(index, v.bstrVal); SysFreeString(v.bstrVal); VariantClear(&v); } hope it helps, DanielO
-
VARIANT and CStringVARIANT v; CString strValue; //TCHAR sz[5]; VariantInit(&v); v.vt = VT_BSTR; v.bstrVal = strValue.AllocSysString(); //v.bstrVal = SysAllocString(sz); //do something with variant SysFreeString(v.bstrVal); VariantClear(&v); another way around Variant v; //variant gets value CString strValue(v.bstrVal); hope it helps DanielO