|
Hello All
I am using List control on my Form View (VC 6.0 on Windows 2000). I have derived my own class from CListCtrl and overwritten "OnCustomDraw" to draw my own List Control. I have placed the control on top of the Tab Control. When I switch from my application to another application and come back, repainting is not happening properly. I am seeing the tab control and the list control is not visible. After some time it appears automatically or if i go to some other tab and come back it appears.
I have not overloaded OnDraw in my View Class.If I use CListCtrl without using my own class then repainting happens properly.
As a solution for above problem I overloaed OnDraw in my view class and i painted the list controls.
<br />
void CMyView::OnDraw(CDC* pDC) <br />
{<br />
if (m_oTabCtrl.GetCurSel () == 0) {<br />
m_oMyListCtrl1.Invalidate ();<br />
} else {<br />
m_oMyListCtrl2.Invalidate ();<br />
}<br />
}<br />
After this I am not getting any painting problem.
Please let me know what was the cause for above problem and whether is there any better solution than this?
Thanks for your time
Ravi
|
|
|
|
|
I have a dll which is getting instantiated from one virtual directory. And inside the dll I'm calling the following functions.
HANDLE hEventSource = RegisterEventSource(NULL, _T("TrxDax") );
if (hEventSource != NULL)
{
..
int b = ReportEvent(hEventSource, EVENTLOG_ERROR_TYPE, 0, 0x00000001L, NULL, 1, 0, (LPCTSTR*) &lpStrings[0], NULL);
...
}
1. Actually the RegisterEventSource() call is failing if the call is made from virtual dir. in Win2003. GetLastError() is returning error value(5) meaning Access denied for the call.
2. But the same thing is working on earlier versions(win2000,XP..).
3. And when the above code is used in a .exe file(simple exe file), then it's working in Win2003. Meaning..(error is reported in eventlog).
4. So, Does the enhanced security in 2003 is blocking the call when it's instantiated through virtual dir.?
Is it clear? or do let me know if some more input is needed..
Thanks
Find a job u love and u'll never have to work for a day in your life....
Zxczc
|
|
|
|
|
Hello All,
How to establish communication with the existing device driver(.sys) ?
|
|
|
|
|
Hi,
I need to remove a section of text from a CRichEditControl, but also store all of the formatting data associated with it- so that I can re-insert it later on.
Does anyone know of a way to use the underlying clipboard operations to do this? i.e instead of removing text, it is cut (into some storage location - not the clipboard!) and then when the text needs to be replaced, it is pasted from that location.
if not, is there some simple method for storing all of the formatting data associated with a range of text? It's worth noting that the CHARFROMAT and PARAFORMAT will be different for different parts of the text.
tricky one, eh?
Thanks in advance,
Dave
Dave Kerr
codechamber@hotmail.com
http://www.codechamber.com
|
|
|
|
|
who can tell me what fomat the audio file *.ssu is.
|
|
|
|
|
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F
00000000 01 11 2B 36 54 00 00 00 00 00 00 00 00 00 00 00 +6T
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000020 FF D9 75 66 66 66 66 66 66 66 66 66 66 66 66 66 賣fffffffffffff
00000030 66 66 66 65 76 66 66 66 66 66 66 76 56 66 75 88 fffevffffffvVfu?
00000040 33 57 86 65 77 55 68 64 66 67 76 65 66 66 66 66 3W唀wUhdfgveffff
00000050 66 66 66 66 66 67 55 76 66 66 66 66 66 66 66 66 fffffgUvffffffff
00000060 66 66 66 66 66 66 66 66 66 66 56 76 65 76 66 66 ffffffffffVvevff
00000070 66 66 66 66 66 66 66 67 56 66 67 56 66 66 65 76 fffffffgVfgVffev
00000080 57 66 66 66 66 66 66 66 66 67 56 66 66 66 66 66 WffffffffgVfffff
00000090 66 66 66 57 66 66 66 66 66 65 76 66 67 56 75 66 fffWfffffevfgVuf
000000A0 66 67 56 66 66 66 66 66 6F F2 87 56 66 66 66 66 fgVfffffo驀Vffff
000000B0 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 FF fffffffffffffff
000000C0 29 76 47 66 66 66 75 57 75 66 66 66 66 75 66 66 )vGfffuWuffffuff
000000D0 57 66 66 66 66 66 66 66 66 57 66 76 56 66 57 66 WffffffffWfvVfWf
000000E0 66 57 67 55 85 FF 09 75 66 57 66 66 75 66 FF 0A fWgU? ufWffuf
000000F0 57 66 66 66 66 85 88 E0 F4 77 74 87 67 37 85 84 Wffff厛圄wt噂7厔
00000100 76 57 57 74 76 56 76 55 85 5F F0 57 76 56 66 FF vWWtvVvU卂餡vVf
00000110 06 57 75 66 67 55 76 66 66 67 64 77 56 66 75 75 WufgUvffgdwVfuu
00000120 66 57 65 75 75 58 FF 07 56 66 67 75 75 66 66 66 fWeuuX Vfguufff
00000130 75 74 67 67 56 74 85 58 46 76 73 77 57 66 65 75 utggVt匵FvswWfeu
00000140 59 66 65 55 97 36 86 56 85 7B 60 47 73 65 37 95 YfeU?哣厈`Gse7?
00000150 48 86 49 67 76 56 58 75 55 98 53 56 87 46 65 98 H咺gvVXuU楽V嘑e?
00000160 62 E0 F7 47 92 68 55 09 7E 0F 77 95 4D 0F 48 D1 b圜G抙U ~ w昅 H?
00000170 0C 3F CD 4F 54 E3 3F 4E 3F 11 5D 2F E0 F1 AE 1F ?蚈T?N? ]/囫?
00000180 1E 23 F0 E3 F3 60 44 24 7C 95 77 87 4F E7 8F EB #疸骮D$|晈嘜鐝?
00000190 DF ED F5 EB 8F 0E 7F 59 E7 3A FD 2F FE A3 D1 5F 唔蹼?Y??裚
000001A0 4E 12 FF E8 DD 1F BF E8 3E 9F FE 5A 5D 6F 9D 2F N 栎 胯>燓Z]o?
000001B0 E3 F3 D5 F2 60 E7 4B F5 D2 FA 3B BE 30 F3 9A E5 泱镇`鏚跻??髿?
000001C0 FF E6 EF ED CF EF FE BF FE CE FE B8 EB CF 9D 1F 骘硐稔傀牺鸽蠞
000001D0 EC 05 FA FE 94 FE B1 D7 FE 0C 86 F0 02 E3 9F 7D ?旫弊?嗮 銦}
000001E0 46 3F 7A D5 FC E1 FF E7 4E CF 97 59 90 44 BA E1 F?z拯?鏝蠗Y怐横
|
|
|
|
|
great !
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 8:41 Monday 29th August, 2005
|
|
|
|
|
|
|
Hello guys!I've been coding MFC apps for 3 months now,and i recently encountered the situation below:
I have a Dialog window (class CControlPanelDlg) and a picture control object called m_pcTest(of type CStatic).I have created a structure called "Bitmap" that contains the following array : CBitmap Icon[4].I've created 4 bitmap images and loaded them into Icon(Using LoadBitmap(IDB_IMAGE_ID) method).I want to change the image that m_pcTest shows each time i click a Button within the window(using m_pcTest.SetBitmap(Bitmap.Icon[0])).So far so good.The image changes.Then i created a thread,that it's thread function calls another function located inside CControlPanelDlg.cpp,the same function i use to change the image shown in m_pcTest every once i click the button.While in Debug mode,i noticed that when the program jumps inside the function that change images (m_pcTest.SetBitmap(Bitmap.Icon[0])),the variable m_pcTest has the following value:
m_pcTest={CStatic hWnd=???}. When the program passes the line that contains the breakpoint,it throws a nasty Access Violation!I tried calling tha function from within the thread function with different ways,like:
((CControlPanelDlg*)AfxGetApp()->m_pActiveWnd)->ChangeImage();
p_ControlPanelDlg ->ChangeImage();
(p_ControlPanelDlg ---> external pointer to CControlPanelDlg dialog class)
The variable m_pcTest is public.Am i doing something wrong?Did i forget to declare something?Or i declared it in the wrong way?Please help.I know i'm new to MFC,and you probably going to ask yourself "why this young lad bothers himself with threads so early"? The answer is i'm in love with MFC and i've learned so much within those 3 months(mostly Serial Communication,Database projects) and i needed to learn how to change bitmaps while other code was executing.I tried to do this with timers but as long as my code enters a loop,ChangeImage()could not be called until code execution continued beyond the loop.I tried UpdateData(FALSE)from inside the loop,but nothing happend.So i needed a co-process,a thread.I would appreciate it if someone of you code gurus out there could help.Thank GOD that "The Code Project" exists as my homepage...
Lefteris_RG3120
Control Systems & Software Engineer
-- modified at 8:23 Monday 29th August, 2005
|
|
|
|
|
Instead of directly calling ChangeImage from your worker thread, you need to make the CDialog's m_hWnd available to the thread (when you create it) and then use it to post a private message from the worker thread back to the dialog. Use a handler for that message in the CDialog to call ChangeImage.
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
char v1[12]= "CodeProject";
char v2[5];
strncpy(v2,v1,sizeof(v2));
AfxMessageBox(v2);
Now what will u get, don't test it in ur IDE.. just hav a luk n tell..
answer this , i'll tell u what i actually need..
Thanks n regards,
V
|
|
|
|
|
here again, i see you don't take care to the trailing null character...
you should have written
strncpy(v2, v1, sizeof(v2)-1);
v2[sizeof(v2) - 1] = '\0';
this way, it will display Code
the other way to use strcpy() and strncpy() properly is to use pure pointers variables :
char v[12] = "CodeProject";
char* pc = NULL;
strcpy(pc, v);
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 8:36 Monday 29th August, 2005
|
|
|
|
|
I guess, you meant v2[sizeof(v2) - 1] = '\0'; ?
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
yes, sorry for the mistake...
it's fixed now
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
thatz nice tox.. thank u so much
thanx,
V
|
|
|
|
|
toxcct wrote:
char v[12] = "CodeProject";<br />
char* pc = NULL;<br />
strcpy(pc, v);
Doesn't this lead to a runtime error? Here you try to copy string v to the address NULL...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
To get "Code" you need a terminating NULL:
char v1[12]= "CodeProject";
char v2[5];
strncpy(v2, v1, sizeof(v2) - 1);
v2[sizeof(v2) - 1] = 0;
Regards
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
thankx buddy
V
|
|
|
|
|
Hello,
I try to write a program that uses http tunneling. But behind a proxy it won't work. Of course i can get the proxy settings from registry but the username and passowrd aren't stored, so if i want to connect i need to know the username and password. How can i get them?
One more information: the program is in vc++ and the iexplorer must start before it. So the user is authenticated.
Robi75
|
|
|
|
|
your program will have to ask for those 2 infos to the user to store them... (that's what happens for example when you configure other programs for a proxy connection...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks, I thought its possible to get the username and pass somehow at code level but I came to the conclusion that it is impossible after reading related topics on the net.
Thanks anyway,
Rob
|
|
|
|
|
I am using DOC/View facilities.
1. When a make a preview, there is not a preview toolbar; i don't found a mean to print from there, What to do ?
2. When i close my preview windows, the program is broken down, why ? and what to do ?
I learn my self
|
|
|
|
|
I am using Doc/View facilities,
1. When make preview, there is not a preview toolbar where i can print,etc.. . What to do ?
2. When I close my preview windows my program broken down, Why ?
I learn my self
|
|
|
|
|
Please, Write How you are using Preview?
And How you close Preview if there is no toolbar?
|
|
|
|