|
PaintDesktop worked OK with memory device context in NT 4. In Windows 2000 it fails. The funny thing is that you can call PaintDesktop with HDC obtained using ::GetDC or CClientDC and it will work, even on Win2000.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi there
how can i change the dialog dsplayed in the dialog bar while runtime. i want to change the dialog when the user hits a button.
how can i realize this in MFC...
thank you
|
|
|
|
|
Does anyone have any clue on how to create a "Hidden" view in a Multi-Paned MDI app?
I ahev an MDI multi-paned app and want to store Source of a document in a Hidden Edit View so I can use the Edit view to Print/Print Preview source of document.
NB: I do not have a pane dedicated to this view and therefore the "Hidden" request...
Paul McLeish, Senior Software Engineer
BELTEK, Inc
Beltek Drive & 3rd Street
P.O. Box 339
Hanna, WY 82327
Phone: 1-307-325-6776
Fax: 1-307-325-6785
mailto:paul@beltek-linkone.com
Visit our web site: http://www.beltek-linkone.com
This transmission is for the intended addressee only and
is confidential information. If you have received this
transmission in error, please delete it and notify the
sender. The contents of this E-mail are the opinion of
the writer only and are not
|
|
|
|
|
Try something like this. I haven't actually tried it but it (or something along these lines) should work:
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
SendMessage(WM_SETREDRAW, FALSE, 0L);
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
ShowWindow(SW_HIDE);
}
|
|
|
|
|
Hi,
I have an SDI application, and i created a pop up menu, but it doesn't work,
I believe that i have to call OnRButtonUp , :
void CEdgeView::OnRButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CMenu *mMenu;
CPoint m_pPoint;
m_pPoint = point;
ClientToScreen(&m_pPoint);
// Get a pointer to the menu
mMenu = GetMenu();
// Get a pointer to the submenu
mMenu = mMenu->GetSubMenu(0);
// Open it as a context menu
mMenu->TrackPopupMenu(TPM_LEFTALIGN + TPM_LEFTBUTTON,
m_pPoint.x, m_pPoint.y, this, NULL);
CView::OnRButtonUp(nFlags, point);
}
does anyone know the correct codes???
Ehsan Behboudi
|
|
|
|
|
First, I generally add a message handler for WM_CONTEXTMENU (OnContextMenu) with the necessary code for the popup menu.
Next, I believe that the popup menu is a sub menu of a menu resource not the menu resource itself.
In other words you need to call GetSubMenu with the handle of the menu resource and position of the sub menu that will appear as the popup. The position will be zero if there is only one menu in the resource. GetSubMenu will return the handle of the popup menu which you then pass to TrackPopupMenu.
Hope that helps.
- Oliver Daniel
|
|
|
|
|
hi, thanks for you reply
can you please write me some source codes please, i'm a bit confused...
Ehsan Behboudi
|
|
|
|
|
I have a treelist view. (reused the class from Gerolf @ http://www.codeproject.com/treectrl/treelistctrlgerolf.asp)
When I edit the value (thus the label) of a list item, the value of its parent/ child item are also affected. these values are update din the document but not in the tree view. Only the change in the selected item is updated, not the parent or child item.
How can I make sure that all the affected list items labels are updated accordingly. If you have a sample code, it woudl be wonderful.
Thanks!
|
|
|
|
|
Hi
I have a problem with register ("Regsvr32.exe MyServer.dll") my automation server in Win98 NOT SE(In Win98 SE - succeed)
LoadLibrary return Error Code 31 :
"A device attached to the system is not functioning"
Thanx.
Ernst.
|
|
|
|
|
Hi,
I have two questions:
1-I have a SDI application, and I like to name is "TurboMech", I like to know how can i
have that name on top of the mainframe everytime i run the program.
i used the following code but it does work
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
Create(NULL,"TorboMech",WS_OVERLAPPEDWINDOW,rectDefault,NULL,NULL);
}
2-How can i get the file name (bmp file), beside the application name when i rn the program.
Thanks
Ehsan Behboudi
|
|
|
|
|
You should find the following to help.
1) Create a function "UpdateTitle" in your document class in which you set the document title to whatever you like.
eg. "TurboMech - Filename.bmp"
2) Override the OnUpdate(...) function of your view at the end of which call GetDocument->UpdateTitle()
Note: You can check the modified state of the Document and add a "*" at the end of the new title if it has been modified since the last save.
Hope this has been of some help...
Paul McLeish, Senior Software Engineer
BELTEK, Inc
Email: paul@beltek-linkone.com
|
|
|
|
|
thaks for you reply,,
in my UpdateTitle() function, how can i initialize the title???
Thanks
Ehsan Behboudi
|
|
|
|
|
The CDocument function SetTitle(sNewTitle) will allow you to set this.
Note: Your Document's UpdateAllViews should be called on initial update or by your app when you change data, which in turn calls your Views OnUpdate.
Paul McLeish, Senior Software Engineer
BELTEK, Inc
mailto:paul@beltek-linkone.com
|
|
|
|
|
What is the best way to close (i.e., destroy) a view from its OnUpdate operation?
I don't want to close the document.
Currently, I am aware of the following options. I am not sure if they'd all work, or which would work best.
1. CDocument::RemoveView()
2. Post WM_CLOSE
3. Post WM_DESTROY
Any help is much appreciated.
Marc
|
|
|
|
|
|
How can I change the value of my document data from another class?
in my sample MFC code in MyProjectView.cpp:
...
...
CMyObject* pPencil = GetDocument()->m_pPencil;
// the value of GetDocument()->m_pPencil->Length is 0
pPencil->Length = 2;
...
...
somehow when I execute this code, the value of m_pPencil->Length in the document is still 0. how can I change the document data from my project's View class?
|
|
|
|
|
Try this:
CMyView::
{
GetDocument()->m_pPencil->SetPencilLength( 1 );
}
or, even better, as the document should be responsible for managing the data defined within it
(as with any well designed object class )
CMyView::
{
GetDocument()->SetPencilLength( 1 );
}
CMyDocument::SetPencilLength( int length )
{
ASSERT( NULL != m_pPencil ); // And other appropriate checks!
m_pPencil->SetPencilLength( length );
}
|
|
|
|
|
Okay I'm trying to regulate how many messages get sent out of my Outlook box at once...now would it be easier to monitor some MAPI call? Or should I write a small "exchange agent" to do this??
I was HOPING to write a small piece of code that I could run as an NT service that would run independently of the email client..
Does anyone have any suggestions???
thanks in advance,
Erik
I hit faked him with my win32 API .chm and the peabrain goes for it. I follow it up with a salvo of left's and right's sending him down hard. It's lunch time and he's getting a Champ Sandwhich Special. I said, How's that Mr. VB?! Is that 'I wanna use COM in that Server enough for you?!'
...Ever since then, I've been the Champ.
|
|
|
|
|
Okay did some more perusing of the MAPI docs and found what I think I needed...a MAPI pre-processor DLL component which intercepts the messages before they hit the mail transport provider..
Has anyone here had any experience programming these MAPI preprocessor guys??
thanks again,
Erik
I hit faked him with my win32 API .chm and the peabrain goes for it. I follow it up with a salvo of left's and right's sending him down hard. It's lunch time and he's getting a Champ Sandwhich Special. I said, How's that Mr. VB?! Is that 'I wanna use COM in that Server enough for you?!'
...Ever since then, I've been the Champ.
|
|
|
|
|
Hi.
I need to access not only the sent data but the whole IP packets to analyze the headers (for a firewall-like app).
My problem is, that I can't find any entry point in the MSDN to learn about access to the low level network traffic.
How can I
1. get notified when a packet arrives ?
2. get the packet form the queue ?
3. put packets into the queue ?
I'd be happy to learn about a good website/tutorial about this issue...
|
|
|
|
|
You have to write a packet driver. To do that you need the DDK (Driver Development Kit) for win9x. (download from MS)
There is a demo driver, in the DDK, that can do a lot of the things that you want
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello,
I seem to be having a problem with my message queue. I am working on a data aquisition app (multi-threaded). The data aquisition thread(s) post messages to the MFC gui thread when data is received and when the graph needs to be refreshed. Occasionally, the graph stops displaying data until the refresh occurs (rather than as it is received). When this happens, all of the buttons in the dialog become inoperable. Is there a way to do something with the message queue? I'd like to be able to see if it's getting full and, perhaps, increase its size.
Thank you.
Paul Ebert
|
|
|
|
|
Hi.
Perhaps you should try to prevent the message queue from getting overload.
I assume you don't need more than a few refreshs in a second?! So you can implement a global thread-safe bool which
- is set when a message is sent to the GUI.
- is reset by the paint reoutine after completion.
The threads only send a refresh request, when the bool is not set.
Hope it will help you.
Karl
|
|
|
|
|
In Windows 3.1 there was SetMessageQueue function that made increasing the queue size possible, but it's obsolete now - they probably made it a no-op call.
Do you really have to post multiple messages from data acquisition thread? Before posting you could check if GUI is already refreshed. If not, no need for second PostMessage.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
If you need a utility that generates a windows help file automatically from
a type library, you might want to take a look at Oberon TLB Tools utility:
http://www.vakcer.com/oberon/products/tlbtools/
This utility includes 3 tools:
TLB2HLP - generates a complete WinHelp project containing .rtf, .cnt, .prj,
and other files ready to be compiled into a .hlp file. The .rtf file
contains help topics on each objects, method, properties, etc. with
descriptions, place holders for code samples, etc. A good start to create
full online help for a COM object model or ActiveX control properties.
TLB2HTML - creates an HTML file containing all type information from a type
library with cross-references, object index, and so on...
TLB Compare - compares two type libraries and writes differences as an HTML
file.
You can find examples of how each of the tools work on the web page given
above...
I hope this is helpful...
--
Alex
----
Do you still use a stopwatch to track your project time?
Why not try a completely automatic time tracking and billing
application for Windows - VAKCER Project Tracker v2.1?
Get your free trial copy today at http://www.vakcer.com
|
|
|
|