|
Hi Roger,
A simple way could be a loop from "A:\" to "Z:\" in which you call GetDriveType(). Then you may stop at the first DRIVE_CDROM result or collect all CD-ROM drives and then choose the best.
Hope this helps,
Paolo.
|
|
|
|
|
I have a problem setting the colors of my MFC application. I have set the background of my dialog
window with SetDialogBgcolor(); but the border is still using the system colors. How do i set the color
of the border?
Another problem I have is that the little arrow on my ComboBox is also set by the system colors, and I can't find a
way to change it.
I have a slider in my application, wich background changed with SetDialogBgcolor(); but I also want to change the color
of the thing you slide and the area witch it slides on, but I have no clue how and where to change these.
I also need to know how I change the color om my menu.
Thankful for any help =)
/Fredrik
|
|
|
|
|
Hi,
Add the following code to your Dialogs OnPaint() method. If a method like this doesnt exist, you can add it from Class Wizard.
void CYourDialog::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
GetWindowRect(&rect);
ScreenToClient(&rect);
dc.FillSolidRect(rect, 0x00000000); //set bk color to black
}
I am sorry that i cannot answer your other questions.
Mustafa Demirhan
|
|
|
|
|
Hello,
When you open a CFileDialog, the tree-control displays the folder that is given in the ofn.pszInitialDir string. Once opened, the tree-control displays the folder that is selected by user action.
But how do you force the CTreeCtrl to display another folder by software? I have a class that is derived from CFileDialog. But i don't succeed in making the tree-control display another folder once the dialog is running.
I hope i'm not supposed to fill-up the tree control myself, am i? Since the file dialog has all the functionality to do so. But i don't see any CFileDialog function that can be of any use.
Can someone help me with this one?
Thanx
|
|
|
|
|
I have a CView based class that is dynamically creating CButton, CStatic, etc. child windows. How can I get Print and Print Preview to work with these controls. WM_PRINT doesn't quite work since the scale factors are all wrong.
Help!
|
|
|
|
|
Hi Everyone,
Can you help or suggest me ?
I want to drag/drop objects (IE. circle,ellipse,rectangle and etc.) from my document1 to other documents in MDI application and let it can group/ungroup objects when drop it to the other documents - that it may be menu bar command or tool bar command or whatever
for grouping/ungrouping the objects.
Anyone has the sample or any suggestion for me,please help too.
Regards,
Berm
|
|
|
|
|
You're talking about thousands, if not tens of thousands of lines of code. This isn't a simple proposition. I'd ask yourself if the effort necessary is really required, and if it is, then you best go looking into OLE because that's what drag-n-drop is connected to.
|
|
|
|
|
Thank you very much for your suggestion to the novice such me.
Erik,if I send you the code from my project and let you kindly check it and suggest me,that I am very very appreciative of your help.
If you have any free time and welcome my problem,please tell me too,that I will send you immediately.
Again,please reply me too.
Regards,
Berm Thongin
|
|
|
|
|
i need to use a Modeless dialog box to show an importent
message!
i use the folling code
CWnd Dig;
CWnd *pWnd = new CWnd;
pWnd->CreateEx(WS_EX_CLIENTEDGE,_T("STATIC"),"Prosses is..",
WS_CHILD |WS_POPUP|WS_CAPTION | WS_VISIBLE,310, 310,160,100,m_hWnd,(HMENU)1234);
and i cant move the dialog box at all and i need to be able to do so (how ? ...) !
i need it to be without no batuns....
and i need to know how to use the distroywindow to kill it
wen i need to !
plz.....help me
|
|
|
|
|
If you want to use a modeless dialog then extend your window from CDialog. Here is an example:
CShowMessage *swRem=new CShowMessage();
swRem->Create(IDD_SHOWMESSAGE_DIALOG);
swRem->ShowWindow(SW_SHOW);
Here CShowMessage is a CDialog created by 'New Form' menu that is located in 'Insert' menu. If you want to make it modal just write the following code:
CShowMessage swRem;
swRem.DoModal();
Mustafa Demirhan
|
|
|
|
|
See http://home.socal.rr.com/samhobbs/VC/ModelessDialogs.html for my notes about modeless dialogs.
Unfortunately, what you have here is not a modeless dialog. It is a window that is not a dialog, so Mustafa's reply is also relevant. The easiest solution is to create a dialog as he suggests, and perhaps my notes will help you to show it successfully.
If you wanted to, though, you could create a window and then create a static control in it, but I think it would be best to use a modeless dialog first, then get fancy later. You could use CMiniFrameWnd for the window, though.
|
|
|
|
|
Is it possible in Microsoft Visual C++ to get the build number of an application (e.g. to display it in the About dialog)
Best regards,
Peter de Hon
|
|
|
|
|
Look at documentation on GetFileVersionInfo(), GetFileVersionInfoSize() and VerQueryValue() (to retrieve a VS_FIXEDFILEINFO structure).
I never did it to retrieve the build number, but I suppose you have to find out which are the corresponding bits in the FileVersion or in the ProductVersion.
Hope this helps,
Paolo.
|
|
|
|
|
Env: Vis C++ 6.0 SP3 WIN98 updated.
Doc/view application under debug.
I have a class constructed with CW that consists of standard variable declarations, an array of records of byte arrays that accept serialization and is included in this class, etc.
In the wiz constructed document class, I create this class object with the new operator from within the document constructor:
MFDPreFileDoc::MFDPrefileDoc()
{
CMFD_RCRD* pCMfD_RCRD = new CMFD_RCRD();
}
All works well with the app (static linked exe), pointers, etc.
Under debug, if the app (SDI or MDI) is closed with exit, no problem. Id the app ic closed with the mainframe "X", debug dumps a mem leak error pointing to this new statement.
The CMFD_RCRD has a virtual destructor as does the document itself created by the WIZ. I have tried placing a function in the doc destructor pointing to the CMFD_RCRD destructor, but get an assertion err.
Within the app, there are no errors associated with closing child win views associated with their instances of the relative document instances as indicated by debug, only with the mainframe X end app.
Any ideas? Do I have a real mem leak or is this due to the debug environment?
|
|
|
|
|
Looks like a real leak - once the constructor exits, the app will have no way of deleting the object.
The different behaviors you describe on closing are puzzling. If a document is opened or created, this should leak.
Try a more standard approach? Declare
CMFD_RCRD* m_pCMFD_RCRD;
as a doc class member, call new in the doc constuctor and delete in the destructor, and this 'strange yet puzzling' feature should go away.
|
|
|
|
|
Hi,
I just want to guess a solution. I dont know if it works or not.
In the destructor
<br />
delete this;<br />
I hope it works.
Mustafa Demirhan
|
|
|
|
|
I'm in a project writting the CTreeCtrl in the CTreeView, which look like Windows Explorer.
Is anyone know how can I include the Network Neighbourhood control in to my CTreeCtrl?
Thanks.
|
|
|
|
|
|
Hi,
Does anybody know an way by which I can convert an multi page RTF files to multiple BMP files without GUI(background process)..any samples would be highly appreciated..
Thanks for ur help
saravana
|
|
|
|
|
Does anybody have a demo project showing how to change the dropdown to MS Calender in order to select a date?
I found some code at codeguru.com, but I was not able to get it working on my system (VC++ 6.0, Win2k)
|
|
|
|
|
Have alook at this
LRESULT SomeDlg::OnPaint(.....)
{
hDC = ::BeginPaint(m_hWnd, &ps);
MyPaint(hDC);
::EndPaint(m_hWnd, &ps);
}
Now I pass this hDC from MyPaint to various functions which in tern pass it further for simple Line and Text drawing. But I seem to loose this hDC automatically and the routines won't paint. Does anybody have idea ? I have checked everywhere and am sure that none of the statements are altering this hDC in anyways. HELP !!!!!
|
|
|
|
|
Are you certain that the routines aren't just drawing outside your bounding rectangles?
Does the same code work if it's not in a function?
|
|
|
|
|
Hi,
I've been stumped by this (or am just too blind!) problem. I am trying to get the number of characters before the caret in a Rich Edit Control. Is this possible? If not all the characters before the caret, then even the number of characters before the caret in the particular line - i'm using a multiline rich edit control.
Does anyone know how to do this?
It's kind of similar to the col num value in most word processors, which wordpad or notepad don't have.
Thanks in advance,
Jignesh
|
|
|
|
|
D0H!
I found out just incase anyone cares...
The EM_EXGETSEL does the magic. I never called that as I thought it would return 0,0 if nothing is selected, but it does return the correct ranges.
Jignesh
|
|
|
|
|
I have a SDI application with multiple views.
However I only implemented Printing Routines in 1 specific view. The other views only contain temporary information, which is not suited for printing.
I can active the print commando via the menu or via a toolbar button. The handler (as i said before) is in the specific view routine.
The problem I get is that sometimes this view looses focus, because i'am scrolling (for example) in another view.
When I want to do some printing I find the menu and toolbar button greyed an inactive. Only after i activated or give focus back to my "most important" view, I can do my printing activity.
I don't like this approach and hope someone has a straightforward solution,
Thanks in advance,
Bert....
|
|
|
|