|
rrrado wrote:
thanks, but it des not support scripting, which is neccesary
It does! And it absolutely rocks! Try it out! Just seach for Inno Setup. There is a really easy to install extension that provide scripting to it.
/Tommy
|
|
|
|
|
First a brief explanation...
I am using multiple views with one document in a MDI application in order to view different datasets. There is no files involved I'm using CRecordSet to pull data directly out of an Access database.
I investigated two options of switching views. The first one was creating an extra document template using the same document but attaching it to a different view. When the user choose to view the data I would get the apropriate document Template and create a new frame. The problem with this approach is that I had to create a new document first in order to get an active Child Frame and Document and this created an empty view on the screen that would still hang around looking messy after I closed my new frame. I could simply hide this view but it seems like a messy way of doing things.
The second approach was to create a switch view function in my Child Frame class. Here I get the active view, store a pointer to it, create a new view, show it and hide the old view. This works fine but now when I choose to print from my ChildFrame Menu the main Window printing function gets called. Why is this happening? Is there a better way of switching the views? Is there light at the end of the tunnel?
Despite being the most comical appearing of all the Martial arts the monkey form should not be laughed at because it is truly one of the world's most deadly defense systems
|
|
|
|
|
If you have two views attached to your document object, the active view will receive and act on the ID_FILE_PRINT command when it is received. If you need the other view to handle the printing action which the active view has just recievd, you need to override teh standard CView OnFilePrint() function for your active view and call the same handler in your other view. You can do this by using class wizard to map the ID_FILE_PRINT command for the view.
In this procedure you can get the document pointer and from them iterate through the documents views to find the other view, and then call its OnFilePrint().
CMyDoc *pDoc = GetDocument() ;
POSITION pos = pDoc->GetFirstViewPosition() ;
while (pos)
{
CView *pView = pDoc->GetNextView(pos) ;
CMyOtherView *pOView = static_cast<CMyOtherView*>(pView) ;
if (pOView != NULL)
{
pOView->OnFilePrint() ;
break ;
}
}
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
It works
The way is a (void)
Used but never filled
|
|
|
|
|
Hello,
when I change the window size from the top or the left edges, I get flickering in the client, my program opposed to the usual behaviour want the client clipped from where the user resize the window and not always from the bottom and right. I couldn't find where windows draws the DC. if anyone could understand my poor english and also have any idea how to solve this problem, I'll appriciate it.
Thanks,
BishGada.;)
|
|
|
|
|
try overriding the WM_ERASEBKGND message with an empty function.
The default operation of the framework is to clear the window with its background colour when this message is recieved, which is probably what's causing the nasty flickering
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
thanks, but thats not that kind of flickering, I already override the erase bg the problem is that windows scroll the DC and thats what I want to prevent.
thanks anyway.
BishGada.
|
|
|
|
|
hi,
what method do you use to terminate a thread?
i am in a situation that after few thousands of restart a thread? it failed for me to create thread for me with AfxBeginThread().
i used TerminateThread() to terminate thread from the main program, in msdn, it is not a good method to terminate a thread.
i guess it leads to the problem that i can't create thread when restart.
do you have any good method to terminate thread?
thanks,
jim
|
|
|
|
|
You can usually end your thread from within the thread with Afxenthread(); If you want to do that remotedely from outside the thread, just use an event to tell your thread to end.
~RaGE();
|
|
|
|
|
hi,
i found that the thread would not terminate immediately after call AfxEndThread(). since i used TerminateThread() to terminate another thread at the same time, so i can observe such difference.
is it normal?
thanks,
jim
|
|
|
|
|
|
There are couple of ways to terminate thread safely based on the problem
here is the event approach,
- CreateEvent() (named event to use across process'es)
- CreateThread (or AfxBEginThread) and pass event as Thread Param
- Keep listening to Event Signaling at application atomic times (WaitForSingleObject).
- when Event is signaled or job is done, just return (use AfxEndThread() with AfxBeginThread() - MFC way)
From main/any thread signal the event, when u want to stop the thread safely.
To brutally kill the thread use: TerminateThread()
Refer to samples in codeproject.com OR codeguru.com.
Hth,
Ramu
|
|
|
|
|
Ramu,
thank you! your information is so useful.
currently, i am using a TerminateThread() to kill a thread.
due to some reasons, i need to restart the threads few mins once. after few days running, it failed to to create thread with AfxBeginThread(). i doubted that related to using TerminateThread() to kill a thread. so, i am trying other methods.
anyway, your information is useful and let me check with it!
thanks,
jim
|
|
|
|
|
does anyone know how can i use the MFC'S CBitmapButton?
thanx
|
|
|
|
|
CBitMapButton myBitMapButton;
You are now using CBitMapButton. You didn't say what you wanted to do with it, but there are only 2 methods, so it can't be hard to figure out. Look up CBitMapButton in MSDN.
http://msdn.microsoft.com/
|
|
|
|
|
I'm working with a class(CSizingControlBar, or CSCBar) derived from CControlBar, and I want to place CSCBar at a MDI's child Frame, such as the main view window. But these CSCBars can be placed anywhere of the screen, i don't like it. i want to the SCBBar behave like the child Dialog.
how to realize? thank you. ;)
Best Regards!
|
|
|
|
|
Hi
Is it possible to start windows application like Notepad.exe or Calc.exe in my mdi-program?
I want the exe-application opened like normal MDI document im the MDI program window.
If this is possible please show example!
JK
|
|
|
|
|
|
Does anybody here use InstallShield ? (for VisualStudio 6.0)
I need to set up registry value, which is longer than 255 characters, but compiler writes error : string literal exceeds 255 characters (althought in help is written than STRING limit is 512 chars for 16-bit setups and 1024 chars for 32 bit) . How to writre longer string ?
Thanks
rrrado
|
|
|
|
|
solved
x = "aaaaaaaa" (<255 chars)
x = x ^ "aaaaaa" (<255 chars)
InstallShield seems to be stupid.........
rrrado
|
|
|
|
|
I have a little mfc dialog based application.
Some text in this dialog uses a diameter sign.
Font Arial, ASCII value 216 -> printf("\330")
Everything works fine under Windows NT 4 english but not under Windows 98 traditional chinese.
Can anybody help me??
Thanks
Martin
|
|
|
|
|
I want to add in the standard help file for my VB/VC++ application. Any VB6.0/VC++6.0 built-in tools can be used for this purpose? If not, any alternative can I choose?
Thanks
DJ
|
|
|
|
|
You can use Microsoft Help Workshop
Look under this folder:-
%Program Files%\Microsoft Visual Studio .NET\Common7\Tools
Filename :- hcw.exe
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
Thanks alot. But I am using VB6.0 or VC++6.0.
any more ideas?
DJ
|
|
|
|
|
DengJW wrote:
Thanks alot. But I am using VB6.0 or VC++6.0.
any more ideas?
In that case look for a slightly older version of the same file under :-
%Program Files%\Microsoft Visual Studio\Common\Tools
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|