Creating ActiveX's m_hWnd HWND when instantiating an object with InnerHTML

My implementation involves the utilization of the following JavaScript code to generate a new ActiveX object.

        var playerDiv = document.createElement("div");
        playerDiv.style.border = "1px solid red";
        var size = 200 + 20 * index;
        playerDiv.style.width = 200 + 20 * index + "px";
        playerDiv.style.height = 200 + 20 * index + "px";
        playerDiv.setAttribute("id", 'divPlayer' + index);
        var str = '<object id="player' + index + '" classid="CLSID:69A1BC06-C88F-4849-81E7-DB0AB0628819" width="' + size + '" height="' + size + '"></object>';       
        playerDiv.innerHTML = str;
        divViewPort.appendChild(playerDiv);

The issue arises during the innerHTML binding process where a new ActiveX object is built, but calls from the JS engine to construct the m_hWnd variable are not being received. Upon analyzing the classic code, the call stack is as follows:

>   BCPlayer.dll!CSinglePlayer::CreateControlWindow(HWND__ * hWndParent, tagRECT & rcPos) Line 3207 C++
    BCPlayer.dll!ATL::CComControlBase::InPlaceActivate(long iVerb, const tagRECT * __formal) Line 1037  C++
    ... (remaining stack trace)

The function named:

CSinglePlayer::CreateControlWindow(HWND hWndParent, RECT& rcPos)

is an override of

public CComControl<CSinglePlayer>
. which triggers
CComControl<CSinglePlayer>::CreateControlWindow(hWndParent, rcPos);

In order to simulate the desired environment and trigger the necessary functions to generate the m_hWnd, I resorted to triggering an OnClick() event. The innerHTML used on my object does not execute any of the IOleObjectImpl functions directly. To provide some context, I inherit the following interfaces/classes:

    class /*ATL_NO_VTABLE*/
__declspec(uuid("{69A1BC06-C88F-4849-81E7-DB0AB0628819}"))
VPlayer :
    public CComObjectRootEx<CComMultiThreadModel>
    //, public ATL::CWindowImpl<VPlayer, ATL::CWindow, ATL::CFrameWinTraits>
    , public IObjectSafetyImpl<VPlayer, INTERFACESAFE_FOR_UNTRUSTED_CALLER |INTERFACESAFE_FOR_UNTRUSTED_DATA>
    ... (remaining class inheritance declaration)

m_bWindowOnly = TRUE;

Appreciate your assistance.

Answer №1

After following a friend's suggestion, we concluded that the .rgs file had been altered. The specific code block was not present:

        'TypeLib' = s '{02BED0E7-FD7C-49a5-A046-C1008BA2660B}'
        'MiscStatus' = s '0'
        {
        '1' = s '%OLEMISC%'
        }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to add numerous images to a Laravel platform via ajax using pure javascript?

I am currently working on a form where users can upload one or more photos to the server using ajax. Sometimes, users may not upload any photos at all. How can I efficiently send the data from the file input to the server in the background? Below is the r ...

Animating the continuous transformation of websites using Three.js

Recently, I came across a fascinating website called Garden-Eight that impressed me with its seamless transition between the "Home" and "About Us" sections. The transition was so smooth and continuous, without any loading screens or delays. Upon closer in ...

Increase visibility, decrease visibility by utilizing ng-hide/ng-show and functions

As I implement the show more/show less feature, I am uncertain if achieving a smooth effect is feasible. However, I believe it's worth reaching out to this community for some creative ideas on how to make it possible. I have a list of dynamic links w ...

Passing an array of selected values from Vue.js to a text area and adding them to the existing content

I'm facing a situation and I could really use some assistance. The image shows that there is a multiple select box on the left with numbers, and a text box on the right. My goal is to allow users to click on the house numbers in the select box and hav ...

Verify whether any of the list items do not contain a specified class

I'm struggling with a scenario where I need to check if any of the list items in a ul element do not have a certain class. Here's an example: <ul class="list-synthese"> <li class="hidden">Lorem</li> <li class="hidden" ...

Implementing the requiredUnless validator of vuelidate for checkboxes: A step-by-step guide

When utilizing Vuelidate, the 'required' validator now accepts boolean 'false' as a valid value. To enforce required validation for checkboxes, you must use 'sameAs' such as sameAs: sameAs( () => true ). How can 'requi ...

How can we determine if a 2D array contains a specific string using javascript?

I am currently working on a script to locate the horizontalWord string within a two-dimensional array. While my function for finding verticalWord strings is running smoothly, I am encountering some difficulties with the horizontalWord string. If you have ...

Instructions for manipulating and displaying a source array from a child component using Vue

I have a parent component with an array that I display in the template. My goal is to click on a link that uses vue-router with a dynamic id attribute, and then open a new component displaying only the element of the array that corresponds to that id. Howe ...

"Typescript: Unraveling the Depths of Nested

Having trouble looping through nested arrays in a function that returns a statement. selectInputFilter(enteredText, filter) { if (this.searchType === 3) { return (enteredText['actors'][0]['surname'].toLocaleLowerCase().ind ...

How do I retrieve an index value from an array in GraphQL?

I am seeking a solution for obtaining the index of an array item that is not returned by downstream response. Let's consider my schema: schema: type Cart { items: [Item] } type Item { name: String index: Int } When the data comes in, it lo ...

Issue: Module '/Users/MYNAME/Desktop/Projects/MYPROJECTNAME' not found

I am currently in the process of compiling Node using TypeScript, and I'm still getting acquainted with it. An issue I encountered was that my /src files were not being updated when I made changes and restarted the server. To troubleshoot, I decided ...

When attempting to access the shazam API, I encountered an issue where my useTopChartsQuery function was not recognized as a valid function

Welcome to the shazamCore.js file import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react"; export const shazamCoreApi = createApi({ reducerPath: "shazamCoreApi", baseQuery: fetchBaseQuery({ baseUrl: "https ...

Obtaining an array of objects through the reduction of another array

Currently, my goal is to extract an array of objects from another array. Let's say I have an array consisting of strings: const strArr = ["Some", "Thing"]; The task at hand is to create a new Array containing 2 objects for each st ...

Issue: Retrieve comments via AJAX (from database) in Laravel 5.2

Currently, I am developing a comments section for posts where users can leave comments without the need to refresh the page. However, I am facing an issue in displaying these comments instantly on the post without any page refresh. This is how I have stru ...

Utilizing AJAX to amplify the worth of plupload's echo capabilities

Greetings! Here is the JavaScript code I am using for plupload var uploader = new plupload.Uploader({ runtimes : 'html5,flash,silverlight,html4', browse_button : 'pickfiles', // you can pass in id... container: document.getElementById( ...

How can one identify a concealed glitch that exclusively occurs for a particular individual or hardware in a React environment?

Is it possible to identify a bug that occurs only with a particular individual or hardware in a React application? This bug is invisible and never appears during tests, but only manifests with a specific client within my company. Do you have any tips on h ...

Is there a way to dynamically append options to a Bootstrap selectpicker?

I'm attempting to design a dropdown feature that, when activated by clicking on the first list item, displays a new list of related items next to the initial selection. Here's an illustration: https://i.sstatic.net/fMxAj.png My approach involve ...

Is it possible that socke.io is having trouble connecting to flashsocket?

After upgrading from socket.io 1.3.3, I made sure socket.io connected to flash socket. socketObj = io('http://localhost:9090', {'transports' : ['flashsocket'],'reconnection delay': 20}); Console messages appear as ...

Is it possible for me to retrieve data in object using double v-for?

I am attempting to create a dynamic table using the following objects: <tr v-for="product in allPosts" :key="product.id"> <td v-for='(item, i) in checked' :key='`item${i}`'>{{product.item}}</td> </tr> In th ...

Should I generate a new object or utilize an already existing one?

When working with JavaScript and needing to replace existing data with new data, what is considered a good or "correct" practice? I currently utilize Dojo's Memory and dGrid to showcase my data. The information is refreshed each time the user clicks ...