Register ActiveX Control without an ocx file - c++

I am adding functionality to an open source project which uses an external activex control known as DMGraph (http://www.codeproject.com/Articles/310494/D-Graph-ActiveX-Control-in-Cplusplus-with-ATL-No-M?msg=4567275#xx4567275xx) but I get an error that the control needs to be registered when I try opening the resource file that uses this control. As stated on the project page that I linked, there is no ocx file, but I don't understand how I'm supposed to register this control without said file. If its any help to finding the issue, I have simply downloaded the source code to this open source project that i'm trying to get this work in. It has already implemented the DMGraph functionality and works in their builds so the issue must be with trying to build it on a different machine. Any ideas?

Related

NSCameraUsageDescription needed for C++ projects in Xcode for MacOS Mojave

I am trying to run OpenCV projects in Xcode and it seems like there's a new need to provide an info.plist for C++ applications NSCameraUsageDescription.
2018-09-28 00:03:15.181948+0800 k_nearest_detector_v2[23505:710470] [access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
Program ended with exit code: 9
How do I go about creating a .plist file for a C++ project as it has never been needed before.
Found a solution. Put the file with the desired NSCameraUsageDescription, NSMicrophoneUsageDescription (or others) with the assembled file from XCode (See screen shots below). For the Release and Debug versions.
You can even automate the steps described by #Valery Gromov. Just copy the file in the Build Phases. Uncheck the Copy only when installing checkbox to be able to run it directly from Xcode.

Why are buttons when not using wxSmith flat?

I'm new to wxWidgets. I'm using Code::Blocks (MSW compiler), version wxWidgets-3.0.2 on Windows 7.
I started learning this, but I got stuck when I found out that I couldn't develop a good looking wxButton when I write the codes myself without using wxSmith.
All I get as output are flat wxButtons and toolbars that look like buttons. I thaught it was my fault, then I created a little frame with wxButton in it, then compiled. The output suits my taste.
I copied the exact code for this little frame and created another project file without wxSmith and I pasted them in their corresponding file. When I compile this same code, all I get is a flat wxButton.
If I hover the mouse over it, it won't turn blue as it does in wxSmith compiled code. I also noticed that anything, e.g, toolBars that is likely to be clickable, will look flat, but not menus.
What am I missing?
It seems like you need to add the manifest to your application. The manifest is the thing that describes your application needs to system: what visual style you want to use, which OS are your app compatible with, etc.
The most simple way to do it with wxWidgets is to add a resource file (*.rc) to your project (or if you already have one then edit the one you have) and put this line of code there:
#include "wx/msw/wx.rc"
You may need to change the path to wx.rc file depending on your project settings. File location is:
<wxWidgets directory>\include\wx\msw\wx.rc
wx.rc will include correct manifest based on your build type:
x86 -> "wx/msw/wx.manifest"
x64 -> "wx/msw/amd64.manifest"
ia64 -> "wx/msw/ia64.manifest"
If you don't want to use wxWidgets default manifest files, then you need to:
create a file name your_app_name.exe.manifest (or your_dll_name.dll.manifest) and fill it manually (you can find description of application manifests and an example here: MSDN: Application Manifests (Windows);
place this manifest file in the folder with your executable file (just to be clear, if your app name is MyCoolApp.exe, then manifest must be named MyCoolApp.exe.manifest) or embed manifest into executable with mt.exe tool (mt.exe is shipped with Visual Studio, you can find the tutorial on how to use it to work with manifests here: MSDN: How to: Embed a Manifest Inside a C/C++ Application.

How to compile dynamic virtual channel c++ example from MSDN

On MSDN there is an example in C++ on how to create Dynamic virtual channel plugin.
My problem is that I don't know how to compile it.
Do I need to create an ATL project and in main.cpp copy-and-paste the code found on msdn? What do I call the project? If I create ATL project with name DVCPlugin, than Visual studio 2008 automatically creates DVCPlugin_i.h file, otherwise I don't have that file.
tsvirtualchannels.h is part of Windows 7 SDK so at least with that include I don't have a problem.
One of the errors I am getting is this:
&CLSID_DVCSamplePlugin not recognized identifier
I tried to create ATL project with the name DVCSamplePlugin but I received the same message as above.
Any suggestions I need to do to be able to compile that source code?
It took me a couple of hours, but I got the source for the client plugin to build using VS 2012. Here were my steps.
Start a new ATL Project named DVCPlugin. Select the option for a DLL.
Choose support for COM+ and check the box for the Object Registrar.
Add a file named GUID.cpp to the DVCPlugin project. include stdafx.h in this file.
ATL gave me a class named CompReg, which had its own IDL entries and GUID. I needed to associate that GUID with the CDVCSamplePlugin class.
In DVCPlugin.cpp, add the include for <tsvirtualchannels.h> to the top.
Paste the rest of the sample code after the definition of DllInstall().
Change the line DECLARE_REGISTRY_RESOURCEID(IDR_PLUGIN) to DECLARE_REGISTRY_RESOURCEID(IDR_DVCPLUGIN).
It looks like building the solution silently runs the registry script in the DVCPlugin.rgs file. I had to change the threading model to Free, though.
If mstsc.exe is 64-bit, you need a 64-bit plugin dll for the dynamic discovery to work.
This is just some code for testing Remote desktop connection -
There is an "echo" listener that is implemented by the Remote Desktop Connection (RDC) client, which is always present and listening for incoming connections. When you are writing the server side of a dynamic virtual channel (DVC) module, as a quick test you can open an endpoint named "ECHO". Any write to a channel that is instantiated from this endpoint will result in the receipt of the same data.
From MSDN.
Such projects are usually included in some SDK. And this one seems to be part of Windows 8 SDK
Update: After a critique from Tim (see below), i've decided to add these links with MSDN information -
Remote Desktop Services. TS-Teleport: Sample Instructions and
Remote Desktop Services Blog. Dynamic Virtual Channels

export ActiveX control from exe

I got one challenging task here.
We got one Dialog in exe file (made of C++), and now we want it to be an ActiveX control, so it could be loaded in C# .net form, However because of the complicated web of c++ header file, it's hard to pick up files to make a separate ActiveX dll.
So is that possible to export an activeX control from the exe file?
Thanks in advance.
An ActiveX control is a nothing more than a DLL. Yes it is possible to export an activeX control from an exe file. A typical scenario is to put an Image (your ActiveX control) as a Resource of another application and to extract it at runtime. Here one of the many available samples on the web.

Resource File VS2010: Images missing when copying product

I am creating a c++ dll which includes some images in the png format using VS2010. This works fine as long as I keep the dll on my developer machine. When I try to copy the dll to another machine the images are missing.
When I compile my project, a file called app.res is placed in the build directory. If I look into that file, it seems to contain some binary encoded pngs. The project settings contain a entry called "Resource File Name" in the "Resources" section. The value is "app.res". Therefor I assume that my resources are added to the dll. However, it apperently doesn't work that way.
Does anyone have any ideas what could be wrong here?
Does anyone know of any good instructions on how to deals with resource files in VS2010. The Microsoft documents just didn't help much..
The linker embeds the .res file in the DLL. Verify this with File + Open + File, select your DLL, you can browse the embedded resources. There is otherwise no mechanism to make embedded resources disappear when you copy the DLL, they are firmly embedded.