Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6217937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:30:47+00:00 2026-05-24T07:30:47+00:00

I have an ActiveX HTML Object as defined here: <object id=HSMBTPrintX1 width=350 height=350 classid=CLSID:68d05400-18a6-4b39-b3ff-a17d77c1eddf

  • 0

I have an ActiveX HTML Object as defined here:

<object id="HSMBTPrintX1" width="350" height="350"
   classid="CLSID:68d05400-18a6-4b39-b3ff-a17d77c1eddf" codebase=".\HSMBTPrintX.ocx">

And a button:

<input type="button" name="Print" value="Print" onclick="PassParameter()" />

This button calls some javascript defined above the button and control:

<script language="javascript" type="text/javascript">
    function PassParameter() {
            if (StringInput.value != " ") {
                alert('1 - ' + HSMBTPrintX1);
                HSMBTPrintX1.InputParameter = StringInput.value;
                alert('2 - ' + StringInput.value);
                var temp = HSMBTPrintX1.PrintLabel();
                alert('3 -' + temp);
            }
    }
</script>

My PrintLabel C++ code method, here:

char* CHSMBTPrintXCtrl::PrintLabel(void)
{
    return "temp";
    //AFX_MANAGE_STATE(AfxGetStaticModuleState());

    // TODO: Add your dispatch handler code here
    TCHAR g_szComPort[16];
    char szout[512];
    HANDLE hCom;
    TCHAR comPort[16];
    unsigned long bytesWritten;
    int counter;
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    if (!FindBluetoothPort(g_szComPort))
    return "minus two";
    hCom = CreateFile(comPort,GENERIC_READ|GENERIC_WRITE,0,0,OPEN_EXISTING,0,0);
    if (hCom == NULL)
    return "minus one";
    CStringA charstr(m_InputParameter);
    // Create text to send to printer
    strcpy(szout, "^XA\n");
    strcat(szout, "^PRC ^LH0,0 ^LL203 ^PW406 ^MD5 ^MFF,F ^MMT ^MNM ^CF0,20,12 ^XB\n");
    strcat(szout, "^FO20,05 ^AFN ^FV MASTER PACK ^FS\n");
    strcat(szout, "^XZ");

    // Write file to Bluetooth COM port
    if(WriteFile(hCom,szout,256,&bytesWritten,NULL)==0)
    {
        return "one";
    }
    return "two";
    FireLabelPrinted();
}

And as you can see, (just for testing), as soon as the function is called it returns some text. I attempt to output this text in a javascript alert.

The issue is, the “temp” javascript variable outputs as “undefined”… so i’m assuming the PrintLabel function never even gets called.


For some background information (which may or may not help in a conclusion), i am using VS2008, creating a Visual C++ Smart Device project. The solution also has a Smart Device CAB Project added on. The entire solution is then built; I copy the .CAB, .INF, .OCX and .HTML files to a single folder on a handheld device running Windows CE.

Additionally, I am not very familiar with C++… nor ActiveX. Any help is appreciated!!

If i need to provide more information, just point me in a direction.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:30:49+00:00Added an answer on May 24, 2026 at 7:30 am

    I think the issue was with my HTML object… i now have the version number, and all caps for the class id:

    <object id="HSMBTPrintX1" width="350" height="350"
                        classid="CLSID:68D05400-18A6-4B39-B3FF-A17D77C1EDDF"
                        codebase=".\HSMBTPrintX.ocx#1,0,0,1">
    

    everything is working fine now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an activex object I loaded into an html page. I then use
I have an ActiveX object which extends some functions. I have a web page
I have an activex plugin here: http://reboltutorial.com/plugins/logo-badge/ I tried by adapting the script http://forums.devarticles.com/javascript-development-22/detecting-activex-objects-installed-in-ie-11041.html
I'm trying to modify an object on a click. Here's what I have. <form>
i have this html menu: <ul id='main'> <li class='active current' id='lighty'> <a href='/'>Lighty</a> <ul>
I have an ActiveX control written using the MS ATL library and I am
I have an ActiveX plugin that we need (if possible) to run in Firefox.
I have an ActiveX/COM DLL. It contains many methods and properties. I would like
I have an ActiveX control (an OCX file) which raises an event. I want
I have an ActiveX control that runs on a website, where the old version

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.