Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Problem with VC++ OCX in VB6.0

Problem with VC++ OCX in VB6.0

Scheduled Pinned Locked Moved COM
helpc++debuggingperformance
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chetanjoshi9
    wrote on last edited by
    #1

    I am using the VC 6.0 ocx in VB6.0 In this ocx I am firing the event in thread with long value as parameter. There is only single thread. I am getting the correct value in client(vb) application. It's working fine when I am running it. But when I tried to debug in VB application in event after pressing F8 application suddenly exits. But without threading it's I can debug also. I could not get the problem. When I used try catch around fire event it gives exception as memory could not read. Help me for this.... Thanks in advance.

    R 1 Reply Last reply
    0
    • C chetanjoshi9

      I am using the VC 6.0 ocx in VB6.0 In this ocx I am firing the event in thread with long value as parameter. There is only single thread. I am getting the correct value in client(vb) application. It's working fine when I am running it. But when I tried to debug in VB application in event after pressing F8 application suddenly exits. But without threading it's I can debug also. I could not get the problem. When I used try catch around fire event it gives exception as memory could not read. Help me for this.... Thanks in advance.

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      chetanjoshi9 wrote:

      In this ocx I am firing the event in thread with long value as parameter. There is only single thread. .... But without threading it's I can debug also.

      :confused: What does this mean? Are you creating secondary threads inside your ActiveX or not? If you are firing events from a secondary thread, you have to initialize the new apartment with a call to ::CoInitialize() and marshal the event sink interface to the client from the apartment that created your server to the apartment with your secondary thread. Another solution is to post a message to the thread that created your server and fire the event from there.

      "It's supposed to be hard, otherwise anybody could do it!" - selfquote
      "High speed never compensates for wrong direction!" - unknown

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups