|
Hello.
I'm writing an ActiveX control which was created by MFC ActiveX ControlWizard. I run the ActiveX control in Internet Explorer. I'm trying to obtain a pointer to the container to be able to change the html-page from the ActiveX control.
In the control class which is derived from COleControl I have to following code:
LPOLECLIENTSITE lpSite = GetClientSite();<br />
LPOLECONTAINER lpContainer; <br />
if(lpSite == NULL) AfxMessageBox("Click OK to crash..."); <br />
lpSite->GetContainer(&lpContainer);
The problem is that GetClientSite() returns NULL so the application crashes.
Any help is greatly appriciated. Thanks in advance.
/Charlie.
|
|
|
|
|
Hello
I have a question about the use of CHtmlView I have never used this before so I am a bit confused at the moment.
I am going to use this view to produce some statistics from a SQL Server database. The app that I've created used to display the result in a basic window but this got a bit boring to look at, so I thought that I could "Hot" things up a bit by using the html support. The option for what kind of statistics that is going to be produced should not be selected in the new View but from another window.
But my question is about the best way to use this view. should I make my app to create the *.htm document from scratch and the browse to it. Or is there a better way for this ?
Cheers
/Henrik
|
|
|
|
|
you can inject the data into a a CHtmlView in many ways - you can use the about: protocol or you could use the DOM - both of these are documented and are only really good for injecting HTML and images coming from a 3rd source eg the disk or maybe resources (ie res: protocol)
My favourite way is an Asynchronous Pluggable Protocol that I did for on old employer that I could use to deliver html and images on the fly to the viewer and I do not have to open any sockets to do so.
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
Guys i installed VC++.NET for the first time and in order to experiment, i open the project i developed in VC++ 6.0. It compiled successfully in VC++ 7.0 but linker give me following errors:
MUM2 error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in libcpmtd.lib(newop.obj)<br />
MUM2 error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)<br />
MUM2 error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) already defined in libcpmtd.lib(newaop.obj)<br />
MUM2 error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in LIBCMTD.lib(delete2.obj)<br />
MUM2 fatal error LNK1169: one or more multiply defined symbols found
Anyone having idea how to remove this error ????
|
|
|
|
|
looks like you are linking to modules/libraries that are built with a different set of C runtimes than your main app.
check Properties / C/C++ / Code Generation / Runtime Library. make sure it's the same for all sub-projects.
also, make sure that if you're linking to any external libraries that you're linking to the correct debug/release version (the C runtimes are different for release / debug builds)
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
Hello !
I have an enormous request :
Could somebody write me a program which, when it is launched, would open MSExcel if it has not been already opened, or give it the focus and bring it on the top if it is already open ?
Some precisions : This is definitely _NOT_ a homework (I insist upon that ). A friend of mine asked me if i could write something like that, and i told him i'll try to find a solution. The fact is, i really don't have time to do it now, but i really want to help him. If you do not have time either (which i suppose), please tell me the more you can about it (Excel would have been opened with a shellexecute, then I would have done it using a temp file where i would have saved the Process ID number of excel (file would have been created the first time), and each time the program is called, it would pick up the Process id in the file and have the Excel app get the focus and get on the top of all windows.
Well, i know that if you know how it works, i think it will take 20min to have it run properly, however, I do not know. So pls help me , i'll be glad to help back if needed one day.
thanxx
~RaGE();
|
|
|
|
|
|
Thnak you, that's a good start. However, i still need a little bit help about remote control the app with the process number.
|
|
|
|
|
Once you have an instance of the Excel automation object. You shouldn't need to use the process number to control the app. You can do it all through the automation object.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
I have a problem to create a socket using WSA instead of MFC. I tried to include WSA functions, but it always fails saying unidentified function. I have included winsock2.h or I included it in my project ( using insert component ). Any idea how to solve this problem????
Thx in advance
Ivan
|
|
|
|
|
Maybe you didn't specify Ws2_32.lib .
rechi
|
|
|
|
|
Hi all,
I have a vague memory about seeing a document on how to add support for version control tools (like SourceSafe) in my own programs.
Apparently a few of the popular version control tools have a common interface.
I would love to get my hands on that document and the header file, but I can't find it anywhere.
Any ideas?
.Henrik
|
|
|
|
|
I have simple dialog box MFC application. I create modeless dialog box. But main dialog window is always drawn behind modeless dialog, even if main dialog has the focus. How to solve this ?
Thanks
rrrado
|
|
|
|
|
This is by design. If you make your modeless dialog a child of the desktop instead of your main dialog, then they will both claim the top position when clicked on. You do this by passing in NULL instead of this to the dialog constructor.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Thanks, thats what i was doing, but now i found the problem - passing NULL as parent in Create() does not set desktop window as parent !
It works only when i create dialog by this way :
m_dlg.Create(IDD_DLG,CWnd::FromHandle(GetDesktopWindow()));
rrrado
|
|
|
|
|
Then do it that way. What's the difference ( i.e. what happens differently, I always used NULL and it worked fine for me ) ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I don't know, maybe different windows version, I use Win98.
rrrado
|
|
|
|
|
hi all,
i want to redirect IE to my own search engine...ex. www.abc.com in case it is unable to find a valid URL..as it does automatically and loads autosearch.msn.com...any help will be appreciated..please..
thanks..
Himanshu
|
|
|
|
|
this ought to be a simple one?
how do i get the active control in a window
ie the one that has focus currently.
----------------------------------------------------------
consider the following dialog app...
the dialog has 3 list controls
namely
Parent 1 ,
Parent2 , and
Child.
also one button "Add"
"Add" is suppoed to insert data into "Child" from either "Parent1" or "Parent2" depending on which is currently selected /focused....
----------------------------------------------------------
so how do i get the wnd pointer of the control that has current focus??
|
|
|
|
|
Neither will have the focus because your button will. You need to store the value seperately and change it whenever you click on either list.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
With WM_SETFOCUS you get the HWND of the window thar has just lost its focus.
You could save this one into a variable and use it in your OnClick() .
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
Hello, I now support user minidumps with my products, so I can debug their crashes if they have any. I now save pdb files with every release, and I want and need to save all the source files as well. I already do a full source backup every day. But it would be much better if I could have a full source backup of this release that included all used system and library header files as well as only the used header and source files of mine.
Is there such a utility that will take a list of source files, then search through them and gather all used header files, taking into account MSVC include directories and precendences? Ideally it would copy them to a specific place, or get a list of them, then I could back this minimal list of source and header files. Thanks for any advice.
|
|
|
|
|
|
VC++8. In the meantime, you're on your own, you need to hook those methods up by yourself.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
VC++8.
Really !! I mean are you saying this seriously??? Do microsoft have plans to include class wizard in next major version of Visual Studio ?????
|
|
|
|