|
The fact that you know OLE exists tells me that you are more than capable of figuring this out.
string strDate = "Fri Oct 13 01:32:38 CDT 2006";
string strDOW = strDate.substr(0, 3);
string strMonth = strDate.substr(4, 3);
int nDay = atoi(strDate.substr(8, 2)); Once you have all seven pieces extracted, you can then populate one of the date-related structures (e.g., tm ). You can use a function like mktime() to convert that structure into a fully defined structure with normalized values.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm using a static control to draw something on it.
the static is in a dialog create by resource editer.
It's strange that I can draw outside the static contol, but not outside the dialog.
How can I prevent this? I want to draw only inside the static contol.
|
|
|
|
|
Check out the CS_PARENTDC windows class style for information on why this happens. One solution is simply not to draw outside the window! Another is to set a clipping region with the GetDCEx function.
Steve
|
|
|
|
|
When you draw in a DC, you can't draw outside the window that the DC is for. So it sounds like you're getting a DC for the dialog, not the control.
|
|
|
|
|
You can if the window class has the CS_PARENTDC style set.
From MSDN:
CS_PARENTDC
Sets the clipping rectangle of the child window to that of the parent window so that the child can draw on the parent. A window with the CS_PARENTDC style bit receives a regular device context from the system's cache of device contexts. It does not give the child the parent's device context or device context settings. Specifying CS_PARENTDC enhances an application's performance.
Steve
|
|
|
|
|
Yes I agree.
Thank you very much, you did let know why I have this bug and how I can fix it.
I used SelectClipRgn() to fix it, which is similiar to your GetDCEx.
|
|
|
|
|
That looks like an optimization that made sense when our computers were running at 4.77 MHz.
|
|
|
|
|
i want to use imagehlp.h for a test program,but if i include imagehlp.h,there would be a number of errors occur,these are:
>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wincrypt.h(37) : error C2146: syntax error : missing ';' before identifier 'HRESULT'
1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wincrypt.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wincrypt.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wincrypt.h(249) : error C2146: syntax error : missing ';' before identifier 'HCRYPTPROV'
... ... too many,i almost can't paste all.
Any advice?
|
|
|
|
|
Hi,
Try to include "Imagehlp.lib" with or without including the header file.
What function you want to use in ur test program?
Thanks,
Suman
|
|
|
|
|
oh,i see the problem now,i should include <windows.h> before imagehlp.h.
here,i wanna to use MapAndLoad() function. but i find its parameters such as imageName and dllPath are all LPSTR type,it seems that,this function has only one ascii version but no unicode version,right?
|
|
|
|
|
Hope You're right, try it anyways. Dont understand how that can give a missing ';' though. Do understand how that can foul at run time. Manifest Constants??
Regards
Bram van Kampen
|
|
|
|
|
Nothing to do with this particular code, but:
Missing ; before (type) means exactly that. You left out a ';' before the type, or you wrote something that the compiler interprets as needing to end in a ';', the compiler got lost. Can be messy if your error occurs in an included header.( as in your case) Ignore the other errors, I once created 2347 errors by leaving out a single comma in a bad place. An enum not terminated with a ';' is a famous way of causing this.
You left out one piece of information. Prior to the lines above you have a line stating:
compiling: C\\....\\MyFile.cpp. Go through this cpp file like a dose of salts, and replicate what the compiler reads, find out what was hit Prior to 'wincrypt.h'. The first error occurs in Line 37. That seems to indicate something wrong in the file immediately preceeding 'wincrypt.h'. If the preceeding file is a compiler include, the question arrises: Are all the Manifest Constants correct.
I am aware of the annoyance of this sort of error. Can literally take days, but there's no shortcut. When you discover the error of your ways it's typically a 'Kick yourself'case.
Bram van Kampen
|
|
|
|
|
yeah. the errors are not in my files,but in vc included files.
when i include windows.h before imagehlp.h,all the errors dispear.
Thanks.
Regards.
|
|
|
|
|
Well, the jury is out on that one. At least you got going.
Regards,
Bram van Kampen
|
|
|
|
|
pardon? I don't know what you did you mean? Would you like to explain it?(I am sorry for my poor english).Thanks
|
|
|
|
|
Well,
'The Jury is still out means in the anglosaxon court system, that the jury is still out to decide who was right or wrong.
In your case, you seem to blame VC by accusing it of not telling you to include 'Windows.h'
I would not consider this a VC Fault, you neglected to insert 'Windows.h'
Why should the Compiler tell you.
This is worthy of a long desertationn starting with what a compiler does. Do you know what the Linker does. How do you link a DLL.
Thank God it Did not. The compiler can be used for many purposes. VC and MFC are distinct and exceptional applications, within the Compiler Environment.
In my opinion, if 'Windows.h' was ommitted by you. That was your fault. Nothing to do with vc
But, as I said before Never mind the theory, you got running.Learn the Lesson.
Regards
Bram van Kampen
|
|
|
|
|
OK,thanks for your reply.
In addition,I think I should learn english much harder in future.
Regards.
|
|
|
|
|
Hi,
How to assign the set of points of a polygon to a HRGN.
|
|
|
|
|
|
Hi,
Thanks for the help!!
Rgds,
Suman
|
|
|
|
|
I need to Encrypt/Decrypt a small, approx 4k block of data and would like to use Asymetric keys of at least 256 byte. Anybody aware of PD Code that can do that with a minimum of fuss. Ofcourse, I also need to generate the two keys, Public Decryption, and Private Encryption. Alternatively, Is it possible to use one of the Windows Encryption Services for that, if so, how, and how do I create the keys.
Regards,
Bram van Kampen
|
|
|
|
|
|
|
Using C++ MS Word Automation (Word 2002 / MSWORD.OLB )
Trying to programatically - and silently - implement "ConvertToPDFandEmail" macro. Need to supply "SaveAs" file name and suppress SaveAs file dialog - to eliminate user response requirement.
Is there a way to pass a target File name and, if necessary, other parms to the macro?
I've been unable to find any information about this macro anywhere (including Adobe site).
Can anyone point me to docs?
Thanks
|
|
|
|
|
After two days of banging my head against the wall with coding attempts - I found the answer. .. as usual - something simple that I overlooked.
An Adobe menu option setting in the Windows installation - "Change Conversion Settings" - unchecked "Prompt for Adobe PDF Name".
|
|
|
|