|
Made a small class that manages the png (and internally dib) file format.
Also has ability to display png files transparently.
It's all that i wanted so don't bother anymore.
Thanx.
|
|
|
|
|
The following code will give me a dialog box that will allow
a user to choose a directroy.
It does return me the directory name, but I also need the full path to the directory.
How do I get the full path to the directory??????
Thanks in advance.
void CSwapObjectsView::DoDirectoryDialog(CString& strDir)
{
char szDisplayName[MAX_PATH] = "";
char szTitle[] = "Choose a directory";
BROWSEINFO x;
memset(&x, NULL, sizeof(BROWSEINFO));
x.hwndOwner = this->m_hWnd;
x.pszDisplayName = szDisplayName;
x.lpszTitle = szTitle;
x.ulFlags = BIF_RETURNONLYFSDIRS ;
SHBrowseForFolder(&x);
|
|
|
|
|
Here's the bare-bones code to do it. Adding error handling is left as an exercise to the reader.
LPITEMIDLIST pidl;
LPMALLOC pMalloc;
TCHAR szDir[MAX_PATH];
pidl = SHBrowseForFolder(&x);
SHGetPathFromIDList ( pidl, szDir );
SHGetMalloc(&pMalloc);
pMalloc->Free(pidl);
pMalloc->Release();
|
|
|
|
|
I have been trying to display a bitmap on a button when the button is disabled but this does not seem to work. The bitmap is a gray and black image only when the button is disabled. What special things have to be done in order to display a bitmap on a disabled button.
|
|
|
|
|
Somebody knows how to access bits directly in the bitmap without calling GetBitmapBits(GetDIBits) and SetBitmapBits(SetDIBits).
Thanks
|
|
|
|
|
Hi,
I have a dialog with a Slider control that will show the user the number which has been randomly generated. I need to keep generating such value as long as the user doesn't click a button mouse.
I tried to use
// inside my CDialog-derived::OnStart()
MSG msg;
while (!::PeekMessage(&msg,HWND(this),WM_LBUTTONDOWN,WM_MBUTTONUP,PN_NOREMOVE))
{
value = rand() % range;
m_SliderCtrl.SetPost(value);
}
// return from member function
but it didn't work, i can't get the mouse LButtonDown message to stop cycling. Does anyone have a solution?
|
|
|
|
|
How do you make a combo box and list contain the drives and files on the system? Visual Basic has the controls predfined but is there a way to do it in VC with MFC? Thanks in advance.
|
|
|
|
|
I don't use VB, so I don't know what the VB controls look like, but from your description it sounds like you want to use the DlgDirList, DlgDirSelectEx, DlgDirListComboBox, and DlgDirSelectComboBoxEx APIs to fill the controls.
|
|
|
|
|
If I create several modeless dialogs, how do I keep track of what happens in each one of them?
I couldn't find much information on this subject, so I'd really appreciate any help! Does anyone
know some good links or samples on modeless dialogs?
Thanks in advance!
|
|
|
|
|
Could you give a little more info on what you are trying to do ? The message handling routines work the same, whether
in Modal or Modeless. Are you having problems communicating
data between the various modeless dialogs that you have
set up ?
|
|
|
|
|
I don't know how to refer to a certain (open) modeless dialog from my program's
MainFrame, where I create them. I would like to implement reference to a modeless dialog
by checking the dialog's caption and then specifying whether or not the message was supposed to
be sent to that dialog. This raises a question:
Is there a useful function that I could use to check all open dialogs (and their captions)?
If there isn't such a function, is there another way of knowing which (modeless) dialog is supposed
to receive the message?
I don't have to communicate between my program's various modeless dialogs, just send data to them.
|
|
|
|
|
I need to find out the RGB format for the default color of a dialog box under VC++. I tried using GetBkColor but this would always give me a value of (255, 255, 255) which is white. I need this to create a new color under Adobe Photoshop to edit bitmaps that way their background match that of the dialog box or button they will appear on.
|
|
|
|
|
GetSysColor(COLOR_3DFACE) will return the color you want. Don't hard code any particular RGB value. If you do, your UI will look ugly when one of your users changes themes or turns on high contrast mode.
|
|
|
|
|
Thank you very much, now if I can figure out how to properly use Photoshop I will be ok. Once again, thanks for the help.
|
|
|
|
|
Have you tried 193,193,193 ?
|
|
|
|
|
Have you tried (193,193,193) ?
|
|
|
|
|
Two questions pertaining to a tab control:
1) Is there anyway to disable a tab in a tab control?
2) Is there anyway to force the tab to be larger on a tab control?
Any help will be appreciated greatly.
|
|
|
|
|
Hi,
I was wondering if anyone had given the Microsoft MFC Desktop Applications programming exam, and if so, what are their impressions of it ? I'm approaching intermediate proficiency in MFC now. I do understand how everything is laid out, I just haven't had enough experience to know all the quirks and hacks. Plus i'm fairly decent with COM. Would you think it would be a good idea to give it a shot right now, or should I wait much longer ?
Thanks
|
|
|
|
|
When I do painting operations with DirectDraw, the cursor gets painted over. I'm sure I could redraw the cursor, but that seems very un-needed. Right now, the mouse Stuff is from the MFC SDI (no view/doc) framework. Do I need to set up a DirectInput in order to get the cursor to paint automatically?
|
|
|
|
|
IE is documented as supporting IPersistStreamInit, so that given a document (an IHTMLDocument), you can get an IPersistStreamInit for it (by calling QueryInterface), and with that you can read the entire original HTML of the page.
In IE 5.5, it works for the top-level frameset of a page; however, if, using the DOM, I navigate down to a lower-level frame's IHTMLDocument, QueryInterface(IPersistStreamInit) FAILS! It worked fine in IE 5.0.
Suggestions? How can I get an IPersistStreamInit for the frames?
|
|
|
|
|
I've been a programmer for years, but I'm really bad(inexperienced) at VC++ visual components.
I've got a dialog-based app. and I just want to drop a toolbar on it and an ImageList i.e. insert the ActiveX controls, but VC++ creates wrapper classes for them. First of all for the Image List it creates a CImageList1 class which you can't pass to CToolBarCtrl, infact the wrapper for the ToolBar OCX creates CToolBar....I know how to get CToolBarCtrl out of it, but it still doesn't help. I really thought this would be easy.....I was hoping this would be quick, but VC++ makes it really long and often doesn't work.....AM I DOING THIS WRONG?
ANY HELP WOULD BE MUCH APPRECIATED!.
Daniel
|
|
|
|
|
Can anybody suggest a third party Financial Math Library to use in VC++? My most pressing need is to use a class/type to replace the double type. The precision of the floating point math operations using doubles are not accurate enough for my needs.
Thanks for any links, suggestions ...
|
|
|
|
|
Hi,
Does anybody know how you can force an app to load own implementations of malloc and free instead of the standard versions? A macro doesn't help because because additionally linked libs still will call the standard functions.
Thanks,
Hans Merkl
|
|
|
|
|
Hi,
What i want to do is draw my own cursor (shape) or display a bitmap in a fast way where the cursor is. That way you can implement any kind of cursor and of any size. I need this code since i'm making a graphical demo and the standard cursors make it look crappy. Ideally, it would be code to display any given bitmap (with transparency, i have code which displays a bitmap transparent) at the current mouse position instead of the standard mouse poihter. If anybody has an idea on how to do that, please tell me
My idea was to load 2 bitmaps, 1 "normal", 1 mask and then create an icon. That icon would then be displayed at the place of the standard cursor. This setup actually works in NT but not in 98. Probably due to the fact that it needs cursors of a certain size.
This is are the code snippets from my application:
The first part loads 2 bitmaps, 1 normal and one inverted one (used as a mask by windows):
HANDLE m_hImage;
HANDLE m_hNegImage;
m_hImage = LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_NORMAL), IMAGE_BITMAP, 0, 0, 0 );
m_hNegImage = LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB__INV), IMAGE_BITMAP, 0, 0, 0 );
Next i create a cursor with the info given:
ICONINFO info;
HCURSOR m_hCursor;
info.fIcon = FALSE; // means it's a cursor
info.xHotspot = 11;
info.yHotspot = 0;
info.hbmColor = (HBITMAP) m_hImage;
info.hbmMask = (HBITMAP) m_hNegImage;
m_hCursor = CreateIconIndirect(&info);
Next i override my OnSetCursor code to do my own implementation:
SetCursor(m_hCursor); // displays the created cursor
This code works absolutely fine under WinNT 4.0 but not under Win98. I imagine Win98 can't handle the size (rather big) of my own cursors. Anyway, all the functions return fine and work ok except it displays the standard cursor and not my own creation.
Does anybody have a clue on how i can still use my own images (and thus cursors) in my application under Win98?
|
|
|
|
|
Hi
I've written a MFC application that is a
COM-Server and also uses some other COM objects.
I wanted to make it a Windows NT Service (which
is basically no problem) but I recognized that
I cannot do any COM calls.
Has anyone an explanation (even better: a solution)
for this problem?
thanks alot,
Marc.
|
|
|
|