|
of course not, it's a representation of what kind of date format i want, for example, if date2=5/09/01 and date3=18/12/03 i want to do a sort of concatenation with the twice to have the result:5/09/03.
I hope you see now what i mean.
gerald
|
|
|
|
|
Just like James posted - use COleDateTime::SetDate:
d1.SetDate(d2.GetYear(), d3.GetMonth(), d3.GetDay());
Year comes from d2, and month and day from d3.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Use the member function SetDate().
(2b || !2b)
|
|
|
|
|
How can i change the edit control's bkcolor?
|
|
|
|
|
Handling WM=CTLCOLOR you can set the back color of the control, use pDC->SetBkColor(COLORREF)
ORi
|
|
|
|
|
Hi,
I want to avoid user resize my main window. My project is based in SDI and use a CFormView.
I tried to use SetWindowPos in CMainFrame and in OnInitialUpdate it don't work.
Can anybody help me please
Regards
|
|
|
|
|
Add this line in CMainFrame::PreCreateWindow.
cs.style &= ~WS_THICKFRAME;
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi
I drew a few line .Now I want to select a particular line by clicking on that line.I implemented a funtion which will take the mouse point and end points of line as parameters and returns true if the point is on the line by using Bresehalm's algorithm.for that I need to find the slope of line.the window has default mapping mode MM_TEXT.How can I convert the device coordinates into physical coordinates as if I place the mouse over the line the function should return true?how to solve this problem?please help me.for the lines with negative slopes I am getting errors.
Thanks
Regards
Pathi
bhikshapathi_g@semanticspace.com
|
|
|
|
|
is ScreenToClient() what you are looking for?
Else search for "Coordinate Space and Transformation Functions" in MSDN...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
How can I convert the device coordinates into physical coordinates
There's no such thing as 'physical coordinates' in GDI. You can convert between device and logical coordinates using LPtoDP and DPtoLP, but I don't think this is going to solve your problem.
Check http://www.faqs.org/faqs/graphics/algorithms-faq/, item 1.02 - "How do I find the distance from a point to a line?". If distance is small, you can assume than mouse is over the line. The definition of 'small' depends on your application - you can use some tolerance in testing, for example if user clicks two pixels from the line, it may be close enough.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
How to get a selected MenuItem ID from subject ?
PopupMenu is a member of other programm.
|
|
|
|
|
Dear all,
I have a trouble in executing my AP in WinNT 4.0.
It shows a dialog saying unable to allocate entry
point __lc_collate_cp in MSVCRT.dll. I copy MSVCRT.dll
to the directory but still failed.
The AP runs ok under win98, win me and win 2000.
Can u help me about this??
|
|
|
|
|
Use the Dependency Walker (DEPENDS.EXE - it comes with VC++) program to analyze dependencies between .dlls used by your app. You'll have to copy depends.exe to NT4 machine.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I used the Dependency Walker and found that the default MSVCRT.dll are different in Win98 and WinNT4.0. The one in WinNT4.0 lacks the function __lc_collate_cp. It's why i get the error in WinNT.
I went to the MSDN web and found that the error may also occurred in Visio 2000. Microsoft recomment user to update MSVCRT.DLL by user himself....
I also found that my AP uses MSVCP60.DLL and this call to the __lc_collate_cp in MSVCRT.DLL. Could u tell me what kind of library will link this DLL ??
|
|
|
|
|
MSVCP60.DLL contains STL-related classes, like std::string or iostreams.
You basically have two options now:
1) link statically to C runtime
2) create an installer that updates MSVCRT.DLL and MSVCP60.DLL. Note that users will have to reboot after install - these .DLLs are used by Windows itself and can't be simply overwritten.
Oh, and there's one more possibility, but I've never tried this: you can copy correct MSVCRT.DLL and MSVCP60.DLL to your application directory. The Windows loader looks for DLL in app dir first.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
It's right, I used STL in my project and it causes this problem.
I'll use static link in my project to solve this problem because it's not working by copying the 2 DLL in the AP's directory in NT...
Thank u...
|
|
|
|
|
Hello everyone,
I have an application that need to connect to a mapped drive using the CreateFile() function. It ran fine as an application. However when i convert the application to a NT Service, it can't work.
What is the cause for this and how do i solve it?
Any help would be great
Thanks
|
|
|
|
|
What account is the service running as? Mapped drives are specific to one account, so if the service is running as the system account, it doesn't have the drive mappings that you make in your own account. Change the service to run under your account.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
By default all services logs on as the "system" user. This user is different for every NT machine on a network. That's why it only have access to the local machine.
If you want a service to connect to other machines, you should make an account on those machines with the same username and password, or if the machines are in a domain, just make a domain account. When you change the service to log on as that account it should work just fine (if this user have access the the shared resources, of course)
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Oops, I forgot...
You cannot connect to a mapped drive like "m:" you have to connect to the UNC path like "\\server\share".
I don't know how you map's your drives, but most often it happens with a logonscript, and a service can run without you are logged on. Even if you are logged on it won't work for the service, because it actually runs under another (hidden) desktop than you do...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello all,
I have created a dialog type app.. I have a modeless dlg box that needs to run a timer, the reason it's Modeless is the timer needs to be active all the time even when the Dialog box it hidden (I'm checking if the timer is equal to a int every second, when they match I run a event).. I added the WM_TIMER function to this Modeless dialog.. When I fire the "OnTimer(UINT nIDEvent)" by doing a "SetTimer(IDC_S_TIMER1,1000,NULL);" from another control, I get the following error in debug mode:
First-chance exception in Dialog.exe: 0xC00000FD: Stack Overflow.
And it points to OnTimer(UINT nIDEvent)
->{
Any ideas why?
Thanks,
RobJones
|
|
|
|
|
The stack overflow could be caused by recursive calling OnTimer(UINT nIDEvent). How does the call stack look after the exception?
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Sorry, I'm new to programming and I'm not sure what the call stack is.. is this maybe what your talking about:
139: void CAdd1Dlg::OnTimer(UINT nIDEvent)
140: {
00402750 push ebp
00402751 mov ebp,esp
00402753 push 0FFh
00402755 push offset __ehhandler$?OnTimer@CAdd1Dlg@@IAEXI@Z (00551555)
0040275A mov eax,fs:[00000000]
00402760 push eax
00402761 mov dword ptr fs:[0],esp
00402768 sub esp,0B78h
-> 0040276E push ebx
0040276F push esi
00402770 push edi
00402771 push ecx
00402772 lea edi,[ebp-0B84h]
00402778 mov ecx,2DEh
0040277D mov eax,0CCCCCCCCh
00402782 rep stos dword ptr [edi]
00402784 pop ecx
00402785 mov dword ptr [ebp-10h],ecx
141: switch (nIDEvent)
Sorry for my ignorance..
Thanks for your help!
Rob
|
|
|
|
|
Try
inline void CAdd1Dlg::OnTimer(UINT nIDEvent)
|
|
|
|
|
Just tried it and I still get the same error..
Thanks for the help though,
Rob
|
|
|
|