|
|
Comments and Discussions
|
|
 |

|
"While editing the dialog, right-click on it, select "Insert ActiveX control", and choose one. "
Q: why can't select "Insert ActiveX control"?
use visual studio 2005 -> visual c++ -> smart device -> win32 smart device project
thanks.
|
|
|
|

|
Sorry for the late reply, I was working with a similar problem today for an ActiveX control that I wrote.
If you are using an ATL Dialogbox (and you probably are, because a regular MFC dialogbox within ATL doesn't allow for ActiveX control hosting as you probably already know [see link: http://resources.esri.com/help/9.3/arcgisengine/com_cpp/COM/VCpp/ControlsATL.htm#Known_Limitations[^] ]), then you will need to do the following:
1. Import directive to your STDAFX.H
In your "stdafx.h" file, add an #import directive to the bottom of the file after the statement "// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
", just before the very last #endif. (2nd last line)
HERE'S THE CATCH...
If your class supports dual interfaces (C++ AND Dispatch Interfaces) you will NEED TO USE the C++ version. (This basically means, you will instruct VC++ to use extra the C++ implemented functions out of the dll you will be calling into and NOT the regular type-library methods -- that are available to VisualBasic or any MFC only project -- Despite ATL having made and MFC wrapper that inherits from CWnd and available in your project.)
THE DIRECTIVE SHOULD BE AS FOLLOWS:
In my case, my ActiveX Control (dll file) was located in the following directory: c:\myControl\releaseMinSize\fpe.dll
#import "c:\myControl\releaseMinSize\fpe.dll" raw_interfaces_only no_namespace
Notice the extra part: raw_interfaces_only no_namespace
2. Accessing the control from your dialogbox
Let's assume in your dialogbox you have inserted the ActiveX control and the control id is IDC_FPECONTROL1.
Here comes the tricky part; since the import directive declaration VC++ does some wierdo COM Smart Pointer wrapping that is not all that obvious.
In my control, I have a Text Property (in VB you'd do a control.Text = "Something"; in MFC you'd do a control.SetText("Something"))
The raw C++ implentation for all Set and Get (which ARE there for every property) always looks like this:
HRESULT put_Text(BSTR data)
HRESULT get_Text(BSTR *data)
To access the IDC_FPECONTROL1 we would do the following:
IFPEControlPtr p;
HRESULT hr;
BSTR txt;
hr = GetDlgControl(IDC_FPECONTROL1,
__uuidof(IFPEControl), (void**)&p);
p->get_Text(&txt);
IFPEControlPtr p;
HRESULT hr;
CString str;
hr = GetDlgControl(IDC_FPECONTROL1,
__uuidof(IFPEControl), (void**)&p);
CEdit edit;
edit.Attach(GetDlgItem(IDC_EDIT1));
edit.GetWindowText(str);
p->put_Text(str.AllocSysString());
edit.Detach();
I hope this helps you!
Mubeen M. Deen
|
|
|
|

|
You really helped a Linux programmer brought in the middle of Win32 Api
I do it for money ....
|
|
|
|

|
hi, I have try to extends the application .
I want capture the Event titleChange of WebBroser . I find the workflow has some problem , when change title of Document in web page via Javascrits , the WebBrowser will fire the Event titleChange twice, what cause the problem ?
anyone can help me , thanks a lots
|
|
|
|

|
I am working on a pure ATL/WTL80 project. I quickly discovered that it was not 100% MFC free. It still used CPtrArray. So I replaced it with a std::vector and now it works great for me. It would be my pleasure to share my changes, if someone would be kind enough to enlighten me as to how to post the code here.
|
|
|
|

|
I am voting 5
modified on Wednesday, February 27, 2008 2:07 PM
|
|
|
|

|
Hi,
When I run the ResizeDialog.exe application, the ZoneAlarm (version 6.0.667.000) firewall says:
1. ResizableDialog.exe is trying to access the trusted zone
Application: ResizableDialog.exe
Destination IP: 127.0.0.1 port 1536
Allow Deny
2. If I choose "Allow" then it asks again :
ResizableDialog.exe is trying to access the trusted zone
Application: ResizableDialog.exe
Destination IP: 213.157.178.1 DNS
Allow Deny
3. If I choose "Allow" then I finally see the www.codeproject.com web page displayed correctly.
4. But what bothers me much more, is this:
If I close and then run again ResizableDialog.exe, then ZoneAlarm tells me that ResizableDialog.exe is trying to access the trusted zone on another port(??), like this:
ResizableDialog.exe is trying to access the trusted zone
Application: ResizableDialog.exe
Destination IP: 127.0.0.1 port 1548
Why are the TCP/IP ports used by the web browser control seem to change each time I run the application ? First 1536, then 1548, then 1561 and so on... What's going on?
What is the Microsoft web browser control doing on my loopback address(127.0.0.1) ??
The reason must be somewhere inside the internal details of the web browser control. But where ?
Please tell me if, on your computers, you are also noticing this behaviour.
I use the Internet Explorer 6.0 SP1 browser. I have also applied all the security updates/patches from the Microsoft web site. I have no spyware, I can navigate the Internet without any problem of any kind.
Thank you.
Alexandru
-- modified at 7:23 Tuesday 31st January, 2006
|
|
|
|

|
If I remember well, the samples use the windows media player as well as the web browser separately. Since the samples only invoke a "play" command on a given filename or url, I can only infer that your PC is either configured such that web requests (or something done by Windows media depending on the sample) route the request to those proxies. Or, your PC is infected with some web browser BHO addon that gets loaded whenever the web browser control gets loaded, or some media player plugin that gets loaded when the windows media control gets loaded.
Anyhow that's none of my business.
Good luck!
|
|
|
|

|
There is no infection on my computer(no virus, no spyware).
Please take any Win32 application you like, not just this
one, application which embeds a "Microsoft web browser control".
Then please run the Win32 application on a computer where the Zone Alarm firewall(preferably a recent version from 2005, like 6.0.667.000) is installed.
The "Microsoft web browser control" is behaving in
an undocumented way, I can bet on that.
I've also posted this question to the ZoneLabs customer service.
Thank you.
|
|
|
|

|
Dear All,
Im creating component that used IWebBrowser2 component,I try to make IWebBrowser2 transparent.It still failed.
Can anyone help me,thx.
Dankung
|
|
|
|

|
I'm having the same issue. Did you find a solution to this problem?
Thanks
-Angela
|
|
|
|

|
Nice work! I added resize ability to a standard win32 dialog (message loop and all) in < 30 minutes, but I've got a problem with the static group boxes.
When resizing, they redraw themselves, but the wm_erasebkgnd doesn't seem to be handled, so the area inside (and slightly outside) the group boxes is not redrawn.
I wondered if it was just a problem with my dialog, so I added a group box to your sample resizable dialog, and it exhibited the same problem.
From experimentation, it seems that the problem is related to the clipchildren style.
Looking at the MFC article your's is based on, it seems group boxes work there, but I haven't yet established why. Any thoughts?
Thanks in advance,
Lance P.
|
|
|
|

|
I have experienced the same prblem with group boxes. Sorry, no solution so far.
|
|
|
|

|
Turn off clip_children, and give static boxes transparent style.
|
|
|
|

|
Love the article thanks a bunch. I'm having a probelm I'm hoping someone can help with.
There is a fantastic Graph control completed by a member of code Project, here is the link:
http://www.codeproject.com/miscctrl/ntgraph_activex.asp[^]
Nikolai Teofilov
I have been trying to integrate this graph into my real-time monitoring software. We are developing a NASCAR simulator and need to monitor motion telemetry in real-time....here is our web-site: www.ameritechsimulation.com[^]
I'm havin some compile errors:
NTGraph.tlh(106) : error C2146: syntax error : missing ';' before identifier 'LabelFont'
NTGraph.tlh(106) : error C2501: 'FontPtr' : missing storage-class or type specifiers
NTGraph.tlh(106) : error C2501: 'LabelFont' : missing storage-class or type specifiers
etc.....
There seems to be a problem with the dependent type library, "NTGraph.tli" I visually checked the file "NTGraph.tlh" with notepade.exe and could see at the bottom of the file the #include path was correct for "NTGraph.tli".
Should the #include "NTGraph.tli" path not be at the top of the file just after the namespace inside "NTGraph.tlh"?
Little losted here.
Thanks!
Christian
|
|
|
|

|
Basic rules :
- an ActiveX has a built-in .tlb file
- You can import a .tlb in your program with a simple #import "xxxx.tlb" statement. This will create a .tlh and .tli file pair. You need not agree include any of those two files yourself. Importing the tlb is enough.
- With the smart pointers, you can instantiate the ActiveX, and use it then.
|
|
|
|

|
I've been handling the WebBrowser Control resizing in WM_PAINT. Something like:
using namespace Gdiplus;
CPaintDC dc(this);
CRect bounds;
GetClientRect(&bounds);
CMemDC memDC(&dc, &bounds);
Graphics graphics(memDC.m_hDC);
Rect wRect(bounds.left+10,bounds.top+20,bounds.right-10,bounds.bottom-10);
GetDlgItem(IDC_EXPLORER)->MoveWindow(wRect,TRUE);
In conjuction with "ResizableLib", it seems to work great and flicker-free. Is this wrong? I've been teaching myself C++ for the last six months or and I just want to make sure I'm doing it the right way.
Thanks,
Wolf
"Anything's possible if you don't know what you're talking about."
- Green's Law of Debate
|
|
|
|

|
Hi All,
I am working in an ATL dll project with MFC. I have embedded the Windows Media Player ocx onto my ATL Dialog.
I have put the following in my code
//defined in class CSelectedWin : public CAxDialogImpl
//I have also #imported the ocx in STDAFX.h
LRESULT CSelectedWin::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
// Windows media player specific code
MediaPlayer::IMediaPlayerPtr pMediaPlayer = NULL;
HRESULT hr = GetDlgControl(IDC_OCXVIDEO, __uuidof(MediaPlayer::IMediaPlayer), (void**)&pMediaPlayer);
if(FAILED(hr)){
//This always fires. fails to get the control
MessageBox(_T("Problem occured getting mediaplayer control"), _T("Warning"), MB_ICONSTOP);
}
pMediaPlayer->FileName = _bstr_t("C:\\Themovie.mpg"); // a test mpg I have
pMediaPlayer->Play();
return 1; // Let the system set the focus
}
My code always fails to getdlgcontrol.
Any ideas on why this would happen?
cheers
Bryce
|
|
|
|

|
how did you know which files to import and which interfaces to use for web browser?
|
|
|
|

|
Regarding the files to import, it's really a matter of looking around the actual dlls being loaded when you are using the Internet Explorer SDK. I don't know if you remember the InternetExplorer 4 client SDK, but really everything is there : in the docs, in the samples.
After a couple projects using Internet Explorer, you tend to get that the dom object model is managed by a separate API than the browser renderer itself. So at least two dlls are involved, the name of the game is to figure out their names.
Running the dependency Walker clearly shows all dlls being part of the game. This post[^] also lists the dlls, figured out right from the recent Eolas-compliant IE6 update. Then, taking a few C++/WIN32 samples using Internet Explorer to only parse html content cleatly shows that only mshtml is being used. Conversedly, by taking a code sample that load the internet Explorer to navigate a simple url, you come to figure out the sample uses a particular COM object. Then by expanding the registry keys from HKCR \ CLSID, you end up with the actual dll.
The OLE viewer that comes with the VisualStudio package also says a lot about the link between a public component name, and the actual dll. For instance, mshtml.tlb is behind the "Microsoft HTML object library (4.0)" public component name (OLE Viewer / TypeLibraries / "Microsoft HTML object library (4.0)").
That said, when you have the actual dll, there is still something to know. It is that Internet Explorer is meant to be driven using automation, in such a way that when COM loads a dll, it's first of all because it needs to load the type-library (the compiled idl file). The fact is Microsoft chose to embed the browser renderer type-library within shdocvw.dll, while they chose to leave the html object model type-library OUTSIDE mshtml.dll, resulting in a separate mshtml.tlb file. Something that is obvious using OLE Viewer since "Microsoft HTML object library (4.0)" targets mshtml.tlb, not mshtml.dll.
Importing the mentioning libraries with the proprietary #import statement creates ATL-based dispatch wrappers, so you can access the interfaces declared in the design-time idl file(s) without bothering. If you want to know more, just take a look at the ExDisp.idl file from your VC++ headers.
Regarding which interface to use, it's really up to figuring out :
- the samples from the Internet Explorer 4 SDK
- the samples in sites like codeproject and codeguru
- ...
An automation object usually exposes an "application" interface, which serves as an entry point to other interfaces, and one or more outgoing interfaces to subscribe to.
In the case of Internet Explorer, the application interface is the interface declared with the [default] attribute in the ExDisp.idl file as copy/pasted below :
coclass WebBrowser_V1
{
interface IWebBrowser2;
[default] interface IWebBrowser;
[source] dispinterface DWebBrowserEvents2;
[default, source] dispinterface DWebBrowserEvents;
}
An automation object may raise events you can subscribe to. That interface is shown in the idl declaration above with the [source] attribute. The fact that tere are more than one [default] and [source] attributes is only for versioning reasons. The COM library will always take the first being declared.
So we know that if we want to take advantage of the Internet Explorer renderer API we've got to load shdocvw.dll (CoCreateInstance), and then query for the IWebBrowser interface.
If we are interested in one or more events triggered by Internet Explorer, then we've got to subscribe the DWebBrowserEvents2 interface and implement it.
That's exactly what I do in this article.
Hope this helps.
-- modified at 9:19 Saturday 8th October, 2005
|
|
|
|
|

|
hi,
i have a listview and a treeview right next to eachother, and when i resize, it doesn't keep proportionality... The controls are being resized in relationship to the size of the window, its just that the treeview (on the left of the list view) is shrinking and the listview isn't next to it when you shrink, and if you expand, it overlaps eachother.
Any ideas?
|
|
|
|

|
There is both a short and long solution to this issue. Short first.
Let's assume the treeview is on the left and listview is on the right like in the Windows explorer. You've got to add the RX rule to the treeview and MX to the listview so that the right side of the treeview never overlaps the left side of the listview. In fact, doing so, the gap between the two controls act like a splitter.
Which leads to the long solution.
The best way to handle this situation is to either :
- use a true owner (frame) window instead of a dialog box, just like in the usual doc/view MFC model. Doing this, you automatically benefit the ability of a resizable window, and you can create a splitter window to handle the resizing.
- create a splitter on your own, and make sure that splitter knows about the instances of the treeview and the listview so it can act accordingly. I believe you can find implementations for raw WIN32 splitters out there in codeguru / codeproject, etc. You can also take a look at the article from PaulDiLascia pointed by someone else, right in this comment area. PaulDiLascia creates a splitter wnd to handle this without being seen.
Good luck!
-- modified at 9:20 Saturday 8th October, 2005
|
|
|
|

|
Great,
Thanks so much. That did the trick! =)
|
|
|
|

|
Hi, Great article. I'm trying to copy/paste the ResizableGrip.h and ResizableGrip.cpp into my project. It's a win32 app and the only error i'm getting is basicly "CPtrArray" undefined. Now, if i copy all of your code, and cut away what i dont need (on a small level) it works...and compiles. But if i try to insert it into my 4 month old application which i'm giving an ATL overhall, it gives me 3 errors. 1) resizablegrip.h error C2146: syntax error : missing ';' before identifier 'm_wndControls' //SNIPPET class CResizableGrip { // Members protected: HWND m_hParent; SIZE m_sizeGrip; // holds grip size HWND m_wndGrip; // grip control ===> CPtrArray m_wndControls; // controls allowed to dynamically move and resize RECT m_initialrect; BOOL m_binitialrect; //END SNIPPET 2) error C2501: 'CPtrArray' : missing storage-class or type specifiers 3) error C2501: 'm_wndControls' : missing storage-class or type specifiers all on the same line, so i know it's basicly saying "object not defined"...but if thats the case, whats different between my application, and yours? Any ideas?
|
|
|
|

|
CPtrArray is defined in Templates.h
-- modified at 9:20 Saturday 8th October, 2005
|
|
|
|

|
great,
however, now everything compiles correctly and i followed your directions, i just dont understand why it doesn't work. I have a function called "ChildControls()" that creates a listview and a treeview for my program and that works, then after that function. I add the rules like you say to. Then i modifyed the WM_SIZE and WM_RESIZE messages and added the code that you had, but i dont see the symbol in the bottom right hand corner of the window and it doesn't resize at all.
Any ideas?
|
|
|
|

|
Add the "Resizing dialog" style in your dialog box. Either by hand in the resource editor, or programmatically.
-- modified at 9:20 Saturday 8th October, 2005
|
|
|
|

|
yeah... you did a realy good work, but I got a problem:
I did the following things:
1. Added to *.h file:
---------------------
BEGIN_MSG_MAP(CSampleDialog)
...
ON_COMMAND(WM_INITDIALOG,OnInitDialog)
ON_WM_CLOSE()
ON_WM_SIZE()
ON_WM_SIZING()
...
END_MSG_MAP()
2. Defined these functions:
---------------------------
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{ ... }
LRESULT OnSizing(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{ ... }
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{ ... }
3. Defined macros in StdAfx.h:
------------------------------
...
4. Added lines to OnInitDialog:
-------------------------------
//Macro Version:
BEGIN_SIZINGRULES(m_grip, m_hWnd)
ADDRULE(m_grip, IDOK, RX) <- Gives error C2440 (see below)
END_SIZINGRULES
//Without Macros:
HWND hTreeView = GetDlgItem(IDOK); <- Gives error C2440 (see below)
But now the line with ADDRULE brings an error and also the line in the version without macros gives an error:
error C2440: cannot convert 'class CWnd *' to 'struct HWND__ *'
CWindow::GetDlgItem => returns CWnd
CWnd::GetDlgItem => returns HWND (on what depends which functions i used???)
Could somebody please help a newbie??????? Did I forgot to do something additional?
I use MFC - can that be a problem? I think it has to be a quite simple mistake, but I can't find it (I'm searching and trying already for some weeks)...
Greetings
Sonyc (Italy)
(Please respect that I'm a Newbie to VC++. I learned it a month ago from some good books)
|
|
|
|

|
GetDlgItem(...) is also implemented by the ATL CDialogImpl class.
You seem to have taken fractions of the code. While I am afraid to tell you you have to take the entire class declaration.
This dialog class is not a MFC class, it's an ATL class. The base MFC dialog class is CDialog, while the base ATL dialog class is CDialogImpl.
You can use ATL stuff within an MFC project. I did this already a few times and had no problem.
-- modified at 14:16 Sunday 9th October, 2005
|
|
|
|

|
Dear Sonyc,
GetDlgItem is A pointer to the control.
//=================
// ( assume IDOK is TreeView Control)
CTreeCtrl* hTreeView = GetDlgItem(IDOK)
HWND hWnd = hTreeView->m_hWnd
//=================
( have a nice try )
Jakarta
Dankung
|
|
|
|

|
Your article was very usefull for one of my project, thanks !
|
|
|
|
|

|
This C++ tool[^] records web actions.
|
|
|
|
|

|
To use the VC++7 -> VC++6 project converter, you don't have to recompile it. Just use the prjconverter.exe executable from the zip file.
(in case you want to recompile it anyway, you have to download the MSXML3 SDK. Read the comment section for the VC++7 -> VC++6 project converter article).
|
|
|
|

|
The Win32 is troublesome but I have to use it in my DLL for final year project.
I have experienced the following problems and wonder how to solve them.
1. Where to add the code for reacting the click of OK button after long run task completion ?
2. How to change the background color of the text box from white to background color of window in which the text displayed?
3. Is there any sample coding for multimedia API or DirectShow to display AVI file?
Thanks for your kind help.
DLLEXPORT int _stdcall Test(unsigned char * key)
{
const char g_szClassName[] = "myWindowClass";
RECT rcClient; // client area of parent window
int cyVScroll; // height of scroll bar arrow
HWND hwndParent; // handle of parent window
HWND hwndPB; // handle of progress bar
HWND hwndAVI; // handle of avi
int i;
WNDCLASSEX wc;
// Register the Window Class
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = g_hInstance;
wc.hIcon = 0;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = g_szClassName;
wc.hIconSm = 0;
if(!RegisterClassEx(&wc)) {
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
// Create the Window
hwndParent = CreateWindowEx(
WS_POPUPWINDOW,
g_szClassName,
"Encryption in Progess",
WS_OVERLAPPEDWINDOW & ~WS_MINIMIZEBOX & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME,
GetSystemMetrics(SM_CXSCREEN)/3, GetSystemMetrics(SM_CYSCREEN)/3,
GetSystemMetrics(SM_CXSCREEN)/3, GetSystemMetrics(SM_CYSCREEN)/3,
NULL, NULL, g_hInstance, NULL);
if(hwndParent == NULL) {
MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK);
return 0;
}
ShowWindow(hwndParent, SW_SHOWNORMAL);
UpdateWindow(hwndParent);
hwndButton = CreateWindow ( TEXT("button"),
TEXT("OK"),
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
50, 50, 50, 50,
hwndParent, (HMENU) buttonctrl,
g_hInstance, NULL);
//((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
if(hwndButton == NULL) {
MessageBox(NULL, "Button Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK);
return 0;
}
hdc = GetDC(hwndParent);
TextOut(hdc, 30, 30, szMsg, lstrlen(szMsg)) ;
(szTop)) ;
ShowWindow(hwndParent, SW_SHOWNORMAL);
UpdateWindow(hwndParent);
GetClientRect(hwndParent, &rcClient);
cyVScroll = GetSystemMetrics(SM_CYVSCROLL);
hwndPB = CreateWindowEx(0, PROGRESS_CLASS, (LPSTR) NULL,
WS_CHILD | WS_VISIBLE | PBS_SMOOTH,
rcClient.left + cyVScroll, (rcClient.bottom - 2*cyVScroll),
(rcClient.right - 2*cyVScroll), cyVScroll,
hwndParent, NULL, g_hInstance, NULL);
// Set the range and increment of the progress bar.
SendMessage(hwndPB, PBM_SETRANGE, 0, MAKELPARAM(0, 4000));
SendMessage(hwndPB, PBM_SETSTEP, (WPARAM) 1, 0);
for (i = 0; i < 4000; i++)
// one small step of lengthy operation
SendMessage(hwndPB, PBM_STEPIT, 0, 0);
DestroyWindow(hwndPB);
return 0;
}
|
|
|
|

|
wavewave wrote:
The Win32 is troublesome
Especially if you try to write sophisticated WIN32 apps without reading a book about WIN32 programming first.
wavewave wrote:
1. Where to add the code for reacting the click of OK button after long run task completion ?
If I guess things well, you would like to let the user cancel a lengthy task by offering a OK button in some dialog box. Ok so you have to create a modeless dialog box, show it, then start a separate thread where the task runs. In your thread, do not forget to add a PeekMessage/DispatchMessage loop, just in case no other UI thread would listen for clicks while the task in running.
wavewave wrote:
2. How to change the background color of the text box from white to background color of window in which the text displayed?
Process the WM_CTLCOLOREDIT message.
wavewave wrote:
3. Is there any sample coding for multimedia API or DirectShow to display AVI file?
You don't need DirectShow to play an AVI file. In case you have read my article (which you obviously didn't, and in which you have shamlessly posted off-topic stuff), you'll find a section where I show how to add and use the Windows Media player control.
The place for homework posts is /dev/null. Just in case.
|
|
|
|

|
Hi, there this is a really gd program i must say. But i discover something, when i am playing around with it. It seems that after typing the URL, i must click "go" button to navigate. And also when i trying to search something using yahoo, i can't hit Enter to navigate too. Is there any way to solve this problem?
I'm just a newbie to visual c++, simpler terms please
|
|
|
|

|
Open the .rc file, edit the properties of the "Go" button, and check the "default button" box.
That's all.
|
|
|
|
|

|
kyoshiro wrote:
But "when i trying to search something using yahoo, i can't hit Enter to navigate", this problem still exists.
Unfortunately, it's by design when you host the web browser control, instead of using the stand-alone Internet Explorer.
This is not related to the implementation I have. You can easily verify it.
That said, this gives me an idea for an article. And while we are at it, if I remember well, I have already heard a few things about it in the past.
|
|
|
|
|

|
Thanks for the article.
[Edit] I have taken the time to read the article and, although it brings interesting ideas (while none are new), it is useless and doesn't fit the purpose of my article. As a remainder, my article is about resizing and adding ActiveX support to WIN32 dialogs. One of the point is of course not to use MFC at all, or any other "large" framework.
Not only the article you refer to relies on MFC, it doesn't work without taking care at EVERY TINY LEVEL of the intrincacy of message routing, frames versus toolbars, etc.
Finally, just before I begin shouting over it, this article brings a convenient MESSAGE MAP tool especially in order to handle splitters. Unfortunately, I have yet to see splitters in dialogs.
May be I am wrong, but I conclude saying the Paul DiLascia article, although excellent in theory, is off-topic and useless in practice. Especially for dialogs.[/Edit]
|
|
|
|

|
"(MFC42 is probably the biggest mess in setup issues one can think of. Thanks MS for upgrading the (likely to be) system locked MFC dlls without changing the name of the dlls.)"
Well I guess you never had to install MDAC 2.5 and newer, because that's an even bigger
nightmare
A conclusion is the place where you got tired of thinking.
|
|
|
|

|
Funny enough I had to deal with it recently. MDAC is supposed to be easily deployed using versioning tools like MS MDAC Com checker. The MDAC Com checker tool provided freely by MS is utter crap, and I quickly made my own version checker : I have found that comparing the existing file version os msado15.dll to the one you distribute was almost enough for most issues.
|
|
|
|

|
Very good and light article, is exactly what i need !
Thanks Rod!
Adrian Bacaianu
|
|
|
|

|
For such needs we have WTL. It has classes for resizable dialog and more - join the fun.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|

|
Thanks. My aim was to show how all of this works underneath, adding features "by hand". That said, I believe that template classes used in this article, CDialogImpl<> and CAxDialogImpl<> are part of WTL. I like to think about such articles like intermediary learning steps before someone uses wrapper libraries, which hide the code and behaviors. I did the same about COM plumbering a couple of months ago and yes, one could directly use ATL macros, but may be it's worth understanding the bits.
|
|
|
|

|
That's exactly what I thought when I read the article intro. WTL is ideal for your purpose. I began working with WTL 6 months ago and it's by far the framework I prefer.
Thanks to WTL I'm able to share the same dialogs/frame in MFC and CBuilder based projects. Should be the same with Win32. WTL rocks.
Yarp
http://www.senosoft.com/
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Easy support for dialog resizing and ActiveX controls
| Type | Article |
| Licence | |
| First Posted | 11 Apr 2003 |
| Views | 179,242 |
| Bookmarked | 70 times |
|
|