|
Someone else mentioned using layered windows. As a footnote, layered windows only work with top-level windows, not child windows.
Try overridding the WM_ERASEBKGND message and doing nothing. If this is not enough, then try sending a WM_PRINT message to the parent window which basically asks it to render itself into a HDC of your choosing. Then use the resulting image to draw your background.
Joel Lucsy
|
|
|
|
|
When handling the OnEraseBkgnd, return a Hollow brush, rather than doing nothing.
EX:
return (HBRUSH)GetStockObject(HOLLOW_BRUSH);
|
|
|
|
|
Greeting,
I am working on a project that need to restore a CTreeCtrl to its previous state when my application starts up. The state of CTreeCtrl will be saved when application exits and restored when application starts up.
Is anyone have any ideas how this is being done?
Thanks alot,
J. Wei
|
|
|
|
|
|
Thank you so much!
J. Wei
|
|
|
|
|
Hello...I'm declaring a class array of size 80,000,000...when compiling there is an error that the size exceeds the allowed one and the program may not run.
I tried but it really does not work..it says that the program is not a win32 application.
My solution is to declare the class array dynamically:
myclass1 = new myclass[size]
When I tried with this there is no memory allocated and the program aborts.
As myclass has some double data and other classes embedded, I guess I need to overload the operator new so to create the needed space.
Can anyone help me how to do this, assuming the class is defined as:
class myclass{
public:
myclass2 curr_data2;
myclass3 curr_data3;
myclass2 new_data4;
myclass3 new_data5;
}
and the other classes
class myclass2{
public:
double x;
double y;
double z;
}
class myclass3{
public{
double motionX;
double motionY;
double motionZ;
}
Thanks,
Eric Manuel Rosales Pena Alfaro
PhD student
Unversity of Essex
Wivenhoe Park
Colchester, CO4 3SQ
Essex, Uk
email: emrosa@essex.ac.uk
tel: +44-01206-87311
|
|
|
|
|
A quick calculation yields that for the array alone, the program will use approximately 3.6G of memory. I think you need to re-think your array size to bring it down to a much smaller number.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"Microsoft hasn't ever enforced its patents. Apparently they keep them for defensive reasons only. Or, they could be waiting 'til they have a critical mass of patents, enforce them all at once and win the game of Risk that they're playing with the world." Chris Sells Feb 18, 2003.
|
|
|
|
|
The default stack size is 1MB, hence the compiler error. Allocating much more than that (100s of MBs) from the heap is possible but I would still question the need. That's not to say that a need doesn't actually exist, but to just nonchalantly ask the OS for GBs, or even MBs, of memory all at once is questionable.
|
|
|
|
|
easy dude, that's pretty nuts. are you sure you NEED 80 MILLION of your class thingy's, or are you just allocating that many "to be on the safe side" ?
I suggest you look into std::vector. It just may provide all the answers you seek.
i.e., if you need another one of your classes, just do something like:
std::vector<MyClass*> vpMyClass;
for(int i=0; i<iSomeNumberOfNeededClasses; i++)
vpMyClass.push_back(new CMyClass);
just remember to delete everything and empty the vector when you're done.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Hmm..
Has anyone written an add-in wizard for Visual C++ 6.0 Enterprise, which allows you to generate blank MFC projects ?
The same in english: I want to create MFC projects from scratch, but I cannot do this, as the ClassWizard is not available by default. How can I activate ClassWizard for a project that does not have anything in it ?
I already know that I can add MFC-support to a Win32-project (EXE/DLL) by choosing it from the project settings. However, for some strange reason, this doesn't always work. What I want to do, is to be able to write an MFC-application from scratch using the ClassWizard..
-Celorfie
|
|
|
|
|
um... my version of VC++ has an "MFC Appwizard"
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
I have a program which is installed on a Windows 2000 server which has Terminal Services installed. The question is: How can I limit the number of instances of the program opened by all users. (eg. 4 concurrent users can use the program at the same time)
Your soonest help is appreciated...
~~~~~~~~~~~~~~~
CDRom
|
|
|
|
|
Read here:
http://www.flounder.com/nomultiples.htm
|
|
|
|
|
I have a float value which is say 1.21000 and I want to print it as 1.21 only . I am using CString Format function to make it printable
like
float x;
..
..
CString myData;
myData.Format("%f",x);
How do I get to print 1.21 instead of 1.21000 . Please help .
|
|
|
|
|
act_x wrote:
myData.Format("%f",x);
Change to:
myData.Format("%.2f",x);
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Hallo!!
I want to select items in a ListCtrl not by the user , i want select the whole items in row in Report style by the programm. Not the user should select the row,
the programm must do this. There are Columnes, and the whole row must be selected.
The second problem is thsize of the items, there are only
labels (text) in the control, no imiges.
How can I change the size of the items/text ??
Thank You for helping me,
Dirk from Germany
|
|
|
|
|
schoni wrote:
I want to select items in a ListCtrl not by the user , i want select the whole items in row in Report style by the programm. Not the user should select the row,
the programm must do this. There are Columnes, and the whole row must be selected.
SetSelectionMark(...)
I'm not sure if it's the right method
schoni wrote:
The second problem is thsize of the items, there are only
labels (text) in the control, no imiges.
How can I change the size of the items/text ??
Ownerdraw!
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Something like:
CListCtrl &ctrlList = GetListCtrl();
BOOL x;
for (int nItem = 0; nItem < 10; nItem += 2)
{
x = ctrlList.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED);
TRACE("x = %d\n", x);
}
|
|
|
|
|
Make sure you set LVS_FULLROWSELECT (or something like that) also to select the whole row.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
To change the height of the rows (if you meant that) you can do a trick if you don't want to ownerdraw everything:
you can create a imagelist without images and defining a special height, once this is done you have only to attach that imagelist to the listctrl and that's all.
Hope this helps.
|
|
|
|
|
I have a FormView project. With the default, it has scrollbars and the user is able to adjust the size of the frames. I'm trying to get rid of the scrollbars. Is this possible?
|
|
|
|
|
I need to edit (modify) a record being part of an AdoRecordset.
I've written the following code:
m_MyRecordset.Open("TABLE", CADORecordset::OPEN_TABLE);
m_MyRecordset.MoveFirst();
m_MyRecordset.Edit();
m_MyRecordset.SetFieldValue(_T("Field"), 1000);
m_MyRecordset.Update();
But it doesn't works. It generates an exception that says
that "query is too complex" !!!
Can someone tell me why it doesn't work and what
have I to do in order to edit an existing record ?
Thanks a lot!!!
|
|
|
|
|
Just a question. In m_MyRecordset.Open( "TABLE", CADORecordset::OPEN_TABLE) shouldn't you have have "SELECT something FROM table"? I have never used CADORecordset because I use ADO directly, that's why I am asking you this question. Or at least, have you made sure that you have opened the database and that you have a valid connection to it?
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Hey All,
I'm having a problem copying an are of one window into another. Here's what I've got:
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC IconDC = BeginPaint(hwnd, &ps);
HDC TrayDC = GetDC(MainWnd);
HBITMAP IconBMP = CreateCompatibleBitmap(TrayDC, ICON_SIZE, ICON_SIZE);
HBITMAP OldBMP = (HBITMAP)SelectObject(IconDC, IconBMP);
BitBlt(IconDC, 0, 0, ICON_SIZE, ICON_SIZE, TrayDC, 0, 0, SRCCOPY);
DrawIconEx(IconDC, 0, 0, hicon, ICON_SIZE, ICON_SIZE, 0, NULL, DI_NORMAL);
ReleaseDC(MainWnd, TrayDC);
SelectObject(IconDC, OldBMP);
DeleteObject(IconBMP);
EndPaint(hwnd, &ps);
return 0;
}
For some reason, it doesn't seem to work (the contents of the TrayDC is not getting painted into the IconDC). From what I've read, I don't seem to be doing anything wrong.
Any help would be appreciated, thanx!
|
|
|
|
|
Hi there!
I'm trying to surf the resource in my CHtmlView. I want to have all the web stuff in the resource.
Everything except swf files seems to work with:
res://name.exe/'type'/'name' for all graphics (jpg, gif, png etc.) and html.
I can surf the HTML-pages without any problem.
But, it won't load the swf file.
The swf-player is there, but it says "Movie not loaded".
Excerpts from the html code:
<img src="res://MFCWebBrowserDemo.exe/test/test.jpg"> Works !!
Doesn't work!
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0" width="800" height="400">
<param name="movie" value="res://MFCWebBrowserDemo.exe/test/intro.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#000000"><param name="LOOP" value="false"><embed src="res://MFCWebBrowserDemo.exe/test/intro.swf" width="800" height="400" loop="false" quality="high"
bgcolor="#000000" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</embed></object>
(everything doesn't show up above, but I hope you all get the picture)
How do I proceed to load the whole HTML page from the resource, with graphics and Flash ?
I would really much appreciate an answer, because I don't know what to do ???!!!
Thanx in advance!
/Renfield
|
|
|
|
|