|
Hi All,
Been stuck with this problem for quite sometime now, tried some other discussion group - no help, hope someone here can help me....
I would like to launch a CMiniFrameWnd/CDocument/CView derived objects from a Dialog based program (Doc/View was not selected during AppWizard).This window is a floating window above MyDialog and contains all the built-in Doc/View architecture when launched. This is what I have done up to now:-
BOOL CTestApp::InitInstance()
{
Other stuffs.....
CSingleDoctemplate* pDocTemplate;
pDocTemplate=new CSingleDocTemplate(
IDR_MINIFRAME, // I also have a problem understanding the string
// resource needed for this value here, no menu,
// no icon
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CMyMiniFrame),
RUNTIME_CLASS(CMyView));
AddDocTemplate(pDocTemplate);
CMyDlg dlg;
int nResponse=dlg.DoModal();
etc etc
}
void CMyDlg::OnButton1()
{
// Here is where I would like to launch my floating Doc/View Frame
// I have no idea how to do it......
}
Thanks For any help
Mustafa
|
|
|
|
|
given that a dialog will by default be modal it will have the focus of your app until it closes ... to launch another dialog would be trivial ... launching a non-modal window would be like launching a modeless dialog as far as i can tell ... you would have to post a message to the modeless window if the modal dialog closed
also if you didn't include doc/view support during appwizard phase a lot of support code will not be included so as far as i can see you'll be doing a lot of work to get it done ... can you not structure your app differently to make life easier?
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Installation of my machine:
-Visual C++ 6.0 enterprise edition
-Service Pack 4
-Processor Pack from Microsoft (ISSE, SSE2 support)
(-Windows 98 SE
-MSDN library
-Visual Source Safe 6.0)
Every time is start debugging on my machine with VC++6.0 debugger, I get an completely empty call stack window.
This happens always, and independantly of the project I want to debug. I have uninstalled/reinstalled VC++6.0 already,
but without success. Does anyone have a good tip for me?
|
|
|
|
|
I'll take Processor Pack for 200.
Seems to me it installs some updated DLLs - if these don't come with the same sym tables or pdbs as the regular VC stuff, that might kill the call trace.
Not sure, but have you tried uninstalling/reinstalling VC without the PP?
|
|
|
|
|
Yes, I already have tried uninstallig and reinstalling everything. I also have tired debug mode and the call stack
without the service packs and the PP - with no success.
Anyway I don't think that the PP is the problem: I have another machine configured the same, and on this everything runs well:
VC++ 6.0, Service Pack 4, PP, call stack works properly in debug mode...
I use the first machine to edit and compile the code (Win98 SE) and the second machine (Win 2000 professional) via remote debugging over LAN (TCP/IP)
tu run and test the code. But this should'nt be the reason for my problems, cause I have had this call stack problems already before using this remote
debugging combination.
|
|
|
|
|
Most likely you'll find that you are simply looking in the wrong thread. On Win2K I think you see extra threads even if your application isn't multithreaded. Use Debug|Threads to select the main thread and all should be well.
Hope that helps.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
... unfortunately it didn't help ...
|
|
|
|
|
... unfortunately it didn't help ...
|
|
|
|
|
In Debug|Threads do you see more than one thread? You need to either Double click on the list item or press Set Focus before you will see the Stack Trace for the selected thread.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
Yes, I see several threads; but neither double clicking nor pressing "Set focus" does help. BTW, even the context selector
(the drop down selector on top of the "Variables" debug window) is empty, i.e. doesn't contain any contexts.
|
|
|
|
|
... meanwhile I have reinstalled my machine in the following way:
* deinstall Microsoft Visual studio
* reinstalled WIN98_SE
* installed MCS
* tested debugging and call stack - no success! Call stack stays empty!
* installed service pack 4
* tested debugging and call stack - no success! Call stack stays empty!
* installed PP
* tested again with no success
Seems to be all very strange to me ...
Roland
|
|
|
|
|
Hi everyone,
I'm trying to build an activeX (ATL)witch contain a combobox.
The problem is, I can't see the strings that I add in the combobox list.
At test mode everything seem perfect, but When I insert my New control in any container there is no string inside.
I learned on another site that it is a bug, But they don't say exactly how to solve it.
I'm usign Visual C++ 6.0 to build it. This crucial for me
Please if you have any solution contact me that will appreciated.
Email: skoomson@motus.com
|
|
|
|
|
I'm trying to setup Microsoft's Intenet Connection Sharing from C++. MS
Knowledge Base article Q234815 talks about the ICS "APIs for configuration,
status and dial control for programs." However, even with MSDN, I can't find
any reference to these APIs.
Windows 98 has a DLL called icsapi32.dll and dumping the exports shows me
that these functions exist:
IcsConnect
IcsDisable
IcsDisconnect
IcsEnable
IcsEnumerateActiveMappings
IcsEnumerateClients
IcsEnumerateInstalledMappings
IcsGetAdapterList
IcsGetClientOptions
IcsGetConfiguration
IcsGetStatistics
IcsSetClientOptions
IcsSetConfiguration
IcsSetHomenetConnection
IcsSetInternetConnection
IcsSetMapping
but I can't find any doc on them. I've searched MSDN Universal,
developer.com, most of these newsgroups, and the Platform SDK header files.
They're supposed to be supported in Windows 98 Second Edition, ME, and 2000.
Does anyone have any ideas where I can find any information on these calls?
Thanks for your time.
|
|
|
|
|
I have a CButton-derived control (let's call it MyCButton) for which I am handling the painting. I do my painting in MyCButton.DrawItem().
The problem is, Windows erases MyCButton before each call to DrawItem(). That causes massive amounts of flickering.
How do I stop Windows from doing this? Are there any better ways of going about what I'm trying to do?
|
|
|
|
|
Try adding a handler for WM_ERASEBKGND . In the OnEraseBkgnd handler, do nothing - just return TRUE.
|
|
|
|
|
Is there a way to enumerate all the symbols exported by a loaded dll file?
Thanks!
|
|
|
|
|
Hello.
I'm working on an application that displays processes state. I manage to get their
handles thanks to "OpenProcess" function. Now I'd like my application to react when one of these processes terminates. How can I do ?
I understand that I probably have to implement callback functions, but how ?
Do I have to use "RegisterWaitForSingleObject" function ?
Thanks.
|
|
|
|
|
ummmm unfortunately its not so easy to get notified of things happening in other parts of the system ... thats why the process viewer in winnt polls every few seconds and gets a snapshot of whats happening
theres a styling article in an old copy of msj (jan 1999 - nerditorium) thats suggests using a fake kernel mode driver that can send notification to the user mode app across the dark divide from the kernel where it all happens (yeah yeah)
check it out ... i think it'll answer you're question
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
If you can't get the notification - and I can't think of it at the moment, you can
poll for the termination of the application using GetExitCodeProcess(). This will
either tell you the process is still alive, or give you its exit code.
Not ideal, but a start.
Stepehn Kellett
|
|
|
|
|
I have the following problem with virtual memory on NT. I have a 900Mhz athlon with 256MB of pc133 memory in windows NT 4.0 SP6a. I am developing and application to digitize 30 to 50 MB images (mammograms). The digitizer has 16 MB buffer and takes about 1 minute to digitize a film. The digitizer may not stop if the buffer is overrun so my program must not be inactive for more than 10 to 15 seconds. You would think this is easy. The problem is that I need to load 1 to 6 images into memory at a time. The system has enough memory to hold 4 images and swapping out parts of the images is not too bad as long as it does not make my application inactive for more than 10 seconds. The application's process is set to high priority and the task that reads the data is also a high priority thread. I set the minimum working set size to 128MB. Everything works fine with the application until I press the minimize button when the application is using 200+ MB of physical memory. When this occurs NT 4.0 pages out all the memory but about 2MB. The problem is that during this paging operation (thrashes for over 20 seconds), my application does not get enough cpu cycles to read the data from the digitizer and the buffer becomes overrun. I cannot allow this to happen because we are developing a time critical application and any failures will cause the whole operation to be aborted and a tech will have to restart the process from the beginning.. My solution for now is to disable the minimize application button, but is there a way without a Virtual Lock on each image to force NT not to page out all images at once.
Here are my allocation statements:
BOOL CImage::AllocateBuffer(UINT nMaxRows, UINT nMaxCols)
{
BOOL retVal = ( m_pBuffer == NULL );
if ( retVal ) {
m_nMaxCols = nMaxCols;
m_nMaxRows = nMaxRows;
m_pBuffer = (PWORD)VirtualAlloc(NULL,nMaxCols * nMaxRows * sizeof(WORD),
MEM_RESERVE,PAGE_READWRITE);
retVal = ( m_pBuffer != NULL );
}
return retVal;
}
BOOL CImage::CommitBuffer(UINT nOffsetBytes, UINT nBytes)
{
BOOL retVal = ( m_pBuffer != NULL );
if ( retVal ) {
PBYTE pBuf = (PBYTE)m_pBuffer;
VirtualAlloc(&pBuf[nOffsetBytes],nBytes,
MEM_COMMIT,PAGE_READWRITE);
}
return retVal;
}
BOOL CImage::FreeBuffer()
{
BOOL retVal = ( m_pBuffer != NULL );
if ( retVal ) {
retVal = VirtualFree(m_pBuffer,0,MEM_RELEASE);
}
return retVal;
}
Allocate buffer allocates a memory block for the image. I don't commit the memory during the allocate, because I don't know the size of the image until I finish digitizing. I allocate the largest possible image size and I commit sections of the buffer as I read the data from the digitizer.
Thanks in Advance,
John M. Drescher
|
|
|
|
|
as far as i know widows pages stuff out when minimizing as the app is assumed to be going bye byes for a while and so does not need the resources it had whilst running as the focus app
could you not spawn a digitizing thread off for each image and wait for them to finish from the main app? (am i talking sh*t?)
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
I have a digitizer thread (high priority) that is started by the main application. The one thing that gets me about this problem is that I developed the application on a Pentium Pro 200 under win2k with 128MB of memory and I don't remember seeing the problem (although it might have occured). I can't use Win2k in the final application because of the high resolution video (2 head * 2k by 2.5k pixels grayscale and costs $10,000 US) card does not have win2k drivers.
Thanks,
John
|
|
|
|
|
Ok,
I don't have a solution for your memory problem, but this should be a solution
you can use to workaround the problem.
Use two programs, one for the UI and one for doing all the work and managing the
memory, doing the digitizing etc. Use pipes (named pipes are valid on NT and 2000,
not valid on 9x/Me) to communciate between the two processes. When you minimize
the UI that process will get paged out but your digitization process (which I'm
assuming won't be visible, except on task manager) will carry on as normal.
I've got a similar program at home, except its a commercial project, so sorry,
no source code as an example. PlatformSDK has some good examples of communicating
via pipes. If you don't like pipes, you can use shared memory (which underly pipes
anyway), DDE, TCP/IP, etc).
Hope that is of use.
Stephen Kellett
|
|
|
|
|
Greetings, image processing MFC wildmen (and women),
Application: find edges in an image (machine vision task). Question: how would you architect this type of app? SDI, with the image data in the document and multiple views of the document (grayscale, binarized,...)? Other suggestions?
John K
|
|
|
|
|
i would use an mdi app with a separate view for each different version (greyscale,color,etc) of an image in the view's doc
for image manipulation algorithms theres a real cool book full of complete hieroglyphics and gobbledy-gook called "Digital Image Processing" ... i had it as a coffee table book once to impress people ... never understood a damn word of the heavy maths but hey ... it made people think i did
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|