|
I try to create an application which composed by a dialog box. The first aim of this application is to connect an access database, so i put a button to do that. After the connection done, i want to compare a Date which is kept in an edit box in my dlg box to dates in my database. So, I declare m_dlgDate as a COleDateTime variable. When I run the application, even if the dlg date and one of the data date are the same, my application return an AfxMessageBoxwith the message "Not Good Dates".
So, I would like to know if my declarations that's wrong or not??
gerald
|
|
|
|
|
Perhaps you should use a DateTimePicker control instead of a text box? Is the messagebox a complaint from the MFC framework or a result of your own code? The COleDateTime and SQL timestamp both contain clock time in addition to date, you need to take care that it's masked out if you want to compare only the dates.
|
|
|
|
|
Hi
I need two files, psapi.h and psapi.dll. But according to the platform sdk setup,I must download over 80 meg for that. Since I am on a modem connection, the idea isn't appealing to me. Is there any other way of getting individual files? ftp.microsoft.com is down....
|
|
|
|
|
Hello,
I've got those file locally. (psapi.h,*.lib and .dll, total 27kB). It's way smaller than 80MB
If you provide me an e-mail address for sending it to you, I will sent it.
EiSl
|
|
|
|
|
Hello all,
Please take a look to one of the submitted code snippets, where the layout is recalculated:
Link to sample in CodeProject: http://www.codeproject.com/docking/sizing_tabctl.asp
Part of the code:
void CMainFrame::RecalcLayout(BOOL bNotify)
{
CMDIFrameWnd::RecalcLayout(bNotify);
CMDIFrameWnd::RecalcLayout(bNotify);
}
Question:
Why does the author calls the same RecalcLayout twice ?!?!
Thanks,
EiSl
|
|
|
|
|
Hi,
In an application we've written we have a dialog based MFC application
based on the CPropertySheet class. We are dynamically adding and
removing pages while the the dialog is displayed.
If the property pages we're adding and removing contain controls (i've
tried it with buttons and treecontrols), then we have a memory leak:
when I constantly add and remove pages, thus always returning to a
same initial state, the application consumes more and more memory.
It has nothing to do with the CPropertyPage derived objects
themselves. I added several integer members to them, to make the
memoryfootprint of the object bigger, but this doesn't cause the
memory leak to be bigger. However, when I fill the dialog (by using
the dialog editor of visual studio 6.0) with a lot of buttons, then
the memory leak is getting bigger. I've added no functionality to the
buttons, and not to the CPropertyPage derived class, except for one
button with which I can add and remove pages to the CPropertySheet
derived dailogbox. Thus it looks like MFC doesn't destroy the dialog
template, or the controls on it. The page we're removing is NOT the
active page. I've tried explicitly callling destroywindow on the
propertypage that gets removed but this does not work neither.
The only functionality the application has, is adding and removing
CPropertyPage derived objects, so the memoryleak can not be caused by
anything else.
Does anyone have an idea what can be wrong and how to solve it
Thanks,
Serge Desmedt
|
|
|
|
|
Platform SDK documentation says that you shouldn't use PSM_REMOVEPAGE message (which is wrapped by CPropertySheet::RemovePage) during processing of some notifications:
"A number of messages and one function call occur while the property sheet is manipulating the list of pages. While this action is taking place, attempting to modify the list of pages will have unpredictable results. Accordingly, you should not use the PSM_REMOVEPAGE message in your implementation of PropSheetPageProc or while handling the following notifications and Microsoft Windows messages:
PSN_APPLY, PSN_KILLACTIVE, PSN_RESET, PSN_SETACTIVE, WM_DESTROY, WM_INITDIALOG"
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm not doing anything of the above.
On the propertypage derived classes there is a button, which sends a message to the propertysheet derived class, who then deletes a page which is not the current active page, and without changing the active page (so PSN_KILLACTIVE and PSN_RESET don't get send). Neither is the dialog startinh or closing, so none of the other meddages get send to the propertysheet.
Serge Desmedt
|
|
|
|
|
Hello, I'm experiencing problems saving a HICON to an icon file. Can you give me an example of doing that?
|
|
|
|
|
I build a SDI project.when the application had exited ,I found memoy leaks detected.The CSingleDocTemplate hadn't been deleted.Someone can tell me what will cause this.Thanx.
|
|
|
|
|
Hi ,
I try to query a value from a remote registry using RegQueryValueEx.But I get an error code which says RPC_S_INVALID_BOUNDS.I tried changins my buffersize from small to large values but to no use.Can anyone please tell me the solution?
Thank You,
Yamuna.E.
Yamuna.E.
|
|
|
|
|
Hi all,
I have a class to print individual pixels on a labelprinter. My barcodes are great but I would also like to print images and/or text. For this purpose I had the idea to create a CDC, place all my bitmaps and text in that cdc and then to convert it to a byte-buffer which I could send to the printer. Why bytes? Because the labelprinter only takes bytes and each byte represents 8 black/white pixels. I (think) cannot send the bytes from a cdc directly because I also need to send control codes to the printer to indicate newlines/formfeeds/margins...
Any ideas on how to convert the CDC to a BYTE-buffer that suits my needs? Other ways to solve this are also greatly appreciated.
|
|
|
|
|
Seems that you need to create a DIB section, select it into DC, perform drawing, then convert the DIB bits to format accepted by your device. CodeProject has an article describing the wrapper class for dib sections - search for 'DIBSection wrapper'
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I am developing an application which has a Scrollview - derived Control. Using the normal drawing functions i´m drawing into this DC. With the API ::SetWorldTransform i´m zooming in and out.
Works perfectly until now.. the only problem i have got is that i would like to center the whole shista when i´m zoomin in and out.
I´ve tried a couple formulas.. and didn´t get it going to set the scrollbars correctly.. so that i can zoom in and out and stay in the middle of the document. (the scrollbars get smaller if i´m zoomin...)
Another problem is that i would like to center the pic in the view (when the zoom - factor is so small, that i don´t need the scrollbars.
I hope at least some of you could understand my question... and i hope someone could help me out.
thanx in advance
the visual c student
|
|
|
|
|
Another problem is that i would like to center the pic in the view (when the zoom - factor is so small, that i don´t need the scrollbars.
CScrollView has an undocumented protected data member m_bCenter that does exactly that.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
We are using NT and dialogic board. I am interested in getting the callerid using TAPI. Could you explain it?
We have the caller id enabled in the exchange and also with our telephone. We could get the caller id using a sample dialogic program ( the dialogic program uses dialogic api's whereas we are looking for a TAPI based solution). Now if you could explain it, it would be great.
Thanks
P.V.V.
|
|
|
|
|
Firstly do you have a TAPI Service provider for the dialogic board? If not then you won't get very far.
Basic overview
-----------------
Initialise TAPI with lineInitalizeEx
Open the device with lineOpen
When you receive the LINE_CALLINFO message make a call to lineGetCallInfo.
The CallerID is in the LINECALLINFO structure.
sCallerID = (LPSTR)((DWORD)m_lpCallInfo+
(DWORD)m_lpCallInfo->dwCallerIDOffset);
http://www.julmar.com/samples.htm has some source code that might help.
|
|
|
|
|
Hi ,
I've Created an application that puts up an icon in the system tray. If I close that application by sending WM_CLOSE or WM_QUIT messages from another application the tray icon disappears normally ,but if i use terminate process from another application the tray icon remains until I move the Mouse Pointer above the Icon after which it disappears Is there anyway to refresh the system tray ??? Please help out
|
|
|
|
|
As MS would say, that behavior is by design. The tray icons don't do anything until you move the mouse over them.
--Mike--
http://home.inreach.com/mdunn/
Sometimes, arming yourself with a big pointy stake just won't do you any good.
|
|
|
|
|
Duh! How in the world do you get a COleCurrency object to look like money with 2 decimal places (in an edit box, for example)? I feel really stupid having to ask this one. Please be gentle!
Richard
|
|
|
|
|
|
I have created a docking window. And, in the docking window created a listctrl.
I can add items to the list control from within the Create function in my docking window class. No problems there.
However, when I try to add an item to my list control from a menu command within my MainFrame class it fails in IsWindow(m_hWnd).
How can I get a valid pointer to my list control so that I can add items to it without failing because of an invalid window handle?
Thanks,
Frank
|
|
|
|
|
I've set up a bitmapped background for my Win32 (no MFC) dialog based app.
The dialog handles WM_CTLCOLORSTATIC by
- SetBkMode (hdc, TRANSPARENT);
- return GetStockObject (NULL_BRUSH);
This -does- let the background show thru like I want.;)
BUT, when I update the static controls' text,
the old foreground is left and the new foreground text
is stamped on top of it makin a MESS.
Someone else MUST have run across this, right?
Could ya help me out? Thanks!
...SteveH http://hazels.freeservers.com
|
|
|
|
|
|
Rats. Didn't work after all...
I'm doin this:
::SendMessage (statctl, WM_SETTEXT, (WPARAM) 0, (LPARAM) txt);
::InvalidateRect (statctl, NULL, TRUE);
I would think that SendMessage would already invalidate the
whole control...?
Either the background ain't gettin erased by the dialog's
WM_ERASEBKGND
or the control is getting it's draw messages messed up
or somethin???
One last thing - should I be invalidating the whole dialog when
I need to change the static's text?
Thanks for the help tho!
I could send you my src if that'll help...
...SteveH http://hazels.freeservers.com
|
|
|
|