|
the real problem -
I use an object called "CEditEx" (available also in this side i reckon), as a terminal for serial communication with some device. Anyway - after filling 200 lines, i have the following code that maintain the history :
if(mainWnd->m_textBoxOut.GetLineCount() > 200) {
textBegin = mainWnd->m_textBoxOut.LineIndex(1);
mainWnd->m_textBoxOut.SetSel(0,-1);
mainWnd->m_textBoxOut.GetWindowText(entireText);
entireText = entireText.Right(entireText.GetLength()-textBegin);
mainWnd->m_textBoxOut.ReplaceSel(entireText);
}
Where "m_textBoxOut" is the CEditEx object and "textBegin" is an integer for keeping an index.
THE PROBLEM is that when executing this code, the display of the CEdit object flashes (since it re-writes itself).
Any idea ?
Thanks
Timor
|
|
|
|
|
timoriss wrote:
THE PROBLEM is that when executing this code, the display of the CEdit object flashes (since it re-writes itself).
How about CWnd::SetRedraw() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How about using CRichEdit ?
MS
|
|
|
|
|
what are the benefits of using "CRichEdit" ?
|
|
|
|
|
CEdit can only keep 64k, CRichEdit is unlimited, but in the meantime I saw that this is not your problem.
MS
|
|
|
|
|
|
Does anyone know of a way of detecting when a desktop switch has occurred? I'm not talking about terminal servies (WM_WTSSESSION_CHANGE will do that), but a simple single-user desktop switch. There's an API to do the switch (SwitchDesktop() ), but there doesn't seem to be any way of detecting that it has occurred when someone else does the switch.
I've used Spy++ to look at every single message sent to my app while I do a switch, and there doesn't seem to be anything unusual, just a bunch of WM_ACTIVATE , WM_ACTIVEAPP , WM_WINDOWPOSCHANGING (but not WM_WINDOWPOSCHANGED however) messages. Nothing extraordinary there. The only thing I saw I wasn't expecting was that the cx and cy fields in the WINDOWPOS structure were both set to -1, although SWP_NOSIZE was also set, so they would be ignored anyway.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hello
I have a problem
when I link my program in Release Mode I get some crazy
linker warnings like this:
LINK : warning LNK4089: all references to "ADVAPI32.dll"
discarded by /OPT:REF
LINK : warning LNK4089: all references to "SHELL32.dll"
discarded by /OPT:REF
LINK : warning LNK4089: all references to "comdlg32.dll"
discarded by /OPT:REF
and because of them some features of my program(namely all
functions that have something to do with wininet.h) don't
work any more.
In Debug mode anything works ok.
I see that some com objects that I use get this /OPT:REF
thing going whenever I call some methods because if I put
this in comments it works
what is this /OPT:REF thing?
anyway I can turn of this/OPT:REF thing??
|
|
|
|
|
There's no problems there. That's just saying that you told the linker to link to these libraries, but you didn't actually use anything from them, so the linker is not including them.
To remove the warnings, remove the libraries from the linker setup of your project settings, but there's really no need to. They're just information anyway.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I only include one library wininet.lib but if I remove it all the functions from wininet.h don't work
I have no other librabies linked
I am using MFC support in a static library
|
|
|
|
|
hi every one,
i am reading VC++ and want to know that which and what are the important concepts in VC++.how to learn that...
|
|
|
|
|
Is this a trick question? All concepts are important. Learn the language as a whole.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi all
when i type( CoCreateInstanceEx() , it shows me the parameters , but when i compile it, gives an error "CoCreateInstanceEx is not a member of global namespace" and "undeclared identifer". i attached the <atlbase.h>. with cocreateInstane , it works(visual c++6).
thank you very much
|
|
|
|
|
From MSDN
"You must include the #define _WIN32_DCOM preprocessor directive at the beginning of your code to be able to use CoCreateInstanceEx."
Hope this helps,
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
my codes like these:
//printer name in buf
if(!OpenPrinter(buf,&handle,NULL)) //open printer
{
MessageBox("Could not open printer","Error",
MB_OK/MB_ICONINFORMATION);
return;
}
DWORD size;
ADDJOB_INFO_1 * info;
DWORD numNeed = 0;
size = 4096;
BOOL bReturn = FALSE;
info=(ADDJOB_INFO_1 *)LocalAlloc((LMEM_FIXED/LMEM_ZEROINIT),size);
//add job into printer
bReturn = AddJob(handle,1,(LPBYTE)info,size,&numNeed);
CString str = "E:\\1.plt";
memcpy(info->Path,str,strlen(str));
info->Path[strlen(str)] = '\0';
bReturn = ScheduleJob(handle,info->JobId);
LocalFree(info);
ClosePrinter(handle);
when i use ScheduleJob to print the file "E:\\1.plt",ScheduleJob return FALSE. I do not know how to use ScheduleJob in my codes.
Help Me!
|
|
|
|
|
Hi all,
I want to use command-line :
for example:
myfile.exe /f
Best wishes,
Thanks.
|
|
|
|
|
|
In addition to GetCommandLine() , there's also the __argc /__argv pair.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Some time back i come across an api which notify the application about registry change, but due HUMAN NATURE of forgeting thing at time they urgently required..... I too forget that api!!!
is any body remember that api!!!?
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
|
Hi,
I am trying to call the following code within a WH_GETMESSAGE hook procedure and it works fine. But the same piece of code fails inside a WH_JOURNALRECORD hook procedure. Can anyone help me in this regard.
void EnumIE()
{ CoInitialize( NULL );
SHDocVw::IShellWindowsPtr spSHWinds;
spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows));
long nCount = spSHWinds->GetCount();
IDispatchPtr spDisp;
for (long i = 0; i < nCount; i++)
{ _variant_t va(i, VT_I4);
spDisp = spSHWinds->Item(va);
SHDocVw::IWebBrowser2Ptr spBrowser(spDisp);
if (spBrowser != NULL)
{ MSHTML::IHTMLDocument2Ptr spDoc(spBrowser->GetDocument());
if (spDoc != NULL)
{ HWND hWnd = NULL;
spBrowser->get_HWND ((long*)(&hWnd));
}
}
}
CoUninitialize();
}
|
|
|
|
|
Hi,
Can anybody share some ideas on how to catch STL exceptions in a C++ code.
I would appreciate if some pseudocode or a link is provided with regard to this.
Thanks,
JOE
|
|
|
|
|
#include <exception>
#include <iostream>
try {
}
catch (const std::exception &err) {
std::cerr << err.what() << std::endl;
}
|
|
|
|
|
ALOK
I HAVE A XML WHOSE XMLDOMDocumentPtr IS pIDomOutDoc.
wchar_t *wcstr=pIDomOutDoc->xml;
//pIDomOutDoc->xml; returns the xml in unicode
out_XML= (char *)malloc( MB_CUR_MAX);
//out_XML STORES THE OUTPUT
wcstombs(out_XML,wcstr,MB_CUR_MAX);
::AfxMessageBox(out_XML);
BUT I AM NOT GETTING CORRECT OUTPUT.THE RESULT PRINTED OUT IS SOMETHING LIKE <yyyy>yyyy
|
|
|
|
|
alok
sorry to disturb u. i did it .i replace the MB_CUR_MAX BY CHAR[1000].BUT I WANT TO MAKE IT INDEPENDENT OF THE SUBCRIPT VALUE.
|
|
|
|