|
Is this a SDI or MDI application? If MDI (that's what I guess), your new doc is blank!
Do you need to share the same document between documents object? then why having separate docs objects. Do you know you may have many views attached to a single document? is it what you are trying to accomplish here?
You may call UpdateAllViews(...) to force redraw of your views, use lHint if you want to indicate which part (object) need to be invalidated.
As my daughter would say, "... Whatever!"
|
|
|
|
|
hi ernsest
my sw deals with with system designing so there has to be many diagrams which are finally connected to a main one.For this i have ot have different documents and with that different views.
As i said,the view created on startup is fine but not the new ones.
(i have now come to the gui part of my sw and am testing.Actually,no views should be on startup but created only when required with a project;when Ctrl+N dosent work i guess the views created on demand too will not work)
carlos
|
|
|
|
|
In a non MFC app theres a try-catch thing like:
catch ( _com_error &e )
{
_bstr_t bstrSource (e.Source());
_bstr_t bstrDescription (e.Description());
TRACE ( "Exception thrown for classes generated by #import" );
TRACE ( "\tCode = %08lx\n", e.Error ());
TRACE ( "\tCode meaning = %s\n", e.ErrorMessage ());
TRACE ( "\tSource = %s\n", (LPCTSTR) bstrSource);
TRACE ( "\tDescription = %s\n", (LPCTSTR) bstrDescription);
AfxMessageBox ((LPCTSTR) bstrDescription);
}
catch (...)
{
TRACE ( "*** Unhandled Exception ***" );
}
I am using this code in an MFC app, in a new class that I am making. When I compiled I got the error:
c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
When I looked this up in MSDN , I see
Fatal Error C1189
#error : user supplied error message
This error message is generated when there is an #error directive in the program. For example:
#undef _WIN32
#if !defined(_WIN32)
#error _WIN32 must be defined //error
#endif
int main() {
return 0;
}
I only have #include "stdafx.h" in my new projects class .h file.
What can I do about this error?
Thanks,
ns
|
|
|
|
|
#import "C:\\Program Files\\Common Files\\SYSTEM\\ADO\\msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )
#include "stdafx.h"
#include <ole2.h>
This error started happening when I included #include "stdafx.h", but without it it didnt know what CString was.
These are two standalone .cpp and .h files and I havent instantaited them anywhere in the main MFC project, so theres no #include "myClass.h" except in myClass.cpp.
Does this clarify matters?
Please answer. I am very puzzled!
|
|
|
|
|
In project settings I had to set:"automatic use of precompiled headers", because without that I got the error "unexpected end of file found while loooking for precompiled header directive".
Is this relevant?
Thank you,
ns
|
|
|
|
|
There is a function setautourldetect suporrted by CRichEditCtrl as per MSDN but when actually called there is no such function in the header file . there is a compiltion error can anybody help me ?????
|
|
|
|
|
In January 2001 MSDN is no such function by CRichEditCtrl. Maybe it's something added in the latest Platform SDK?
Sonork 100.15206;PavelK
|
|
|
|
|
|
I think there is a macro for this in ATL but you may want to send the message
SendMessage(
(HWND) hWnd, // handle to destination window
EM_AUTOURLDETECT, // message to send
(WPARAM) wParam, // URL detection state
(LPARAM) lParam // not used; must be zero
);
Parameters
wParam
Specify TRUE to enable automatic URL detection or FALSE to disable it.
lParam
This parameter is not used; it must be zero.
As my daughter would say, "... Whatever!"
|
|
|
|
|
There is a function setautourldetect suporrted by CRichEditCtrl as per MSDN but when actually called there is no such function in the header file . there is a compiltion error can anybody help me ?????
|
|
|
|
|
Hello;
I have trouble with CSplitterWnd and views. I have working on multiple view with CSplitterWnd sample. But i couldn't found a way to communicating views with each other. How can i set a property of an object on the other view from active view?
Thanks...
|
|
|
|
|
The member function CWnd* GetPane( int row, int col ) which returns window pointer to the window/view in specified pane can be of use.
Sonork 100.15206;PavelK
|
|
|
|
|
I have developed a chat server. In that I am displaying online/offline user list using tree control, I can see the list in all other systems except my DELL laptop which has XP Pro. Sometimes its showing 2 or 3 users including me...and sometimes its not showing a single user...I dont know whats happening. May be there will be some settings for DELL with XP Pro which I dont know. If somebody knows abt it please tell me.
Thanks
Prateeti
|
|
|
|
|
Hi,
I would like to modify the context menu string at runtime.
So i had written settext(..) in OnUpdateCommandUI ().
But it is not updating the text.Could anyone help me..
Thanks
|
|
|
|
|
|
I had tried this.
pSubMenu->ModifyMenu(ID__DELETETHEFRAME, MF_BYCOMMAND|MF_STRING, ID__DELETETHEFRAME, "&Save Selection");
But text didn't change.
|
|
|
|
|
|
I did it by position on the main menu but I had to call DrawMenuBar() maybe there is an update command for submenus.
|
|
|
|
|
Is it possible to modify the sdi window menu (File,edit...) at run time??
|
|
|
|
|
Yes it is. In OnUpdateCommandUI for the first item in the menu (file, edit or whichever) you can modify the menu (with CCmdUI::m_pMenu). It's called before the menu is pulled down and displayed.
Sonork 100.15206;PavelK
|
|
|
|
|
Hi!
How can I let Windows' Desktop know I have changed an icon shown over there? After I change DefaultIcon value nothing changes. In Windows9x I would delete ShellIconCache, but I need a way to do that in all Windows.
Would anyone help me in the problem?
|
|
|
|
|
Hi all,
I get a "First-chance exception - Stack overflow" in GdiPlus.dll when I'm calling the GDI+ function "Region::Xor(Rect&)" several times in a row (>10000). I have no idea what to do about this, so please, anyone, help me.
Thank you,
biff
|
|
|
|
|
Well im messing around with smart cards.. I can connect, find readers, get the status and everything. But I just don't understand how to write and read values... With this BYTE system....
What would this mean?:
BYTE pbSendBuffer = { 0xC0, 0xA4, 0x00, 0x00, 0x02, 0x3f, 0x00 };
I think if I knew how this byte thing worked I can figure the rest out... Sadly my c++ book doesn't have anything on "bytes " and the book from school doesn't either.
|
|
|
|
|
BYTE is usually defined as an unsigned char (8 bits). You probably know that the values inside of the braces are hex values to initialize the BYTE array.
Not much different from doing:
unsigned char pbSendBuffer = { 0xC0, 0xA4, 0x00, 0x00, 0x02, 0x3f, 0x00 };
|
|
|
|
|
WM_INITDIALG is good message to init dialog box.
is there a similar message for a normal window?
WM_CREATE is no what i want, because the message is sent before window is properly created, i.e. on the message, SetTimer function can't be used because HWND is not OK in the moment.
do u know which message is good place to init a window?
thx
includeh10
|
|
|
|