|
So you see the frame, then a space where the header should be, and then the list contents?
--------
The real problem is that you don't have to be religious to be a religious fanatic,
you just have to be a fanatic. -- Stan Shannon, the lounge
|
|
|
|
|
Hi Shog,
Not like you said: Imaging you see the ListControl on the Monitor Screen with its Header Columns & its contents (as it is supposed to be)! Then when I print, it printed just like that ... except there is no Header columns
Hints: If you use in MFC a ListControl dialog, then goto its property, select Style --> Select View --> Select "Report"! Then you should see a ListControl with a Header Column (default title "Color")
***> If in the Style property, you check "No Header column" option then that Header column row ("color") disappeared!
My print out just do like that (even I "did not" check the "No Header column" option!
I hope this Hint will explain what is my problem!
Thanks,
|
|
|
|
|
Replace all the print lines you have now with one that combines the flags:
{
int oldMapMode = dc.SetMapMode(MM_ISOTROPIC);
CSize ptOldWinOrg = dc.SetWindowOrg(-30, -30);
CSize ptOldWinExt = dc.SetWindowExt(1, 1);
CSize ptOldViewportExt = dc.SetViewportExt(4, 4);
m_report.Print(&dc, PRF_NONCLIENT|PRF_CLIENT|PRF_CHILDREN);
}
This will work. BTW: you may want to play with your size calculations a bit - the list prints fairly small...
--------
The real problem is that you don't have to be religious to be a religious fanatic,
you just have to be a fanatic. -- Stan Shannon, the lounge
|
|
|
|
|
Whats the best way to keep track of any number of regions at one time so that I can move them when ever I need to? The number of regions I'm dealing with can be any number.
|
|
|
|
|
That's sort of a broad question... You could use an array, a list, a map... It really depends on what your needs are in storing and retrieving them.
--------
The real problem is that you don't have to be religious to be a religious fanatic,
you just have to be a fanatic. -- Stan Shannon, the lounge
|
|
|
|
|
Well what I'm trying to do is create some regions that
I will paint a bmp into. Then I need to move them based on the user's selection and their mouse click. Doing all that I know how to do. Since their can be any number of regions at any given time which is pretty much random, keeping track of each one is the problem - I knew I'd hate programming graphics!
What I'm thinking, off the top of my head, is defining a class say
class CMyObject
{
CBitmap bitmap;
CRect bmprect;
float iXAxis;
float iYAxis;
};
CArray < myobject, myobject > m_myarray;
Question is how do I get the bmprect, bitmap, iX and YAxis and will it be different for each myobject that is created. ![Eek! | :eek:](https://www.codeproject.com/script/Forums/Images/smiley_eek.gif)
|
|
|
|
|
Jay Beckert wrote:
Question is how do I get the bmprect, bitmap, iX and YAxis and will it be different for each myobject that is created.
So, these will all be rectangular, but possibly rotated? I guess i still don't really understand what you're trying to accomplish...
--------
The real problem is that you don't have to be religious to be a religious fanatic,
you just have to be a fanatic. -- Stan Shannon, the lounge
|
|
|
|
|
They will each take on a new position within the client view depending on where the user will move them. Just like those 2D games that move sprites over the top of a background. I need to keep track of each object so when it moves to a new location within the client view, just grab whats behind that region paint that piece then repaint the object in it's new location. This way I can test if a point is in a region and adjust the mouse cursor. I'm sure it's the obvious easy thing I'm missing.![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
It was the obvious and basic programming design. It's as easy as defining a structure of the data including the HRGN and storing the structs in STL or CArray or what ever you choose. Then traversing that list checking to see if a point is in a region. I always make it complicated to later realize it's not as hard as it seems. Make sense?? ![Unsure | :~](https://www.codeproject.com/script/Forums/Images/smiley_squeamish.gif)
|
|
|
|
|
Jay Beckert wrote:
I always make it complicated to later realize it's not as hard as it seems.
Heh, i know the feeling!
--------
The real problem is that you don't have to be religious to be a religious fanatic,
you just have to be a fanatic. -- Stan Shannon, the lounge
|
|
|
|
|
Hi,
I have succesfully compiled my project in debug mode which extensively uses HtmlHelp calls.
Of course I included "HtmlHelp.h" in StdAfx.h and linked against "htmlhelp.lib" in both debug and release mode.
Now I switched to release mode and was quite surprised:
All HtmlHelp() calls were recognized as unknown.
Thanks for your help.
R.
|
|
|
|
|
|
Yes, absolutely.
In debug mode it compiled and run (!) OK.
I switched on release mode and all these calls
HtmlHelp(m_hWnd, "c:\\x\\uploads\\help\\eehelp.chm::/main.htm",HH_DISPLAY_TOPIC, NULL );
were not compiled:
C:\x\Source...cpp(334) : error C2065: 'HtmlHelp' : undeclared identifier
C:\x\Source...cpp(334) : error C2065: 'HH_DISPLAY_TOPIC' : undeclared identifier
again: in Debug mode it not only compiles it even runs well...
R.
|
|
|
|
|
Looks like you may have added the the HtmlHelp include and library paths for the "Debug" configuration only.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I've noticed a lot of questions dealing with the registry. However, none of them seem to relate to my particular problem.
I need to specify exactly where my program's data goes. My problem is that when you call SetRegKey(), it automatically makes a folder for your program within the folder that you specified using SetRegKey() and I don't want that. I wish to put my data in another program's folder.
Thanks in advance,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
|
I hate to be slow, but could you give an example of the RegCreateKeyEx (I've not looked at the others). One of the "out" parameters confuses me.
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Selevercin wrote:
I hate to be slow, but could you give an example of the RegCreateKeyEx (I've not looked at the others). One of the "out" parameters confuses me.
HKEY hKey;
DWORD dwDisposition;
RegCreateKeyEx(HKEY_CURRENT_USER,"A Dummy Key",
0,"",REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,
NULL,&hKey,&dwDisposition);
RegCloseKey(hKey);
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
Never use KEY_ALL_ACCESS! If you do, the call will fail on NT if the user is not admin. If you need full read/write privs, use KEY_READ|KEY_WRITE instead.
Happy b'day BTW
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Michael Dunn wrote:
Never use KEY_ALL_ACCESS! If you do, the call will fail on NT if the user is not admin. If you need full read/write privs, use KEY_READ|KEY_WRITE instead.
Oh! Thanks
Michael Dunn wrote:
Happy b'day BTW
Thanks again.
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
Ok, it's all looking good and better. I used Michel Dunn's idea. So this is my code:
HKEY hKey;
DWORD dwDisposition;
RegCreateKeyEx(HKEY_CURRENT_USER,"Software",0,"",REG_OPTION_NON_VOLATILE,KEY_READ|KEY_WRITE , NULL,&hKey,&dwDisposition);
AfxGetApp()->WriteProfileString("Cloaked Chat", "Test", "Test");
RegCloseKey(hKey);
</code>
It all compiles error free, but do I need to set some values for the "hKey" and "dwDispostion"? When I ran the above code, nothing happened. Shouldn't it have made a folder called test with the string "test" inside the folder "Cloaked Chat" of the software folder?
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Hi.
I have a class derived from CDialog for a dialog box. I implement a worker thread. I would like to post and/or send messaged directly to the dialog box class instead of going to main frame first. Is that possible?
Thanks,
Kuphryn
|
|
|
|
|
|
Okay.
I called PostMessage() with m_hWnd. However, the compile responded with an error that m_hWnd is unknown. What do I pass to PostMessage() such that the dialog class will handle the message?
Kuphryn
|
|
|
|
|
You don't need to pass an HWND if you are using CWnd::PostMessage.
You need a pointer to your CDialog derived class, say m_pDlg.
Now simply do this :-
m_pDlg->PostMessage(message,wparam,lparam);
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|