|
I don't know exactly what you mean, but perhaps this helps:
Open the properties of your dialog and there select a menu-resource
which the dialog shall use. hth.
|
|
|
|
|
In the resourceView tab, Only select in the properties of the dialog, in the tab General, in the combo Menu, the menu that you want in your dialog.
Cheers
Carlos Antollini.
|
|
|
|
|
Thanks to everybody for helping me
Wolfgang
|
|
|
|
|
You know how if one selects multiple files in Explorer and then begins to drag them, an onscreen representation of those files is visible? I want to do something similar to that (not using a common control) an am trying to figure out the best method. I don't believe CreateCurosr will do, because one is limited to the system metrics for cursor size. Does anyone have an idea as to how the drag images larger than the 'standard' size are created in Explorer?
TW
|
|
|
|
|
Check CListCtrl::CreateDragImage or LVM_CREATEDRAGIMAGE if you play directly with API.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks for your input, but as I mentioned in the original post, I am not using a common control such as the List View. I know I'll have to use the API directly, I'm just looking for some non-MFC, non-Common Control ideas of where to start.
TW
|
|
|
|
|
Oops, sorry for the listview reference. Anyway, the easiest way is to follow the listview. It uses imagelist for drag'n'drop. You can 'manually' use imagelists, the functionality is exposed at the API level:
ImageList_SetDragCursorImage
ImageList_BeginDrag
ImageList_DragMove
ImageList_DragLeave
ImageList_EndDrag
ImageList_GetDragImage
Look at the 'Dragging Images' section in the 'Image Lists' at MSDN.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi,
Thanks for all of your reply about my question before. THANK YOU VERY MUCH!!!!
I try to keep posting my question, so that someone new can see this question and tell me how to fix it....
My major problem is: I have a program that was implemented in NT before and now want to transfer to Win9x. Everything is fine in NT, but in Win9x after the program has run for awhile, the output font change...include the system message box ( i know it because there is a message box ask me to terminate the program..haha..)......but it takes awhile to see the problem........when i do drawing....the problem happened immediately.....( not just draw a line......but a heavy drawing....).....cannot display colour....etc...
I posted this question in codeproject.....and many people told me it would be a GDI resource leak....but i don't know how to fix it....
Oh...give you more backgrounds......it is a program using MFC...........and has a CDC global pointer to let other files to do drawing too...(not in view.cpp only....).....I'm just used some liked CPen or CBrush...then selectobject.....then something liked LineTo or MoveTo.....
Thanks for your help.....
Richard
|
|
|
|
|
I posted this advice before, and I repeat it: you should get rid of the global DC. Just pass the CDC pointer from OnDraw to functions defined in other .cpp files.
Your GDI leaks are (most probably) caused by the fact that pens, brushes and other GDI objects can't be freed when selected into any device context.
void Leak(CDC *pDC)
{
CPen pen(...);
pDC->SelectObject(&pen);
}
CPen's destructor will call ::DeleteObject for you, but it will fail - your pen is still selected. You should re-select before exiting the function:
void TheRightStuff(CDC *pDC)
{
CPen pen(...);
CPen *oldPen = pDC->SelectObject(&pen);
pDC->SelectObject(oldPen);
}
Tomasz Sowinski -- http://www.shooltz.com.plC
|
|
|
|
|
Oh.....i understand that now......let me try....
Thanks, Tomaxz.......
THANK YOU THANK YOU THANK YOU!!!!!;P
|
|
|
|
|
I'm working on an application that talks to a device connected through the serial port. Is there anyone who has done this before and is willing to let me use their code as a reference?
Thanks.
- John
- johnu@emersonprocess.com
|
|
|
|
|
Take a look at this:
http://msdn.microsoft.com/library/default.asp?URL=/library/wcedoc/wcecomm/serial_8.htm
In the "PortReadThread (LPVOID lpvoid)" function they specify a set of events to be monitored for the port, then re-specify them inside the while loops. Is this necessary, and why is it done?
?!?
error C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)'
Thanks.
- John
- johnu@emersonprocess.com
|
|
|
|
|
ONE approach is using the ActiveX component 'MSComm'. I'm helping somebody else through this component the last couple of weeks, so just search this forum on MSCOMM and you will find some tips and hints...
If you find out a better way of talking to the serial port (or rather, a modem behind it!), please let me know!
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Hi !
Where can I found a source code for an Identify Structure file format ?
I need a function for detect file formats, like: EXE (PE Win32), EXE (DOS), COM, TXT, etc... not check the extension... but, check the internal file format.
IdentifyStructure( char * cFile, char * cReturnFileType )
Thanks
|
|
|
|
|
www.wotsit.org
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Hi !
I know this website...
But I need a ready source code...
Thanks
|
|
|
|
|
In unix/linux, a utility called "file" allows you to do just this. It is gpl'ed so you will be able to get the source somewhere. Dunno where though. look about for it.
|
|
|
|
|
|
Thanks
I´m test this program now...
I send the result to here...
Thanks
|
|
|
|
|
I think, open a file in binary mode and check the header for the type of that file. The formats can be obtained from sites like http://www.wotsit.org/
It must work.
|
|
|
|
|
How can I check, if the CD-Tray is open?
Normally I have to send a mciSendCommand with MCI_STATUS / MCI_STATUS_PARMS, but that won't work. Does anyone have an idea?
I have to use this with MCI_SET_DOOR_OPEN / MCI_SET_DOOR_CLOSED.
Thanks for support!
Dirk
|
|
|
|
|
Hi All !
Please help answering this question who is able to
62. You are using Visual C++ to create a component that will provide information to several different client applications Some of these applications have higher priority than others, and your component must prioritize requests for information.
How should you develop your component?
A. Develop your component to use HTTP to return information to client applications.
Use a persistent property in the HTTP request to set priority.
Pass information to client applications in order of priority
B. Develop your component as an ActiveX user interface control.
Add a Priority property to the control.
Pass information to the client applications in order of priority.
C. Develop your component as an in-process COM server component that accepts a reference to a notification object from each client application.
Add a Priority property to this object.
Use asynchronous callbacks to pass information back to the client applications in order of priority
D. Develop your component as an out-of-process COM server component that accepts a reference to a notification object from each client application.
Add a Priority property to this object.
Use asynchronous callbacks to pass information back to the client applications in order of priority.
Thanks.
|
|
|
|
|
in mfc what is the correct way to access files... before i have used something like:
ifstream myStream("c:\test.txt");
if ( myStream.fail() ) {
MessageBox("Failed!");
}
else {
MessageBox("Opened!");
}
but i cant get this to work.... should i be doing something different?
thanks
|
|
|
|
|
I am not sure how to do this in MFC, but I *think* you need to modify what you posted in order to use fstream.
Try....
ifstream myStream;
myStream.open("c:\test.txt");
if ( myStream.fail() )
{
MessageBox("Failed!");
}
else
{
MessageBox("Opened!");
}
- John
- johnu@emersonprocess.com
|
|
|
|
|