|
Thanks Steve, I was clearly on the wrong line there.
I'm still not able to cause those functions to be entered though. With the main requirement of my control being that all keyboard events in IE be caught from the offset I may have to employ a subclassing solution I've written as a backup. I'm amazed at how uncooperative this ATL business can be. Great when it works though.
Tom
|
|
|
|
|
What exactly are you trying to do? I've never had any trouble handling keyboard events.
Steve
|
|
|
|
|
I'm working on a Web application using Java Servlets with an embedded ActiveX control to bridge the functionality gap.
The App is required to behave and look nothing like the normal IE GUI. Included in this makeover is the issue of controling the app through key combinations eg CTRL F for searching, F1 for help.
I've used JavaScript to block and redirect all the possible commands, except F1 and ALT Home. These two appear to resist even the most concerted efforts. as a result I'm forced to look to the ActiveX control to take me beyond the sand box.
The control will never have direct focus as it's got no window and only resides on the page for such tasks as printing etc.
Thanks again Steve
tom
|
|
|
|
|
Hi all,
Have you ever write the plugin to IE using BandObject (here [^])?
I have read the above article and try to change the original HTML page back from server. I use the code as below:
mshtml.HTMLDocumentClass doc = (HTMLDocumentClass)Explorer.Document;
doc.documentElement.innerHTML = ".........." //My HTML tags
Then the exception appear:
"Could not set the innerHTML property. Invalid target element for this operation."
Have you got any ideas about this exception?
Thanks in advance,
Hung
-- modified at 7:55 Thursday 25th May, 2006
|
|
|
|
|
Hello friends,
I want to get button info of a toolbar button attached to Internet explorer,
using sendmessage function as:
TBBUTTONINFO tbbi;
::SendMessage(hwndFFToolBar,TB_GETBUTTONINFO,(WPARAM)nId,(LPARAM)&tbbi);
nId is ID of toolbar button.
It is not working?
please reply.
|
|
|
|
|
|
I would like to change the look of the Frame window to something of my liking. For example, change the titlebar, system buttons, the color of the border of the frame and etc, etc. I did come across a few articles in Codeproject where the title bar has been customized, but that's only the title bar. I would also like to customize the border of the Frame Window and still have all the functionality of the default frame border.
Can anyone help me?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
now,i have the very problem!i found many stuff but can't resolve it!
i want to change the color of toolbar,or change the whole frame
|
|
|
|
|
I found an article on CP, "How to write a Super compact Super Fast C++ Dll for Visual Basic" which explains how to use ATL to create a DLL.
When I use the VS 2005 AppWizard to create an ATL DLL, it ends up creating a lot more files in the Solution Explorer than are present in the sample project from the article I mention. For example, after using the AppWizard I end up with the following in the Solution Explorer Treeview:
http://img130.imageshack.us/img130/5752/testatldllsolutionexplorer1hn.png[^]
whereas the sample project only has the following in the Solution Explorer Treeview:
http://img442.imageshack.us/img442/7792/tvb4jn.png[^]
I'm guessing the difference is probably because the sample file project was created in VC++ 6.
In the example project, the automatically created functions:
DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer
have been commented out in tvb.cpp and the entries removed from tvb.def, but in the VS 2005 project they are not commented out and the entries are still in the .def file. The sample project also has the following line commented out in tvb.idl:
//import "ocidl.idl"
What does this line do, and what does the line import "oaidl.idl" do ?
All I want to do is create a DLL which exports my own functions. For example, AddTwoInts(int a, int b).
1) Of the automatically generated files from the VS 2005 ATL AppWizard, what can be safely deleted ?
2) Once that's done, do I only need to add the following to the end of ATL_Test_DLL.cpp
extern "C"
{
int__stdcall AddTwoInts( int a, int b )
{
return( a + b );
}
}
followed by adding the following to the end (ie. after the line with "EXPORTS") of ATL_Test_DLL.def
AddTwoInts
Do I need to do anything else ?
|
|
|
|
|
Hi all,
I have written a plugin to IE. Now I want when user press "Enter" key or click on "Go" button, my plugin will catch the URL on the Address Editbox. How can I do that?
Thanks,
Hung
|
|
|
|
|
|
Thanks Mike,
I have done successful.
Now I want my plugin can return the data for IE window to show on the IE window.
BeforeNavigate2()
{
//Code to redirect to my page and get the content back from the server
......................
//How can I show the content on the IE Window ???
}
Thanks in advance,
Hung
|
|
|
|
|
Hi,
In an ATL COM+ application how do I instantiate a well-behaved COM+ object marked as noncreatable?
I read that when instantiating COM+ applications the right way to do it is using the IObjectContext::CreateInstance rather than using CoCreateInstance. However neither is available when using noncreatalbe objects.
If I do it using CComPtr will the object be created in the current context and therefore be well behaved?
Thanks.
|
|
|
|
|
Hi Friends,
These days i am going through the nice artciles of the ATL Under Hood.
Can anyone of u please have a look over the Program no 28 in the following link http://www.thecodeproject.com/atl/atl_underthehood_2.asp[^]
and give me the reason for different outputs in different modes(Debug / Release).
Though some explaination is given i am unable to understand.
Thanks in advance.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
hi friends,
i got Different Problem.
i created one Dll(win32 application). i create one project and put main().
#include "ini.hpp"
int main()
{
char *cp,*cp1;
Config Objcon("../","rrr.ini");
Section objsec = Objcon["server"];
cp=objsec["ip"];
cp1=objsec["port"];
cout<
|
|
|
|
|
bujji_bec wrote: char *cp,*cp1;
bujji_bec wrote: delete []cp; // this one giving problem
delete []cp1; // -----------do----------
Use
delete cp;<br />
delete cp1;
Maxwell Chen
|
|
|
|
|
i tried that one and also used Free also. i am Getting Same problem
b.raju
-- modified at 1:47 Monday 22nd May, 2006
|
|
|
|
|
bujji_bec wrote: int main()
{
char *cp,*cp1;
Config Objcon("../","rrr.ini");
Section objsec = Objcon["server"];
cp=objsec["ip"];
cp1=objsec["port"];
cout<<cp<<"\n"<<"cp1;
delete []cp;="" this="" one="" giving="" problem
delete="" []cp1;="" -----------do----------
}<="" blockquote="">
bujji_bec wrote: i am Getting Same problem
According to the code in the original post, Section::operator [] (LPCTSTR token) allocates some buffer internally. The implementation inside this operator matters how memory is released (by delete ).
Do you mind posting the body of Section::operator [] (LPCTSTR) ??
Maxwell Chen
|
|
|
|
|
Why do you repost your question again ? What was the problem with the answers we gave you here[^] ?
I explained you that you cannot allocate memory in the dll and release it in your program. And furthermore, you don't give any information about what you do in the dll.
What is this class Config ?
Cédric Moonen
Software developer
Charting control
-- modified at 5:43 Friday 19th May, 2006
And also, this is the wrong forum.
|
|
|
|
|
hi friend,
acutally in dll, i am Reading .ini Files. passing Strings or Char pointer and also retrieving Strings or char pointer.finally i delete that one. that is my problem.
sudha
-- modified at 1:45 Monday 22nd May, 2006
|
|
|
|
|
bujji_bec wrote: int main()
{
char *cp,*cp1;
Config Objcon("../","rrr.ini");
Section objsec = Objcon["server"];
cp=objsec["ip"];
cp1=objsec["port"];
cout<<cp<<"\n"<<"cp1;
delete []cp;="" this="" one="" giving="" problem
delete="" []cp1;="" -----------do----------
}
in="" the="" program="" output="" coming="" correct.="" but="" delete="" its="" memory="" issues.<="" blockquote="">
I'm assuming that your Config object is defined in your DLL? That being the case, your memory is being allocated in the DLL's memoryspace, and you are trying to delete it from the application's memory space. This will cause an exception and will crash your application.
To avoid this, you have 2 options:
1) Add a method to your Config class to clean up memory it allocates. This will basically turn it into a factory for the objects it creates (what is made in the factory is also deleted in the factory).
2) Use Boost's/TR1's shared_ptr class to wrap your pointers. This will prevent this problem completely without you needing to call delete at all. Note that to do this, you should modify your DLL to return shared_ptrs.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
He asked this question already some time ago and the answer was the same as yours.
Anyway, the point is that it leads to an interesting discussion about this fact that the program will crash if you release the memory allocated in your dll from your exe. It appears that the problem arise only when both projects link to different run-time libraries.
the discussion starts here[^].
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Ah, so he did. Strange why someone would ask the exact same question 2 days in a row. Most of the answers in the previous thread were accurate enough to tell him not to do it that way.
There are many issues that factor in when someone tries this (too many to list). Suffice it to say that it doesn't work far more often than it does, and in either case, it is bad practice to free memory that was allocated by another module (simply on software engineering practices).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hello friends,
I am creating edit control at run time in WTL.
i written following handler for edit control.
NOTIFY_HANDLER(2500, EN_CHANGE, OnUpdateEdit)
LRESULT OnUpdateEdit(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
but i am unable to capture change event of edit box, means this function never execute.
|
|
|
|