|
int filenumber;
CString Pathname[20],Filename[20];
CFileDialog fd (TRUE,NULL,NULL,
OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT
,"DCL FILE|*.DCL||");
if (fd.DoModal()==IDOK)
{
POSITION pos;
pos = fd.GetStartPosition();
filenumber = 0;
while (pos!=NULL)
{
Pathname[filenumber] = fd.GetNextPathName(pos);
TRACE("Pathname[%d]=%s\n",filenumber,
Pathname[filenumber]);
filenumber++;
}
When Open file more than 8 file together it will generate error.
Anybody know how to solve this problem?
|
|
|
|
|
|
See
<br />
int filenumber = 0;<br />
POSITION pos;<br />
CString Pathname[20];<br />
char* lptstr = new char[256];<br />
<br />
CFileDialog m_FileDialog(1,0,0,OFN_ALLOWMULTISELECT | OFN_EXPLORER);<br />
<br />
m_FileDialog.m_ofn.nMaxFile = 256;<br />
m_FileDialog.m_ofn.lpstrFile = lptstr;<br />
m_FileDialog.m_ofn.lpstrFile[0] = NULL;<br />
<br />
m_FileDialog.DoModal();<br />
<br />
<br />
pos = m_FileDialog.GetStartPosition();<br />
while (pos!=NULL)<br />
{<br />
Pathname[filenumber] = m_FileDialog.GetNextPathName(pos);<br />
TRACE("Pathname[%d]=%s\n",filenumber,Pathname[filenumber]);<br />
filenumber++;<br />
}<br />
|
|
|
|
|
Is there a way to know the color in which slider ticks should be painted by system?
Thanks.
|
|
|
|
|
Does this[^]helps you ? Using option COLOR_SCROLLBAR .
|
|
|
|
|
No, I've already checked all possible arguments to GetSysColor, no one match the color with which ticks painted... I expect this may be related to themes, because I work in WinXP, but how to be in this case?
|
|
|
|
|
Hello everyone,
I am going to design a Cache in C/C++ (memory cache). I have two different approaches to design/implement it, any comments will be appreciated.
Design 1, using a map (hashtable) to store key --> object pointer relationship (simple and straight forward);
Design 2, store real object or object pointer in a stack/linked list/queue/array as an internal storage data structure, then using a map (hashtable) as an external interface to mapping key --> index in the stack/linked list/queue/array; (in this design, when accessing an object, we need two times mapping, first mapping key to index in the stack/linked list/queue/array, then using the index to access the real object)
I am wondering any advantages or disadvantages of the two designs. Any better design approach suggestion will be appreciated.
thanks in advance,
George
|
|
|
|
|
I would like to know how to inherit from classes and set protected properties of the base class within the derived class:
class mammal
{
protected:
mammal (bool pFacialhair) {facialhair = pFacialhair;};
bool facialhair;
};
class dog : public mammal
{
private:
bool takingapiss;
public:
dog()
{
facialhair = true;
};
int legs;
};
Error:
error C2512: 'mammal' : no appropriate default constructor available
Jon
|
|
|
|
|
you dog class should be like this:
class dog : public mammal
{
private:
bool takinggapiss;
public:
dog(bool pFacialhair):mammal(pFacialhair)
{
....
}
...
}
when class dog inherits class mammal, the construction of an object of class mammal must be finished before the construction of the object of class dog. because you don't have a default constructor for class mammal, you have to provide an argument for the construction of mammal in the constructor of class dog.
I don't know if I have made myself clear.
-- modified at 7:08 Saturday 9th September, 2006
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
ewighell wrote: your dog class should be like this:
dog::dog(bool pFacialhair)
: mammal(pFacialhair) {
//...
}
or like this...
dog::dog()
: mammal(true) {
}
|
|
|
|
|
First, UNICODE has been defined in my program.
Second, my CString involves Chinese characters as well as English letters.
the following piece of code runs correctly and the format of the resulted file "myTxt.txt" is Unicode
CFile file(_T("myTxt.txt"), CFile::modeCreate|CFile::modeWrite);
CArchive ar(&file, CArchive::store, 512);
CString str;
str = _T("Welcome 张三");
TRACE(str);
ar.WriteString(str);
however, the following piece of code dose not run correctly and the format of the resulted file "myTxt.txt" is ANSI
CFile file(_T("myTxt.txt"), CFile::modeCreate|CFile::modeWrite);
CArchive ar(&file, CArchive::store, 512);
CString str;
str = m_ListCtrl.getItemText(0,0);
TRACE(str);
ar.WriteString(str);
isn't it weird? anybody has any idea?
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
|
thank you
-------------------
I am learning C++ and English
|
|
|
|
|
|
Hi
Can any one help me in storing integer values(3-4 values) which i get from a grid control in a Safearray....nd i need to use them again after storing....
This is the code which i wrote is this OK..
SAFEARRAY *intPixels;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 3;
intPixels = SafeArrayCreate(VT_I4,1,rgsabound);
int tempint_j = 0,tempint_p = 0;
for(int i = 0;i < 3;i = i+1)
{
CString tempStr; //Getting Values from Grid
tempStr = m_Grid.GetTextArray(i);
//convert values from String to int
//as they are from grid
int tempint_a = atoi(tempStr);
SafeArrayPutElement(intPixels,(long *)&tempint_j,(void *)&tempint_a);
tempint_j= tempint_j + 1;
}
Will the above code stores the values obtained from the Grid control(m_Grid) in the Safe Array.... if this stores the integer values in SafeArray pls tell me how to get them back to Use them.....?
Thanks
|
|
|
|
|
Do you need to SafeArrayGetElement
|
|
|
|
|
I need to get the Values which i stored in the SafeArray Back.....by the by is the above code correct in storing the values in the safearray..
|
|
|
|
|
See here[^]maybe it is some helpful to you
|
|
|
|
|
Hi All's
i trying to making a project in VC++ as front end and mysql as backend
but whenever i build it generate an fatel error " libmysql.lib error"
i check in my system( computer at VC++ ) library there is in ..\\lib\opt
only libMySQL .There is not libmysql.lib ,
how i solve this problem.
What is its exact path from downloding internet.
please help me.
-- modified at 7:14 Saturday 9th September, 2006
mailing me
Yogi
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
you mean you have libMySQL.lib? case sensitivity should not matter here. Make sure that path to library is known to VC++. If you not have libMySQL.lib at all, you can download MySQL server from http://dev.mysql.com/downloads/mysql/5.0.html
|
|
|
|
|
hello everybody, i'm living in VietNam, i don't known how to write vietnamese in VC++ example in font time news roman,please help me. thanks a lot.
hall
|
|
|
|
|
|
thanks u for reply my question, Vietnamese in VC++,I mean that in the List Box, on the command botton...the language is Vietnamese, in VC++,I can do it in
some fonts, but in my country we usually use font TIME NEWS ROMAN and this font i can't write in Vietnamese. you can try write simple example to understand my ideal. if have any trouble to see, i will send to u an example.Thank u very much.
hall
|
|
|
|
|
Do you need to write your language in your program?
|
|
|
|