|
Try this:
graphics = ::new Graphics(hdcPrint);
The problem is that an MFC generated define, DEBUG_NEW, defines a "new" operator that takes three parameters. It only applies for a debug build; if you do a release build your program should work. You can undefine DEBUG_NEW so that debug builds also work.
Or, as shown in the example code above, you can use the scope resolution operator ( :: ) before new to use the default C++ version.
|
|
|
|
|
It like that there is no the splash screen compoent in
VC++.Net.How can I add a splash screen to my VC++.net porject???
|
|
|
|
|
hi, is there any equivalent structure defined in C++ as that of timespec in Unix? the timespec definition is:
struct timespec {
long tv_sec; /* number of seconds */
long tv_nsec; /* number of nanoseconds */
};
I tried to search it in MSDN to no avail.
|
|
|
|
|
Check FILETIME struct. It's not the exact equivalent, but uses 100-nanosecond intervals.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
wow, this is fast. I fooled around in lounge for a while and when I was back, you have posted the answer. Salute!
|
|
|
|
|
If you look closely at the time displayed next to the subject, you'll see that I've actually answered your question before you've asked
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
wow, you are always one or two minutes ahead of me. Do you know how to read mind remotely?
|
|
|
|
|
OK, this seems like it should be very simple but I am stumped.
How can you tell an MFC menu to display itself?
I have the CMenu object but there doesn't appear to be a function for this.
SendMessage to the CDialog might be the way to go but I'm not sure what the message would be.
Michael Kramer
-=[mkramer@hamsoft.com]=-
|
|
|
|
|
If you are trying to create a Context Menu, then you should be able to use CMenu::TrackPopupMenu(...) .
Peace!
-=- James.
"Some People Know How To Drive, Others Just Know How To Operate A Car."
(Try Check Favorites Sometime!)
|
|
|
|
|
Hello everyone.
I have a question concerning how to drag
dialog boxes.
I currently have a dialog box that is completely
filled with a CWebBrowser2 ActiveX control. I
would like to be able drag the entire dialog box
when a user does a "mousedown and drag" within
the browser control.
Can anyone please help me out with this?
Thanks.
|
|
|
|
|
pseudo-code:
1-trap mouse-down message, and save current mouse position
2-trap mouse-move message, and if mouse is down, compute new window position based on current position and original position
3- move the window.
Max.
|
|
|
|
|
Nononono.
Kids, kids, haven't had to learn Windows programming the hard way...
You trap the WM_NCHITTEST message, and if it's in the area you want to act as the caption (which is where you usually click to drag the window) you respond HT_CAPTION, else you call DefWindowProc (or equivalent).
|
|
|
|
|
I need some help with Ini files as I am going to parse them in my application .
I have the following questions:
1. THis file is not going to be placed in the Windows directory . How should i Access it using the GetProfileString method ?
2. This File is a bit different . tags [] are going to be placed as
[main]
detail1=0
detail2=1
detail3=1
[detail1]
param_a=val1
param_b=val2
param_c=val3
[detail3]
.
.
Which is the best method to extract these details ?
|
|
|
|
|
Use GetPrivateProfile...() instead of GetProfile...() . You should have no problems with the format.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Use GetPrivateProfileXXX functions to access .ini files located anywhere. GetProfileXXX family of functions works only with win.ini.
act_x wrote:
2. This File is a bit different . tags [] are going to be placed as
SO where's the difference? Square brackets are used to mark sections. Are you going to use them in other context?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I am a student trying hard to learn the language and seem to be doing pretty well....for the most part. I have a small project I have been working on the past 2 weeks and am really stuck. If someone could possibly lend me some guidence I'd REALLY appreciate it.
My project has to include a FlexGrid Control with 7 Rows (one fixed) and 7 columns (one fixed). I've got this done and all the labels set. I have created my array, and used a switch statement to populate the fields that aren't fixed. For some reason that data seems to be entering into my FlexGrid purely at random. I've done all I can possibly think of and it isn't making any sense to me why this is happening.
Could someone please help me get pointed in the right direction?
Thank you for your time,
Garry
|
|
|
|
|
how do you populate fields in your Grid ?
Id use
grid.SetRow(desired_row);
grid.SetCol(desired_col);
grid.SetText(value);
|
|
|
|
|
I have a Child Frame that I need to minimize and maximize but not destroy . i.e I dont want the Frame to be destroyed when one clicks on the "X" button on the top. Please help
|
|
|
|
|
Add WM_CLOSE handler and do nothing in it. Especially, *do not* call base class.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
You could remove WS_SYSMENU from the window style for the child window. Then there wouldn't be an "X" button.
|
|
|
|
|
i have a file that have a string:
%4d%4d
then i want to format %4d to string./
let say.. %4d is 3425 and second %4d is 876. ( they could be any number, i dont know. if you open the file and see you only see %4d%4d not a number.)
first can i format them? how should i???
|
|
|
|
|
maybe this is what you want:
char buffer[10];
sprintf(buffer, "%4d", myInt);
file.Write(buffer, strlen(buffer));
|
|
|
|
|
no i know that. but that is not what i want...
there is a %4d.. but i have to read it or convert it to string or int
not int to string.
|
|
|
|
|
I am sorry, but not clear with your requirement. Anyway, this is what I understand so far:
If there is a 4-character field in your file, and you want to extract it, you can use this:
nRet = fscanf(fp, "%4d", &myInt);
if ( nRet == 0 )
{
nRet = fscanf(fp, "%4s", &myStr);
if ( nRet == 0 )
TRACE("Cannot extract this field\n");
}
|
|
|
|
|
your question is not very clear - does the file have two numbers, say
3425
876
?
If so, you can reformat them using the CString::Format(...) function and rewrite them back to the file.
ashish
|
|
|
|