Qt ActiveX Server Debugging Strategy - c++

I am having problems with building an ActiveX object via activeqt. I attempted to follow a "Simple Example" via the qt 5 documentation (source, but when I run the demo IE page, the page only displays "Object not available! Did you forget to build and register the server?". My steps consisted of the following:
Install Visual Studio 2012 Express
Install Qt creator with extra sources (64 bit on 64 bit Windows 7)
Build the QAxServer library
Run qmake on the Simple example project
Build the "Simple" example project
Try the page with IE
I verified the classid is at least showing in the registry, and the compile output notes that activex server was successfully registered. I checked the event logs, but nothing is showing. The IE console notes that the "Object doesn't support property or method 'about'", but I get that error even if I use a bogus class id, so I'm assuming it could be throwing that error for many reasons. Does anybody have any other debugging strategies? Anywhere else IE might be hiding some useful logs? Thanks!

Related

Windows 10: The application was unable to start correctly (0xc000a200)

I am developing my QT application on windows 10 . The development is complete (as for now).
After run the application in debug mode from QT-creator, I am trying to run the executable from the build directory. But it shows me an "Application Error" dialog with the following message:
The application was unable to start correctly (0xc000a200). Click OK
to close the application.
What is the problem and How to fix it ?!
The error codes are given to you in the error message for a reason. They don't mean anything to regular users, but we're programmers and we are the intended audience. Now that Google has been invented, you have absolutely no excuse for not taking the 5 seconds to Google the error code and see what it means.
In this case, 0xc000a200 is an error code that corresponds to STATUS_NOT_APPCONTAINER. The master list of COM error codes is in the Windows SDK headers, specifically ntstatus.h. If one looks this one up, one sees the following description:
This operation is only valid in the context of an app container.
Now, admittedly, once you get to this point, you may discover that you are in well over your head. You may not have any idea what an app container is, and certainly no clue about how to fix it. But at least then you would be able to ask a good question, which will go a long way to getting you a good answer.
But let's see if you can get lucky this time anyway. This error is most commonly encountered when an application that is not inside of an app container tries to load a DLL that is marked as being part of an app container. It is the linker that is responsible for marking a DLL as being or not being part of an app container, controlled by a series of options for whatever linker you're using. On Microsoft's linker, it is /APPCONTAINER:YES and /APPCONTAINER:NO that control this. I'm not sure what toolchain Qt Creator uses, but if it is not Microsoft's, this should at least get you started looking in the right place in that linker's documentation. Make sure that all DLLs used by your application are not being marked as part of an app container.
The option should be off by default for a regular C++ desktop application project, but it's possible that one of the DLLs started out life as part of a Windows Store app. Or it's possible that the switch just got thrown accidentally.
I had the same error, but the approved solution wasn't the cure. What I found is that I had installed the wrong Qt compiler support packages. For me it was Qt 5.9.1 on Windows 10 64 bit to use with Visual Studio 2017. When installing Qt I selected the "msvc2017 64-bit" option. Sound good, right? Wrong: what I wanted was the "UWP x64 (MSVC2017)".

BHO and internet explorer 11

I saw some code on codeproject like this and this. but both are not compatible with the new security policy of internet explorer add-ons, when i insert then on registry they show up on the IE add-ons list, but with the "incompatible" status. Some can show me a working example for IE11 add-on? or can show me what i need to change? (i already disabled the security mode, but even with that i couldn't make it work) there is something to do with EPM (Enhanced Protected Mode)?
Have you used regsvr32.exe to register your BHO? I have IE 11 and used your second link as a boilerplate project, and I have no problems getting the dll to work in IE (besides having problems with working with the IE api - but that's not relevant).
What I did to get the BHO to work:
Have IE 11
Have Visual Studio 2015
Download the project from codeproject, doubleclick the solution
Convert it to the new format and download the dependencies (VS asked me to convert it, and I didn't have VisualC++ for Visual Studio or something)
Build it in release (I haven't actually tried debug)
Execute regsvr32.exe in an admin command prompt
Start IE and enable the BHO when IE asks you to
That's basically everything I did, and I didn't get an error on the way.
EDIT: Oops, sorry for necroing this. That was not my intention.

MFC Ribbon app not displaying ribbon - when .exe is copy pasted to a different machine

Well, I am facing a strange problem. I have developed a sample MFC ribbon application on my machine - Windows 7 , with Visual Studio 2008. When I copy paste the .exe onto my laptop and run the app , I don't see the ribbon menu (in fact the app has not menu now) .
I have tried looking up the .dll that load in each case(on my work machine and laptop) using process monitor but I am unable to locate what I might be missing. Any help will be greatly appreciated.
Edit 1 -
Ok, So thanks for your responses. Some progress has been made with this issue
I changed my IDE to VS 2010. The ribbon was coded manually and I figured out if I could add it as a resource maybe the problem would be solved. VS 2008 did not have the option of adding a ribbon as a resource.
I installed the VS 2010 Service Pack Redistributable X86/X64 depending on whether the machine is 32 or 64 bit.
I built a new "ribbontest.exe" app from VS 2010 and deployed it on other machines on which I would test my actual app. The ribbon for "ribbontest.exe" loads without any problems.
When I deploy my app and run it, first the old menubar loads for a sec or two, then the ribbon flashes and disappears.
A little history of the app I am referring to -
Initially my application had the menubar view. I followed this article http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c14929/MFC-Feature-Pack-An-Introduction.htm to accommodate a ribbon.
Any suggestions?
Most likely there's a conflict in the settings 'paths'. In your InitInstance() handler, you've got a statement like this:
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
SetRegistryKey(_T("yourappname"));
If you haven't changed that name yet, do it. If you did, open regedit.exe on your target machine and remove the whole key under HKCU\Software\yourappname and then try again.
MFC stores user customizations of Ribbons/Menus/... under that key. But if you changed your app those settings don't necessarily match anymore and you can end up with stuff not showing correctly or not at all.
Make sure you download and install the Visual C++ Redistributable Runtime on your destination machine: http://www.microsoft.com/en-us/download/details.aspx?id=29
Or, something like it. Make sure you have architecture (x86/x64) correct and make sure it matches with the service pack version you compile with.
Joe is right: you need redistributable.
Joe is right: you cannot run 64-bit program on 32-bit machine.
All of the above would be indicated by the system (missing DLL, configuration incorrect, or 64/32 bit discrepancy)
Joe is right: your application must be built for specific set of minimum Windows version and service pack.
In addition to Joe’s post you must run release build not debug build.
If all of those requirements are met and you still have this problem, try linking MFC statically and see if problem persists.

WebBrowser component in Dev-C++

I want to use a WebBrowser control in a Dev-C++ project. Ages ago, when I was using VB6, I just added the WebBrowser control (C:\Windows\System32\shdocvw.dll) to my form and it worked, but I'm lost in C++.
Should I load it dynamically with LoadLibrary, then somehow add it to my dialog window? I want to have standard features like page navigation, dynamic HTML elements, submittable forms, view page source, etc.
Update:
I installed Qt Maker and downloaded a test project from the official site. But when running/compiling I get this error:
Could not find make command: make in the build environment
Error while building project betalabsclient (target: Desktop)
When executing build step 'Make'
Does anyone have any ideas? Mingw is installed, of course.
This is not the answer for your question, but you may want to try and use Qt and the webkit browser component in it.
There are several webkit-related samples and I assume that they may actually suit for your needs "as they are".
Web Browser Example (ActiveQt)
HOWTO: Get QT working with Dev-C++

0xE0434F4D Error

all, I have a rather frustrating issue. The application in question has an MFC GUI that uses the classes available in the MFC Featurepack. This GUI uses an DLL that is developed in C++\CLI. Our company uses Cruise Control. NET (1.4.4 SP1) on Windows Server 2008 SP2 for continuous integration. Cruise Control is setup to use the version of MSBuild that comes with the 3.5 version on the framework.
The issue in question is that if I use the build that Cruise Controls creates, I receive the following error: "Unhandled exception at 0x7642fbae (kernel32.dll) in FormView.exe: 0xE0434F4D: 0xe0434f4d." After some digging, the issue seems to be that the GUI doesn't like the C++\CLI assembly.
The "gotcha" is that if I log on to the server, and, using PowerShell, execute the same MSBuild command, the build works. Any one have ideas?
The issue was how I was building the installer. It was a separate solution from the project's main solution, and was thus a separate task from the primary build. Therefore, the output assemblies got signed twice, and loader complained because the one the application wanted was no longer valid.
you could try and attach the process to the visual studio debugger.