|
If I'm understanding the problem correctly (I'm not an MFC guy), it sounds like calling the OnFileNew() function would just be a work around anyway. I think you should probably be storing, inside your CView subclass, the necessary data to reconstruct the display when zooming. If that overhead is too large (i.e. too memory intensive), then I'd recommend creating some sort of object to encapsulate access to the file, with the necessary functions to read the data as many times as necessary. Then you should be able to share that object between the CWinApp object and the CView object.
|
|
|
|
|
Dear sir,
im still unclear about the solution uv put forth.
do u mean that im suppose to derive an object from the CWinApp, so that i can access the OnFileNew() with it? how do i do that?
can u please show me a code sample please?
secondly, would it be too much if u can explain to me how to close the present window when the new window is loaded?
on the second thought...is there any other method where i can have the new zoomed display updated from within the same window, without having to close and open a new window instead?
many thanx
|
|
|
|
|
I can't give you a code sample. I'm not experienced with MFC.
I'm certain that you can update the display from within the same window, but again, I don't use MFC, so I can't give you details. Sorry, but the best I can do is recommend that you read some documentation and figure it out yourself.
It just sounds like your program is doing things in a very round-about manner. There's got to be a simpler way.
|
|
|
|
|
Hello .. i want to have a window displaying train traffic ! http://www.cti-electronics.com/screen.gif <-- just as this application.
Can u use vc++ to design such an application? and how can i make such a window inside a SDI ?
|
|
|
|
|
Anonymous wrote:
Can u use vc++ to design such an application?
Yes.
Anonymous wrote:
and how can i make such a window inside a SDI ?
It is probably not SDI but rather MDI.
John
|
|
|
|
|
I am looking for a good visual c++ book for reference and guiding me along...I have heard both pos and neg things about teach yourself c++ in 21 days...And some other simular...If anyone could help with some advice it would be greatly appreciated...
Thanks in advance Strider
|
|
|
|
|
C++ all in one desk reference for dummies is a good book. it's seven books in one and by Jeff Cogswell. It has taught me alot ISBN 0-7645-1795-3
|
|
|
|
|
Hello!! dear~~
I write this text because I have a serious question about DLL...
I should develope a appication that "produces" specific DLLs, have specific functions.
Is it possible? Through my thinking, My application must has data structures for make dll source code and has dll Compiler...
I want excellect skill or thinking or Documents about that... Please...
Sorry for my foolish English...
I hope your Help!!
|
|
|
|
|
Solid77 wrote:
Sorry for my foolish English...
It is a little hard to read your question but I understand.
I don't have any good links but I do have a suggestion.
Use the appwizard (in vc6) to create a win32 dynamic link library. Then select an application that exports some symbols. VC++ will do all the hard parts for you. Take a look at the code especially the header file where most of the work is done. When you want to add it to your application you must include the main header file from the dll, copy the .dll and .lib to same place your exeutable is and link with the .lib file that was produced along with the dll. This all sounds difficult but after you try it things should make sense...
John
|
|
|
|
|
Dear John M. Drescher ...
Thanks for your Attention... I read your reply. Sorry for my poor English again...
My original Question is How make a dll file on my application program(Like a Symphonia...
related website is http://www.orionhealth.com/symphonia_overview.htm )
for example...
simple senario...
application excute -> select principal component in contents -> click "Make dll" or "Make ocx" button -> producing dll (not in visual studio!!)
in all respects, my question was not clear because my poor english.
anyway thanks very much John... I will wait your useful reply...
|
|
|
|
|
I see Symphonia and now understand the question. http://www.orionhealth.com/symphonia_technical_general.htm[^]
My first guess is that it generates C++ statements and has a built-in compiler/linker that will compile the code it generates into a dll. Or maybe it has a dll already produced that it modifies the dll directly (by adding data to a data segment and changing function names). The second option is more difficult to do but will not require as much code to do that as the first.
John
|
|
|
|
|
|
|
the windows task manager application tab shows the application name as wellas the icon associated to that application/process.
i was making a listup of the applications that were running [task manager clone]
this i did by using the enumWindows API along with checks on the style sof the window handles obtained
and it is working
however dunno how to display the icon associated with a process.
any advice!!
|
|
|
|
|
Try WM_GETICON , I don't know if it works between processes but it's worth a try. If that fails, call GetClassInfo() to fill in a WNDCLASS struct that describes the window's class. In the struct is an HICON .
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.
-- Michael P. Butler in the Lounge
|
|
|
|
|
hello
I wants to reach to the CD Drive for reading a files,and for that i want to know how to obtain the drive name of the CD drive (ex:On my PC the CD Drive is F: \).
|
|
|
|
|
|
How do I delete a file in VC++. Let's say that I have a file in this path - C:\Windows\MyFile.jpg. How do I delete this file.
|
|
|
|
|
MFC...
::DeleteFile("C:\\Windows\\MyFile.jpg");
Non MFC...
DeleteFile("C:\\Windows\\MyFile.jpg");
Jeremy Falcon
|
|
|
|
|
|
hi,
My prblem is like.......
I have created a Service which uses one custom-built library file in Windows200, the service is running successfully in WIndows2000 environment.
I have used library file by specifying in Project->Settings->Link.
But, when i m trying to run the same service on WindowsXP it gives me an error. By debugging the application, i find out that the cause of error is the custom-built library file.
I have tried to copy the LIB file to the folder where EXE lies, and then to system32 folder...then also the service is giving an Error.
The Error is like "The service did not respond to start or control request in timely fashion"
If anyone knows the answer pls reply me asap.
|
|
|
|
|
It's possible that Windows XP has a lower tolerance for services that are slow to start. You should call RegisterServiceCtrlHandler as soon as possible in your ServiceMain , and give an accurate idea of how long it's going to take to start up using SetServiceStatus , in the dwWaitHint parameter. If this time is about to expire and you've not finished starting up yet, increment dwCheckPoint and call SetServiceStatus again. Be sure to call SetServiceStatus with dwCurrentState set to SERVICE_RUNNING once you're actually started.
The LIB file is a red herring. If it's a static library, all referenced code and data contained within it has been included in your executable. If it's an import library, you need to ensure that the DLL containing the imported functions can be found. It's preferable to place it in the same folder as the executable.
Use depends.exe from the Platform SDK to discover which DLLs an executable uses.
|
|
|
|
|
Ugh Why does this return a CTime of December 31, 1969 when I pass a CString of "Tue, 17 Feb 2004 20:21:51 GMT"
?
It works fine with dates such as Feburary 17, 2004, how can I get it to work with that CString?
CString ConvertDateToCString(CTime m_ctDate)
{
//Variables
//Date: 2 16 04
CString m_strResult="";
CTime ctResult=CTime::GetCurrentTime();
//
//Display yesterday if m_ctDate matches up with yesterday
//Date: 2 16 04
ctResult-=CTimeSpan(1,0,0,0);
if (m_ctDate==ctResult) m_strResult="Yesterday";
//
//Display today if m_ctDate matches with the current day
//Date: 2 16 04
ctResult-=CTimeSpan(1,0,0,0);
if (m_ctDate.GetDay()==CTime::GetCurrentTime().GetDay()) m_strResult="Today";
//
//Otherwise return the date
//Date: 2 16 04
if (m_strResult=="")
m_strResult=m_ctDate.Format("%b-%d");
//
return m_strResult;
}
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
How you initialize the m_ctDate ? I think that there is any signed/unsigned long mismatch, because 17.2.2004 the time_t value (number of seconds since 1.1.1970) exceeded 0x8000000 .
Another small brother of Y2K problem
Robert-Antonio
"Love without sex is like a fish without antlers"
|
|
|
|
|
Eeeeehhhh...0x40000000, not 0x8000000!!
|
|
|
|