|
I have problem with CTime in DoDataExchange() function
None of 15 overrides in funkcion takes CTime as an parameter
When I convert it using CTime aTime.Format("%d.%m.%Y") then
I'm able to transfer data from ODBC database into my Edit control
but when I try to Update database then it throws exception.
Can somebody help me with right way of doing this.
Thank You
|
|
|
|
|
i have none about direct-x or open-gl.
my Q is: could any of them capture screen (or any window)?
if so, i will learn.
thx for any suggestions.
includeh10
|
|
|
|
|
To clarify your question: Are you trying to create an app that captures standard Windows desktop windows or specifically a DirectX/OpenGL app?
- Mike
|
|
|
|
|
use directx or open-gl to capture screen or windows, normal method is too slow.
includeh10
|
|
|
|
|
Hi,
I would like to be able to send a file (.doc) throught internet with a client/server App. I will probably use MFC & CSocket to code the App.
Microsoft documentation tell us that we can send ordinary data (int, double, CString , serializable class etc..) using serialization into CSocket. But what if I want to send a file unstead of data.
Is there a way to achieve this?
thanks a lot
Mykel
Everything's beautiful if you look at it long enough...
|
|
|
|
|
an easy way would be to read the contents of a file into a buffer and then send the buffer over the net. If the files are big, you can read the files in chunks - and send each chunk over the net and reassemble them on the other side.
--
Ich, du, sie, er, es, ihr, sie, Sie.
|
|
|
|
|
Check out MSDN for Simple MAPI, or you could use PJ Naughter's CSMTPConnection which here on CP. Do a search.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
if I use this code, it doesn't select the item on which I rt-clciked, rather selects the item next to it.
Please help.
void CMfcTree::OnRclickTree1(NMHDR* pNMHDR, LRESULT* pResult)
{
//
CPoint pt;
GetCursorPos(&pt);
ScreenToClient(&pt);
HTREEITEM hItemHit=m_nTree.HitTest(pt);
if(hItemHit)
m_nTree.SelectItem(hItemHit);
*pResult = 0;
AfxMessageBox(m_nTree.GetItemText(m_nTree.GetSelectedItem()));
}
Please correct this code.
Thanks
Binayak Bhattacharyya
|
|
|
|
|
First, you need to do the ScreenToClient(&pt); in the context of the tree control, not the dialog: m_nTree.ScreenToClient(&pt); .
Second, you need to call HitTest() like this:
UINT uFlags = 0;
HTREEITEM hItemHit = HitTest(pt, &uFlags);
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
That solved the problem.
Thanks tons
|
|
|
|
|
Well, i'm giving up on a project i was supposed to do in LabView (graphical programming) and i'm doing it in good 'ole MFC. I need to know what i should use for a certain display of data. My assumption is a progress control, but there may be something better.
Here is what i want it to look like, roughly: clicky[^]
I'm more interested in the red slider bar than anything. I need a red one and a black one, and i haven't figured out how to change the colors of progress controls in MFC as of yet. Is there an alternative, or should i use the progress control?
*.*
cin >> knowledge;
|
|
|
|
|
Naw, don't use a progress control for something like this - it's far too bloated for what you need. Just draw a simple client-edge static control with some tick marks (if fixed, this is even easier). Then treat the value as a percentage and draw a red or black rectangle in the client edge (taking into account the client edge) that is the same height (or width) of the static control and the percentage of the width (or height) of the static control. This is simple enough and easier to customize (more than likely) than a pre-canned CProgressCtrl class in MFC.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
*jump* *jump*
well, i thought jumping might help me catch the stuff flying over my head. if i understand you corrrectly, you suggested making a static control (like a static text?) and draw a rectangle inside it? Thats a great idea, but what type of static control do i use? :-/
*.*
cin >> knowledge;
|
|
|
|
|
Just a regular static text control??
I think a slider control may be what you want.
John
|
|
|
|
|
No, not even that. You have the overhead of the slider control while trying to override its painting (i.e., owner drawing) anyway. It's pointless.
By static control, I meant CStatic (since you're using MFC). It's a simple control with no frills. You're thinking of the CEdit control (to the original poster). You could even derive from CWnd - you just need a surface to paint on. This is a very simple solution and trying to "extend" some existing control that is "close but no cigar" will just make things worse.
Consider using a slider: sure, it has tick marks - but you don't want the actual slider, right? So you have to go to all the work of either keeping the slider from painting or painting over it. After that, you have to go to the trouble of still painting your simple colored rectangle.
So, just make your own control (say, CGuage that derives, preferrably, from CWnd ) and handle the WM_PAINT message (or use a number of overridables or other forms for owner drawing).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
Consider using a slider: sure, it has tick marks - but you don't want the actual slider, right? So you have to go to all the work of either keeping the slider from painting or painting over it. After that, you have to go to the trouble of still painting your simple colored rectangle.
Yes you do want the slider. You want a disabled range selection slider but without a thumb. But I just look at the code that I was thinking about and it was a complete owner draw (basically a copy of the MFC control with a few modifications) so I guess there is no point to using a slider. I had to use an owner draw slider on a mammography system because the thumb rect was too small on the high resolution monitors (2K by 2.5K resolution).
John
|
|
|
|
|
i think using a progress control qwould be easiest, and i found out how to use SetBkColor. I need to change the slider color tho, not the background color. can this be done? msdn isn't helping much...
*.*
cin >> knowledge;
|
|
|
|
|
welp i solved the problem, i found i can change the slider solor by using progress_control.SendMessage(PBM_SETBARCOLOR,0,RGB(100,100,132)); I don't know how it works, but i know how to change the colors.
thanks for the input you gave me.
*.*
cin >> knowledge;
|
|
|
|
|
|
Hi All,
I'm having a problem creating a custom dialog box. I need to limit the user to only be able to browse the folders below a certain folder.
I'm trying to figure out how to trap the "Button Up" message on the toolbar properly so I can check the next folder going up and therefore prevent the user from going up any more directories. The problem is that no matter what I do, even in processing the up Button message and returning TRUE so the default windows doesn't process the message, the message still gets processed and the user is allowed to go up past my limit.
I tried capturing the last message after the app gets updated, and then revert back to the limit folder, then signaling the window to update again as well. But that still didn't work.
Any ideas? Thanks!
Dan
|
|
|
|
|
You might try the SHBrowserForFolder function instead. It doesn't provide a wrapper class in MFC that I know of, but it's simple enough to use. You can set the root, limit the types of items that can be selected, and even have files show up (despite the function name containing "browse" and "folder") in newer (albeit not so new) function versions using a simple flag.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I'll give that a whirl. Thanks for the suggestion.
probably not quite what I'm looking for but I might be able to make it work.
I'll keep ya posted.
thanks!
|
|
|
|
|
Heath Stewart wrote:
You might try the SHBrowserForFolder function instead
not exactly what I was looking for. I need the same look/feel as the FileOpen Dialog. Thanks for the hint though.
I guess I just need to keep looking. Anyone else have an idea?
|
|
|
|
|
Okay, then there is several options you can do to really fix the CFileDialog . The following alternative uses MFC's CFileDialog (since that seems to be what you want to use), but you could just as easily use the method that it wraps, GetOpenFileName .
First, create an instance of the CFileDialog . When you've done that, get the m_ofn member struct from the instance and perform the following.
- OR the
Flags member of the OPENFILENAME structure with OFN_ENABLEHOOK . You might also want to OR it with OFN_NODEREFERENCELINKS while you're at it to keep users from making a shortcut to a location outside your limited scope.
- Set the
lpfnHook to a HOOKPROC callback.
From there, your options are many. In WM_INITDIALOG , you could simply remove the the "Up" button entirely based by getting the toolbar in which its contained (based, perhaps, on the window class for the toolbar which Spy++ can give you, which is ToolbarWindow32 , or getting it based on the tooltip or some other identifier) or handling the message generated when you click the up button. Spy++ reports this as either WM_USER+300 (aka 1) or WM_USER+302 (aka 2) (both were posted as 1211 (based on aforementioned aliases). What those mean you'll have to dig-up. All the other messages were mostly painting and mouse messages - nothing that would seem to help.
It's surprising that handling the click messages and returning true didn't help. Did you handle WM_LBUTTONUP ? That directory change is triggered then and not during WM_LBUTTONDOWN . Just out of curiosity, how did you determine if the "Up" button was being clicked?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
How does one retrieve the row count in a open IRowset (besides the obvious method of scanning them all)?
Thanks.
Regards,
João Paulo
|
|
|
|