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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Dynamic Data Exchange LinkExecute

Dynamic Data Exchange LinkExecute

Scheduled Pinned Locked Moved Visual Basic
helptutorial
4 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.
  • V Offline
    V Offline
    vhassan
    wrote on last edited by
    #1

    hi Previously I was using frmStart as my startup object and in Form_Load I was calling LinkExecute if my frmStart is already loaded. Now I have changed my startup object and using Sub Main() to show or hide frmStart. Problem is that now when I call LinkExecute in the frmStart Load the execution goes fine but Object gets unloaded automatically. I get Error '364' After LinkExecute I have Unload Me command but control never reaches there. please tell me how to avoid the "Object was unloaded" error. Thanks.

    D 1 Reply Last reply
    0
    • V vhassan

      hi Previously I was using frmStart as my startup object and in Form_Load I was calling LinkExecute if my frmStart is already loaded. Now I have changed my startup object and using Sub Main() to show or hide frmStart. Problem is that now when I call LinkExecute in the frmStart Load the execution goes fine but Object gets unloaded automatically. I get Error '364' After LinkExecute I have Unload Me command but control never reaches there. please tell me how to avoid the "Object was unloaded" error. Thanks.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I have no clue what you're talking about... Is this a VB6 app or VB.NET?? What are you doing with "LinkExecute"?? on what object is it being called?? What's the complete error message you're getting??

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      V 1 Reply Last reply
      0
      • D Dave Kreskowiak

        I have no clue what you're talking about... Is this a VB6 app or VB.NET?? What are you doing with "LinkExecute"?? on what object is it being called?? What's the complete error message you're getting??

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        V Offline
        V Offline
        vhassan
        wrote on last edited by
        #3

        please see following details:

        public Sub Main()

        If App.PrevInstance Then        
           If Command$ <> vbNullString Then
               myform.HiddenText.Text = Command$
               myform.HiddenText.LinkTopic = "MyApplication|SendCmd"
               myform.HiddenText.LinkMode = vbLinkManual
               myform.HiddenText.LinkExecute myform.HiddenText.Text
               myform.HiddenText.LinkMode = vbLinkNone
            End If
            Unload myform
            Exit Sub
        
        Else
            'perform some checks
            
        End If
        
        'pseudo code 
        If checks are not valid 
            show message and exit
        else
            if command$ has value
                   myform.show
            else 
                   myform.hide
            end if
        end if
        

        Exit sub
        End Sub

        Now in this case i get "Timeout while waiting for DDE response". Please reply.

        modified on Monday, June 15, 2009 12:39 AM

        D 1 Reply Last reply
        0
        • V vhassan

          please see following details:

          public Sub Main()

          If App.PrevInstance Then        
             If Command$ <> vbNullString Then
                 myform.HiddenText.Text = Command$
                 myform.HiddenText.LinkTopic = "MyApplication|SendCmd"
                 myform.HiddenText.LinkMode = vbLinkManual
                 myform.HiddenText.LinkExecute myform.HiddenText.Text
                 myform.HiddenText.LinkMode = vbLinkNone
              End If
              Unload myform
              Exit Sub
          
          Else
              'perform some checks
              
          End If
          
          'pseudo code 
          If checks are not valid 
              show message and exit
          else
              if command$ has value
                     myform.show
              else 
                     myform.hide
              end if
          end if
          

          Exit sub
          End Sub

          Now in this case i get "Timeout while waiting for DDE response". Please reply.

          modified on Monday, June 15, 2009 12:39 AM

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I couldn't tell you. I haven't touched VB6 in over 8 years now. Sorry.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          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