|
bugDanny wrote:
You mean that I should read the whole file into a buffer, not just word by word.
Correct.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I am using rich edit control in dialog based application. I have copied this piece of code from a book but it is giving me an error. Please check what is this.
DWORD CALLBACK WriteEditData(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG FAR *pcb)
{
CFile *pFile = reinterpret_cast<cfile*>(dwCookie);
try
{
pFile->Write(pbBuff,cb);
}
catch(CFileException *pEx)
{
pEx->Delete();
*pcb = 0;
return 0;
}
*pcb = cb;
return 1;
}
void CRE4View::OnBStr()
{
CFile fWrite("C:\\file.rtf", CFile::modeReadWrite);
EDITSTREAM strm;
strm.dwCookie = reinterpret_cast<dword> (fWrite); //error
strm.pfnCallback = WriteEditData;
m_Info.StreamOut(SF_RTF, strm);
}
Error message is,
error C2440: 'reinterpret_cast' : cannot convert from 'class CFile' to 'unsigned long'
Please reply.
Aqueel A. Mirza
We Believe in Excellence
|
|
|
|
|
I would think that since WriteEditData() is casting dwCookie to a pointer, then you would also have to send it a pointer like:
strm.dwCookie = reinterpret_cast (&fWrite);
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanks it works...
We Believe in Excellence
|
|
|
|
|
Ich want to know which windows-design is selected by the current user.
Is the any method to detect it?
I need this, because some control-elements have not the same size in the different styles an I want to adept my programm.
thanks
Gabriel
|
|
|
|
|
See here for starters.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
hi,
Is anybody knows how to convert icon into bitmap using either "public: Bitmap* ToBitmap()" command or using anyother command in vc++.
thank you
|
|
|
|
|
rgchezhian wrote:
Is anybody knows how to convert icon into bitmap using either "public: Bitmap* ToBitmap()" command
I presume it would be something like:
CIcon icon;<br />
Bitmap *bitmap = icon.ToBitmap();
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
i think there is no class as CIcon in vc++.
|
|
|
|
|
|
can anyone help me in making a very nice interface of traveling salesman problem using genetic algorithm. its a user defined interface wherein the user will input sets of points and the program will be to create a graphics about what the user have inputted. hope somebody can help me with this im just a student and i really am not yet familiar with the language hope someone will reply me to this urgently. thanks a lot in advance.
lester
|
|
|
|
|
|
any nice visible interface in the net. an example of a user-defined representation? pls help me!
lester
|
|
|
|
|
I think one of the projects here on CodeProject uses this library.
I have not used it in a project yet.
|
|
|
|
|
how do i get the directory of internet explorer so i can launch a help file in html format using winexec?
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote:
...using winexec?
Use ShellExecute() instead.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
DavidCrow wrote:
ShellExecute()
what parameters does it take?
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote:
what parameters does it take?
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
can u please write the function with the parameters for a file named C:\help\index.htm?
coz it didnt work
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote:
coz it didnt work
What does your code look like that did not work?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
ShellExecute(NULL,"open","C:\\help\\index.htm",NULL,NULL,SW_SHOWDEFAULT);
/\|-||\/|/\|)
|
|
|
|
|
I assume a browser window did not open the specified file. What value did ShellExecute() return?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
assume a browser window did not open the specified file.
Yes it is true
the value is 2
/\|-||\/|/\|)
|
|
|
|
|
|
Halawlaws wrote:
the value is 2
Look at the link I provided you earlier. 2 = ERROR_FILE_NOT_FOUND . That should be easy enough to diagnose.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|