|
Your question is a bit unclear. Perhaps this article/code will help.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
When I change pc to one that the screen size is big then my screen, i was the problem of size et position.
Since I use CLayoutHelp class I have solve this problem, but ComboBox control don't change their size. That my problem
|
|
|
|
|
Where is this article ? I don't see it
In zip file there are
two file smartDropdown.cpp and .h
send me this article please
I learn my self
|
|
|
|
|
It may posssible by setting font of the Combo box
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
I don't understand anything by to set font of combox.
Can you show clearly what i can do .
|
|
|
|
|
You just create the variable of the your combo box
CFont *m_font=new CFont();
m_font->CreatePointFont(200,"Tahoma");
m_Test.SetFont(m_font);
m_Test.AddString("1");
m_Test.AddString("2");
m_Test.AddString("3");
m_Test.AddString("4");
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
I have created a MDI application , such as "MDIEx".When I call function OnFileNew() in CMDIExApp,a MDI child will be created
How to creat a MDI child from CMDIExDoc? (Function CWinApp::OnFileNew() can't be accessed from CDocument)
Thank you!
Chao tat ca cac ban!
|
|
|
|
|
I guess you could do a AfxGetMainWnd( )->SendMessage( ) with WM_COMMAND and ID_FILE_NEW as parameters (look at the help for WM_COMMAND to figure out what WPARAM and LPARAM should be, I can't remember it from the top of my head...)
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Hi all:
I am doing a OpenGL project. I want to create a function tracking the mouse motion so that the object in the window can spin or rotate according the mouse motion. I know there is a
void glutMotionFunc(void (*func)(int x, int y));
registration function. Does anybody know how to achieve the functionality please?
Thanks in advance!!!
Asura
|
|
|
|
|
Hi all,
I am using VFW.
I know i can set a call back message capSetCallbackOnFrame and then receive the callbak in:
LRESULT CALLBACK FrameCallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr)
where lpVHdr->lpData is the buffer containing the video information to be shown(drawn)
my question is how do i add a drawing to that video? i want to see the captured frame from my webcam and ontop of that i want to draw something....
can any1 show me piece of code for that?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
I'd like to capture video from usb cam, what's the VFW?
9ine
|
|
|
|
|
|
hi
I am Working on a printing issue in MFC.I want the header to be printed in multiple lines.so I am using DT_WORDBREAK.It works fine when the string contains spaces(eg:1.Sample Print1 2.Sample Print2.....) but when the string contains no spaces the output is clipped at both ends
(eg input :1.SamplePrint12.SamplePrint2.....).
the output I am getting as follows:
mplePrint12.Sample
rint2.Sampl
the code I used is as follows
pDC->DrawText(String,rectArea, DT_CENTER | DT_WORDBREAK);
what could be the problem?Can anyone clearly explain me the functionality of DT_WORDBREAK.Am I using it in the correct way?
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
|
I can read in a notepad file in entirety, store it in a CString,
and then write it out. I cant do the same for a file in rich text
format. For some reason, I dont get all of the file and when I
write it out and then launch it, it shifted around. Any idea on
how to read in an entire RTF file to a CString and then write it
out?
I put together this code:
CString str; char c;
ifstream In("c:\file.rtf");
while (In)
{
In >> c;
if (In) str += c;
}
In.close();
ofstream Out("c:\\file1.rtf");
int len = str.GetLength();
for (int i=0; i
|
|
|
|
|
DanYELL wrote: I cant do the same for a file in rich text
format. For some reason, I dont get all of the file...
Probably because of the embedded '\0' characters (when using a CString object).
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Try with a CFile:
1. Open the file
2. Allocate a buffer based on the file length
3. Read into the buffer.
4. Close the file.
5. Write the buffer to another file.
6. Delete the buffer.
This doesn't care about embedded nulls.
The tigress is here
|
|
|
|
|
I think your right that CFile is the solution. I sincerely appreciate
your feedback. My only remaining question is, how can I efficiency
read the entire file into a CString or something other than a buffer.
I have:
char buf[50001];
CFile cfFile ("C:\\Gille.RTF", CFile::modeNoTruncate | CFile::modeRead);
cfFile.Read(buf, 50000);
// open
CFile f;
CFileException e;
char* pFileName = "c:\\Gille2.rtf";
if( !f.Open( pFileName, CFile::modeCreate | CFile::modeWrite, &e ) )
{
#ifdef _DEBUG
afxDump << "File could not be opened " << e.m_cause << "\n";
#endif
}
f.Write(buf, 50000);
The
char buf[50001];
is really bad. I had char buf[501]; and that wasnt big enough for a
1-page file. So I made it bigger. Is there a way to read in exactly
enough and to make the buffer the exact size? Also, what happens if
I read in a 10-page RTF file? How big can a buffer get?
Please, any response you can give me will be greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
I know I can use:
cfFile.GetLength();
How can I not use a buffer and instead use something else like
a CString?
|
|
|
|
|
Probably something like:
CString strFileContents;
int nLen = cfFile.GetLength( );
LPTSTR pszBuffer = strFileContents.GetBufferSetLength( nLen + 1 );
cfFile.Read( pszBuffer, nLen );
strFileContents.ReleaseBuffer( );
Note: I didn't run this through a compiler, expect bugs
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
|
Hi,
Please give me idea about the function that are declared as follows,
void fun(CString str, ...);
Can I get total no. of strings (arguments) passed to th function?
Also, when I use char instead of CString as arguments data type; it's not working properly.
Thanks.
|
|
|
|
|
if you use ellipsis, then it is more a C function. if so, don't use C++ objects.
if you use C++, then change the ellipsis into a linked list (like std::vector<>) to pass your variable list of parameters
|
|
|
|
|
Aniket Salunkhe wrote: Can I get total no. of strings (arguments) passed to th function?
No, not unless you also specified a terminator.
Aniket Salunkhe wrote: Also, when I use char instead of CString as arguments data type; it's not working properly.
Ok. Without showing the code snippet that does/does not work, what exactly are you hoping for?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I am using following function. Is this a correct way?
int CMyListControl::insertItems(int argNo, CString strItem, ...)
{
CString strTemp[10];
LVITEM lvItem;
SetRedraw(FALSE);
lvItem.mask = LVIF_IMAGE | LVIF_TEXT;
lvItem.iItem = CurRow;
for(int i=0; i < argNo ;i++)
{
strTemp[i].Format("%s",*((&strItem)+i));
lvItem.iSubItem = i;
lvItem.pszText = (LPTSTR)(LPCTSTR)(strTemp[i]);
(i==0)?InsertItem(&lvItem):SetItem(&lvItem);
}
return(CurRow++);
}
But i dont want to use 'argNo' as an indiaction of no of 'CString' parameters passed to the function.
Even I failed to use 'char' string in place of 'CString'.
It is giving Error, if I want to use function as,
int CMyListControl::insertItems(int argNo, CString strItem, ..., int Row = -1)
|
|
|
|