|
CString strDate;
strData.Format(...); // works like printf
INTP
|
|
|
|
|
WORD day = systime.wDay;
WORD month = systime.wMonth;
WORD year = systime.wYear;
CString strDate;
strDate.Format("%u/%u/%u", year, month, day);
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
In the MFC try CTime::Format or strftime for Win32
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
|
|
|
|
|
I agree with the previous poster. If you are using MFC either use CTime or COleDateTime and they both have a function to convert the time to a string in whatever format you need.
John
|
|
|
|
|
Hi !
We are developping an application in C++ with Visual Studio 6 SP5.
I'm compiling my application in Debug mode.
Since a few hours, when I run (with CTRL+F5) my application, it crashes. I have no idea why.
When I try to debug, and run it with F5 (debug), my application does not crash !
Doing some tests, I realised that showing a dummy message box at a certain point in my code make it work !
And, if I compile my application in release mode, it works fine !
My collegue, who is working on the same application doesn't have this problem. If I try to copy his sources directory in my own directory and to rebuild my app, I still have the problem.....
Any idea what's going on ????
Thanks !
Jerome
|
|
|
|
|
Jerome Conus wrote:
...when I run (with CTRL+F5) my application, it crashes.
Where? Is it at a certain point when you are interacting with it? Does it happen before a particular dialog is displayed? Define "crashes." Is this an unhandled exception? Does it also happen when ran from outside of the IDE?
Jerome Conus wrote:
Any idea what's going on ????
No, but this article might help.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Thanks, but as I said, the release version works fine. Only the debug version is crashing. If I execute the debug version (ctrl+f5) it's crashing, if I debug the debug version (f5) it's not crashing.
Jerome
|
|
|
|
|
It sounds like you are overwriting some memory location, the debug version is probably checking for this whereas the release version is not.
Assuming this is the reason it could be a M$ fault or one of yours, in cases like this I like to run the code through a program like Bounds Checker, it might solve the problem, it generally finds a few "bugs" for you that you did not know about!
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
|
|
|
|
|
Jerome Conus wrote:
when I run (with CTRL+F5) my application, it crashes
and run it with F5 (debug), my application does not crash
Is it multithreaded? If so, you have a race condition that's dependent on your hardware, and doesn't show up in the debugger. The debugger suspends all threads except one, which totally changes the timing of when threads run.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?
|
|
|
|
|
How do I append one Microsoft Word document to the end of another programmatically? I have tried Merge(), Merge2000(), Subdocuments() and PrintOut() to a file. The PrintOut() works, but does not generate a .doc file, just a .prn file. The documentation for Word automation is poor at best. I need an answer soon.
Duncan Wells
|
|
|
|
|
I do not think that it is possible to do so. Merging two MS Word Documents would require knowledge of the Word file format or APIs that read from the Word doc. And understandably, Microsoft is very reluctant to share those!!
One question:
Have you tried merging the two documents using a simple text editor like textpad or notepad? If you are unable to do so manually, chances are, you wont be able to write a program that does so.
|
|
|
|
|
Not sure about this, because I haven't tried it.
Could you not create a new blank document, open the first document, select the contents and do a copy and paste into the new document. Open the second one and copy and paste the contents to the end of the new document.
[edited as i screwed up the link]
This link may be useful, it's VB but it shouldn't be hard to convert[^]
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
I've been trying to avoid that alternative. Select, Copy, GOTO end and Paste. But essentially that's what I want to do. The other reply said it can't be done, but we know better. Anything can be done in software.
I do have a blank document (landscape) and a .dot file which has all the characteristics of the repeated format.
Interfacing with any MS automation object has it's drawbacks, but it does procude good results when figured out. I do considerable work with embedded Word, Excel and Access.
If you know of a room or site where I can communicate with other who do the same type of work, let me know.
Thanks,
Duncan
|
|
|
|
|
Duncan Wells wrote:
If you know of a room or site where I can communicate with other who do the same type of work, let me know.
one of the microsoft.public.office.developer.* newsgroups may be the best bet.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
Hiya I need some tips on how to do this.
I have to implement a SEARCH FEATURE. It is the same type of search that
.NET STUDIO intellisense uses. Therefore, it starts off with a char/int and searches for all occurences of that. Then when you type the second char/int, it searches for all occurences of char/int 1 + char/int 2 and so on.
Example:
Letter or Number 1 keyed: N
Searches for N. // narrows down search to N's.
Letter or Number 2 keyed: 7
Searches for N7. // narrows down search to N7's.
Letter or Number 3 keyed: 9
Searches for N79. // narrows down search to N9's.
etc.
And so on. MAX number of entries 20.
What is the best way to do this?? Check each char/int one by one or have some sort of wild card use i.e N* next time N7* or some type of bubble sort.
Does anyone have any examples of this type of search??
Thanks.
|
|
|
|
|
One possible solution is a map with custom sort/find algorithm. In this case, the sort/find algorithm would search based on the size of the key instead of the entire string in the map as well as from beginning to last.
std::string sTemp = "Year 2004";
...
// Find algorithm
return sTemp.substr(0, 4) == "Year";
Kuphryn
|
|
|
|
|
I created a rich edit control. I use it to display data to a user. I want the user to be able to scroll through the data, but not be able to input data into it by clicking or typing. I tried EnableWindow(FALSE) which prevent user from entering key strokes and mouse clicks, but also prevents them from using the scroll bar. I tried to call EnableScrollBar, but it did nothing. Any suggestions. Thank you.
|
|
|
|
|
Use the ES_READONLY style.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
In the RC file, the style was set to read only. However, it did not work right until I called SetReadOnly( TRUE ) inside my .cpp file. Strange. When I created the control, I set the properties to read-only.
|
|
|
|
|
Anonymous wrote:
However, it did not work right until I called SetReadOnly( TRUE ) inside my .cpp file. Strange.
Which should raise a big, red flag that something else is wrong. Right before calling SetReadOnly() , see what the following does:
TRACE("%d\n", m_editbox.GetStyle() & ES_READONLY);
Anonymous wrote:
When I created the control, I set the properties to read-only.
And they should remain that way until some other piece of code changes it.
I would suggest creating a temporary, dialog-based program that has nothing in it but a rich edit control. Set its style to include ES_READONLY , fill it up with some text in OnInitDialog() , and see if it behaves correctly.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Setting the Read Only style solved the typing issue. However, the user can still click on the control. When the user does this, the text updates at where the user clicked. Must I force the the line scroll down before each text update or is there a way to disable the mouse clicks inside the text area? Thanks.
|
|
|
|
|
I am getting the foll. error while starting an application.
Error 430, "Class does not support Automation or does not support expected interface."
after this error, the application exits.
How to rectify it.?
Shenthil
|
|
|
|
|
Is this a VB application trying to call a COM server?
The first thing to make sure is that your COM server is registered correctly.
Second, make sure the interface you are trying to support is IDispatch derived.
It would be of help, if your message contained a little more detail about what code is being called.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
Thanks.
Actaully, I'm using an third party application which throws this error. I cannot be very sure its a VB code
shenthil
|
|
|
|
|
Shenthil wrote:
Actaully, I'm using an third party application which throws this error. I cannot be very sure its a VB code
It's certainly a COM error. It maybe that the COM component it is trying to call doesn't exist on your machine or isn't the right version. I've seen this happen sometime with apps that try and call the MSXML stuff, or the CDO components or some other COM server.
What does the application do. It may give a clue to what it is trying to call.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|