|
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.
|
|
|
|
|
I want to save/restore size and position of midi-child-frames.
The size is OK, but position seems to have an offset of mainframes toolbar,menu and border.
I use Get/SetWindowRect().
Any idea?
|
|
|
|
|
Have you tried Get/SetWindowPlacement() ?
Dave
|
|
|
|
|
|
I am having trouble killing my timer. It crashs everytime it is killed with an assertion that checks hWnd. The real problem is that the timerID passed to OnTimer is bad.
SetTimer returns the correct timerId which I set to 255. OnTimer gets something like 6603033, and the number is always the same. If, inside OnTimer, I use KillTimer(6603033), it works. I suspect this number may change however....and I don't know where this # comes from?
I am using CBitmapButtons and I noticed someone else has a similar problem on here. When they added a CBitmapButton, their OnTimer() fails to get called at all.
Any suggestions?
Thanks
|
|
|
|
|
Which value are you passing as the parameter to KillTimer()?
The return value from SetTimer() or the nIDEvent parameter
from the SetTimer() call ?
The doc seems to imply the return value, but the argument list defintions seem to imply the nIDEvent. (see below)
UINT SetTimer( UINT nIDEvent, UINT nElapse, void (CALLBACK EXPORT* lpfnTimer)(HWND, UINT, UINT, DWORD) );
BOOL KillTimer( int nIDEvent );
I have used the SetTimer(), KillTimer() a lot, and I have
been passing the nIDEvent to KillTimer() ...
Example :
int timerResult = SetTimer(1,500,NULL);
KillTimer(1);
|
|
|
|
|
Things to check:
1. Is the timerid you supply for SetTimer a variable?
If yes, check your program to see it doesn't get changed somewhere. I typically "define" them
For instance:
#define TIMER_ID 1
#define TIMER_TIME 1000
#define TIMER_ID_DIS 2
#define TIMER_TIME_DIS 60000
Then in my OnTimer message i check for TIMER_ID & TIMER_ID_DIS
2. Are you forwarding the timer message to another window?
That might (not sure) it to be different.
3.>> It crashs everytime it is killed with an assertion >>that checks hWnd.
That might suggest that the window(CWnd, CButton, everthing derived from CWnd/CWindow) is already destroyed.
If you are trying to kill your timer in the destructor of your window, don't!!! Destroy it in an OnClose or something but not in a destructor because the m_hWnd is already invalid then.
In none of these is the case, show us the important parts of the code.
Benedict Verheyen
|
|
|
|
|
How do you programmatically crop a bitmap (CBitmap DIB) image in vc++6?
For example, say I have a bitmap image with dimensions 100x100. I want to create a new bitmap with just the 10x10 image in the very center of the original bitmap. How do I do so?
Phil
|
|
|
|
|
How do I prevent the NEW Dialog box from coming up when I add a new view to a SDI app
|
|
|
|
|
I need some help with these API calls:
My GetExitCodeProcess() function is failing...
The exception window displays:
"unhandled exception in Bond.exe [Kernal32.dll]
0xC000005, Access Violation
Can anyone tell me what might be wrong with
the following code, is it my handle?
HWND hWnd = ::FindWindow("XLMAIN", NULL);
DWORD pid; //variable to hold the process ID.
DWORD dThread; // Variable to hold (unused) thread ID
dThread = GetWindowThreadProcessId(hWnd,//Handle to window
&pid);// Address of process ID
HANDLE hProcess; //Handle to existing process
//PROCESS_ALL_ACCESS Specifies all possible access flags for the process object.
//PROCESS_QUERY_INFORMATION Enables using the process
//handle in the GetExitCodeProcess and GetPriorityClass //functions to
//read information from the process object.
//SYNCHRONIZE Windows NT/2000: Enables using the process //handle in any //of the wait functions to wait for the //process to terminate.
LPDWORD lpExitCode = 0;
hProcess = OpenProcess( PROCESS_QUERY_INFORMATION, FALSE,
pid);
// the following statement cause an access violation:
//"unhandled exception in Bond.exe [Kernal32.dll]
//0xC000005, Access Violation
//why? please help.
BOOL bResult = GetExitCodeProcess(hProcess, lpExitCode);
|
|
|
|