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 8163173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:57:39+00:00 2026-06-06T18:57:39+00:00

So, I am playing around with ActiveX and C# and ways how both of

  • 0

So, I am playing around with ActiveX and C# and ways how both of them can work together. the thing is I have hit the wall right in the beginning with mentioned error. Steps I have followed:

In VS2010 I selected MFC ActiveX Control project. Then I added a method “SHORT Multiply( SHORT a, SHORT b);” by clicking the Add method option in the menu that pops when you right click _DProjectname under ProjectnameLib in solution explorer. The code for the method is as follows:

    SHORT CSampleProgramActivex01Ctrl::Multiply(SHORT a, SHORT b)
    {
      AFX_MANAGE_STATE(AfxGetStaticModuleState());

     // TODO: Add your dispatch handler code here

     return ( a * b);
    }

Now I have created a simple C# console application that references the generated COM file and when I try to use the method, the application stops with the above mentioned error. I have searched the error on the internet but no clear solution is mentioned. Any help appreciated. If you guys want clarification, let me know.

  • 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-06-06T18:57:40+00:00Added an answer on June 6, 2026 at 6:57 pm

    I don’t know whether this is considered as solving the problem or not but I found a workaround:

    First instead of C# console application, I created C# windows form application. After creating the form, I have added the whole ocx as component in the toolbox. You do this by right-clicking the Toolbox types in Toolbox menu. In the new menu, you click Choose Items. This pops up new menu and in that select the COM tab and in that check your COM component and the COM component will be added to the Toolbox menu. Now drag and drop the component on the menu and you should be good to go.

    This seems to be workaround that everybody is following. Not neat but that is the norm I think.

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

Sidebar

Related Questions

I've been playing around with Simple.Data and have run across something that I can't
Playing around with Timers, and trying to make them behave right when app is
Playing around with MongoDB and NoRM in .NET. Thing that confused me - there
Been playing around with this for a couple of hours and can't seem to
I've been playing around with Active Record a bit, and I have noticed that
Just playing around with some of the APIs in .NET and I can't seem
I have been playing around with various methods of making the Visitor pattern in
I'm just playing around with some code but it seemed to have the specific
Playing around with Google Maps these days, with some directions. I have a map
Just playing around with interfaces and I have a question about something which I

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.