|
No It not works
It has a CDC pointer as a parametre.
I created a brush of desired Color,,, and then i Select it
pDC->SelectObject(&brush);
But no Success!..
|
|
|
|
|
Here's an example taken from MSDN:
BOOL CSampleView::OnEraseBkgnd(CDC* pDC)
{
// Set brush to desired background color.
CBrush backBrush(RGB(255, 128, 128));
// Save old brush.
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
CRect rect;
pDC->GetClipBox(&rect); // Erase the area needed.
pDC->PatBlt(rect.left, rect.top, rect.Width(),
rect.Height(), PATCOPY);
pDC->SelectObject(pOldBrush);
return TRUE;
}
If that doesn't work - which kind of view do you use?
|
|
|
|
|
Guys i created a console application with main() . I want to debug it from the beginning so i am putting a break point at the first statement in main() .
The problem is that my application requires command line parameters (i.e argc/argv) and i always run it from dos instead of VC++ IDE.
Can anyone tell me how can i start debug my application
|
|
|
|
|
In your project settings you can choose a path to your executable which to debug. Additional information such as command line parameters can be assigned there, too.
|
|
|
|
|
you could attach a debugger to your app.
-
|
|
|
|
|
Project Settings --> Debug --> General Category: specify the command line parameters (argv) in the edit box for "Program arguments".
Then start your program in Microsoft Visual C++ by Build->Start Debug->Go
|
|
|
|
|
I've used CRegKey to read values from the registry, but what need to do now is SEARCH for a registry key name within the registry, and then read its value, without really knowing where exactly it will be.
How could I do this?
Thanks so much.
-- narada
|
|
|
|
|
Is this possible to use FileSystemObject in MFC?if yes Please can any one elaborate with syntax/example?
Thanks in advance.
|
|
|
|
|
OBS!<br />
No MFC sh*t this time, okay?!
I do like this in my window proc to paint a read-only edit box' background white:
case WM_CTLCOLORSTATIC:
if((HWND)lParam == myEdit)
{
SetBkColor((HDC)wParam, RGB(255,255,255));
return (BOOL)GetStockObject(WHITE_BRUSH);
}
But if I put 10 lines of text to it and then put only one line, the old text is still left. If I move the window outside the screen, then the text disappear.
It should has to do with the repainting or something... do you know how to fix it?
OBS!<br />
No MFC sh*t this time, okay?!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
But if I put 10 lines of text to it and then put only one line, the old text is still
Does that mean the single line of text is put into the first line or is it appended to the end? In the former case, the problem could be that when setting the text only the background of the new inserted lines of text gets redrawn. You possibly could solve that by drawing the whole client background when handling WM_CTLCOLORSTATIC, f.i. by use of FillRect.
In either case, calling UpdateWindow or RedrawWindow after setting the text could help.
|
|
|
|
|
Schlaubi wrote:
Does that mean the single line of text is put into the first line
Yes.
Schlaubi wrote:
In the former case, the problem could be that when setting the text only the background of the new inserted lines of text gets redrawn.
aha, hm... aiight!
Schlaubi wrote:
You possibly could solve that by drawing the whole client background when handling WM_CTLCOLORSTATIC, f.i. by use of FillRect.
In either case, calling UpdateWindow or RedrawWindow after setting the text could help
I'll try it out!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Thanks for your help, I've found out what was wrong in my code now.
Can I abreact now?
F***ing Damnit!!!!
But it's thanks to Bogdan Rechi and his example project he sent to me!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
(I posted this at the wrong forum before!)
Hi,
I'm writing a program that is supposed to detect the configuration of outlook express (installed in the machine where the application is run). When I say configuration I mean the pop and smtp servers, at least. Now, reading the registry I can get that info, but the registry keys vary according to the user (right?), because different user profiles (windows 2000) can have different outllo express configurations. What I really need is to detect the configuration for the user that is executing the application.
For Example, my reg key for this is in:
HKEY_USERS\S-1-5-21-3046562155-3082545408-3971354878-2339\Software\Microsoft\Internet Account Manager\Accounts\00000001
Now, what is this number: "S-1-5-21-3046562155-3082545408-3971354878-2339"? I don't think it's going to be the same in different machines, therefore I don't seem to be able to detect what I want using the registry.
Any ideas?
Thanks!
-- narada
|
|
|
|
|
That big string you see in the registry is a unique user identifer; so you're right it will be different from machine to machine and user to user. Instead, use the key: HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts to get this information. You'll need to traverse all the sub-trees under this tree because OE could have multiple accounts configured.
Ron Ward
|
|
|
|
|
Thanks so much! It's working!
-- narada
|
|
|
|
|
Hi,
Maybe somebody had an experience? How to serialize an image, any format.
|
|
|
|
|
there are probably ten different articles on CodeProject that give you ten different ways to do this.
look in the "Bitmap and palettes" section.
-c
WWT2D?
|
|
|
|
|
but no clue there on how to pass an image to stream operator(>> | <<)
|
|
|
|
|
I am playing emf files around the rectangle using for loops.First I am playing two hor then two ver.How to increase the speed of the playing?
|
|
|
|
|
Hi,
I've written a DLL which modifies some of the Registry Entries. I've used RegOpenKeyEx method for opening and RegCloseKey for closing the registry keys. When I run this code many times in a loop it shows a memory leak and the virtual byte count increases in the performance monitor. I've taken all precautions to check for any key remaining open. I've tried a similar code in a EXE code and it works fine without any byte increase. Can somebody help me in this regard.
Thanks and Regards,
Abhishek.
I hope this code would give you some idea.
**************************************************
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
BOOL _cdecl CheckClient::Run(TCHAR *szEventLogMessage, TCHAR *szAlarmMessage)
{
long lRetValue = 0;
HKEY hkey = NULL;
TCHAR szRegPath[100] = {0};
_tcscpy(szRegPath, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList"));
lRetValue = RegOpenKeyEx(HKEY_LOCAL_MACHINE,szRegPath,0,KEY_AL
L_ACCESS,&hkey);
if (lRetValue == ERROR_SUCCESS)
{
long lRetVal = 0;
_tcscpy(szEventLogMessage, _T("Executed this code"));
lRetVal = RegCloseKey(hkey);
if (lRetVal == ERROR_SUCCESS)
{
_tcscat(szEventLogMessage, _T("Success in closing the key"));
}
hkey = NULL;
}
hkey = NULL;
if (_tcscmp(szEventLogMessage,_T("")) == 0)
_tcscpy(szEventLogMessage, _T("The method has been executed first time."));
else
_tcscat(szEventLogMessage, _T("The method has been executed second time."));
return TRUE;
}
__________________
|
|
|
|
|
The function seems not to leak. Can you post the code of the loop where you're calling CheckClient::Run ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hi,
i am new to MFC,can any one suggest me a tutorial site?
thanks in advance
|
|
|
|
|
|
Thanks for the Information given.
Now one more Problem,I have created a MFC Dll(Mydll),the Class Name is CMyClass with a function Function1().How can i use the dll in the asp page?i want to use the above function.will be waiting for ur reply
|
|
|
|
|
I don't know much hardly anything about ASP, but I would guess you can make the class in your DLL a COM object to take advantage of it from ASP. You will need to find an MFC sample about COM.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|