|
Hello,
The last time I wanted to have dynamically resizable controls on my dialog, I used CResizableDialog[^]. I don't see why you need checkboxes and radio buttons to be enlarged along with the dialog. That sounds more like magnification/shrinking of the controls rather than dynamically resizing them.
I don't see why you need to resize a checkbox though. But whatever floats your boat.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
because in our application dialogBox along with controls should resize based on the Resolution of the system... so that user will be able to have a clear view...
|
|
|
|
|
I have created an MDI application. In that I am creating new window.
I want functionality as after left clicking of mouse on view that window should be closed.
My problem is, how can I close the window after left click on that created window.
Thanks in advance
Nikesh
|
|
|
|
|
Post a WM_CLOSE message to your window?
PS: Do not re-post your queries.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I am using Microsoft Visual Studio 6.00.
I have created an MDI application. In that I am creating new window.
I want functionality as after left clicking of mouse on view that window should be closed.
So how can I sort out this problem?
Thanks in advance
Nikesh
|
|
|
|
|
1. Call frame window's DestroyWindow function
2. Send WM_CLOSE message to your frame window handle
3. DestroyWindow with frame window handle
4. PostQuitMessage with exit code.
You may need to take care about the data in the child window.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
I created a combo box using the fllowing createwindowex() function.
m_hWnd = CreateWindowEx(
NULL,
L"ComboBox",
L"Appliance Name",
WS_CHILD |
WS_VISIBLE |
CBS_HASSTRINGS |
CBS_DROPDOWNLIST ,
10, 0, 200, 30,
hwndParent,
(HMENU) IDC_MAIN_COMBOBOX,
GetModuleHandle(NULL),
NULL);
And added two strings using the CB_ADDSTRING message. Still when i click the dropdownbox. it is not opening the list box.just a thik line only appears below that Combobox.
Can any one detect what wrong I am doing?
birajendu
CyberG India
Delhi
India
|
|
|
|
|
Can you try with CB_SETMINVISIBLE [^]macro? This message sets the minimum number of visible items in the drop-down list of a combo box.
Instead of using SendMesssage you can call ComboBox_SetMinVisible [^]macro and pass the number of elements required.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
My issue was different. The problem was it required more clint area while drop down.
case CBN_DROPDOWN:
{
RECT rcClient;
// Get the coordinates of the parent window's client area.
GetClientRect((HWND) lParam, &rcClient);
MoveWindow((HWND)lParam,rcClient.left,rcClient.top ,rcClient.right,rcClient.bottom+300,true);
}
I added this above code. which fixed my issue.
birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
I have been using WinExec to launch IE with a URL containing a PHP file and some parameters to send quick updates to a web based MySql database. However the browser widow that opens is becoming annoying. Can someone suggest a simple way or point me to a tutorial that would explain how to run a web based php file from our MFC application. How do I just kick off such an online process ? Thanks
|
|
|
|
|
|
I need to scroll the CFormView derived view to the top of the form. When I use OnScroll with SB_TOP the form scrolls only one line up after each ESC key press. However, using SendMessage function works just fine.
Am I doing something wrong? (VC 6.0)
Yes, I was not reading "fine print"!
As always please ignore the dereferencing symbol, it is actually "->".
Any constructive comments are appreciated.
Cheers Vaclav
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam==VK_F2)
{
TRACE("\nBOOL CFD2008View::PreTranslateMessage(MSG* pMsg) VK_F2");
m_edit.SetFocus();
}
if(pMsg->wParam==VK_ESCAPE)
{
TRACE("\nBOOL CFD2008View::PreTranslateMessage(MSG* pMsg) VK_ESCAPE");
ShowWindow(SW_HIDE);
int iPos = 0 ;
SetDlgItemText(IDC_EDIT1,"");
C_ResetCompletionFlags();
SendMessage(WM_VSCROLL, SB_TOP,0); // works OK
OnScroll(SB_TOP,iPos,TRUE); // scrolls one line up only
ShowWindow(SW_SHOWMAXIMIZED);
m_edit.SetFocus();
}
modified on Friday, June 19, 2009 9:44 PM
|
|
|
|
|
The first parameter of OnScroll() is composed of two parts; a low-order byte for horizontal scrolling, and high-order byte for vertical scrolling.
For vertical scrolling to top, you should use like that.
OnScroll(MAKEWORD(0, SB_TOP), 0, TRUE);
But. if the form has horizontal scrollbar, you will have another problem because of design of that function. SB_LINEUP or SB_LINELEFT is defined as 0. And the function runs in both direction at one whack. That means 0 in high-order byte will be interpreted horizontal line left at the same time. So, you will have unwanted left scroll with above call.
You may have to call again to keep the horizontal position unchanged.
OnScroll(MAKEWORD(SB_LINEDOWN, 0), 0, TRUE);
However, top for both direction will work well.
OnScroll(MAKEWORD(SB_TOP, SB_TOP), 0, TRUE);
Or if there is no horizontal, there won't be any problem.
Otherwise, IMHO, SendMessage(...) way is more appropiate.
|
|
|
|
|
Thanks for your clarification. Appreciate that very much
|
|
|
|
|
Please help.
Thank you in advance.
Easy Profiler : a compile-time profiler for C++
www.potatosoftware.com
|
|
|
|
|
Can't you use web browser control [^]for rendering HTML in your MFC application?
If you're trying to have a core rendering engine, you can use Webkit [^] Open Source rendering engine.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Thank you for your reply.
In a word, I want to develop an application like Klipfolio dashboard where I have multiple HTML control areas in which content is updated via C++ which talks directly to JAVASCRIPT which in turn talks to HTML.
I solved the issue of C/C++ - Javasccript communication via this module : http://www.mozilla.org/js/spidermonkey/[^]
But still unable to do all the chain.
In case you do'nt want to download and test Klipfolio, this is screenshot I uploaded to my gallery. You can see how the application renders content as HTML and and is able to intercept its events and acts on it too from the host C++ application.
http://farm4.static.flickr.com/3356/3642864151_753cf0457c_o.png[^]
Can I acheive that with Webkit ?
Easy Profiler : a compile-time profiler for C++
www.potatosoftware.com
|
|
|
|
|
Our software has some fields where users enter email addresses. We don't actually send any email. A later process picks up those email addresses and sends out notices.
Bad email addresses with things such as spaces, quotes, or double '@' signs can cause serious problems for the system sending out the notices, so we are already validating for some of those things.
But we want to tighten up our validation of the email addresses as much as possible when they are entered. We're not going to go as far as trying to determine if they are valid addresses, but at least want to confirm that they are of valid 'format'.
We're not certain what all of the rules are, but someone here had the idea of tapping into Outlook. I was playing around with calling CMapiSession::Resolve() on the email addresses, and it appears that an address gets 'resolved' if it's of valid format, even if it's not in your Address Book, so exactly what we need. (Of course it will also resolve a name or id that's found in your address book, so need to either make sure there's also an '@' symbol, or replace the name with the email address for them).
But, here's the thing that I find slightly annoying. That little dialog that pops up asking the user to "allow access" to their Outlook. I would love to avoid that, and again, since we aren't actually sending an email, and don't even really need to access their Address Book, it seems like we should be able to avoid asking for access. We are only trying to make use of Outlook's validation of address format, not the part that actually tries to resolve whether it's in their address book.
Does anyone know if it's possible to separate out that functionality? Or find and swipe that chunk of code??? We'd like to make sure our format validation is consistent with Outlook's validation.
Other suggestions also welcome...
Thank you.
|
|
|
|
|
Ummm - leave MAPI - just use a regex[^]. Or this one[^] on CodeProject.
Or you could look at the definitive standard[^]?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
No, useless.
Simply use the api from MS Acc DLL to validate email address (1 line of code...)
|
|
|
|
|
kilt wrote: MS Acc
Care to elaborate what that is?
kilt wrote: 1 line of code
I'm sure the OP (that's not me) would love you to share that with him.
[edit] Looking at the messages you've posted, you do a hell of a lot of criticising of other peoples contributions - maybe you might like to contribute something to the site for a change?[/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
modified on Saturday, June 20, 2009 8:11 PM
|
|
|
|
|
Hello
I am working on VS 2003 and getting compiler warnings saying that those 2 above mentioned functions are depreciated. I know VS 2008 they have sprintf_s and other more safer functions. But there's no way for me to upgrade to 2008.
So can anyone tell me how to get those compiler warnings go away, without setting the warning level to low priority.
That is, i would like to use a wrapper around the sprintf function which will do the type checking to make sure the buffer is of valid size.
Is there any function like that i can use VS2003?
Any help is welcome.
|
|
|
|
|
dipuks wrote: I am working on VS 2003 and getting compiler warnings saying that those 2 above mentioned functions are depreciated.
If the compiler is telling you they are deprecated, then is it also telling you what to use instead? I find it hard to believe that the compiler would know enough to complain, yet not provide any means by which to correct the problem.
In any case, you might have to use _CRT_SECURE_NO_WARNINGS .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
you probably know the signature and functionality of the safe functions; why wouldn't you start using them: implement them yourself, it only takes a couple of lines of code to come up with something that satisfies the interface and is a lot safer than the old unsafe stuff.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Luc Pattyn wrote: it only takes a couple of lines of code to come up with something that satisfies the interface and is a lot safer than the old unsafe stuff.
Uhm........
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|