dbTalk Databases Forums  

Late binding

comp.databases.ms-access comp.databases.ms-access


Discuss Late binding in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ron paii
 
Posts: n/a

Default Late binding - 09-14-2011 , 07:38 AM






I have some code in A2010 that interfaces with SolidWorks EPDM api using
early binding. Some user don't have EPDM installed so I would like to use
late binder, currently I have to maintain 2 version of the FE. The problem
is EPDM is a Windows File Explore add-on and has no separate user interface
to call using something like CreateObject("Outlook.Application"). How can I
late bind with an add-on application?

Reply With Quote
  #2  
Old   
Bob Barrows
 
Posts: n/a

Default Re: Late binding - 09-14-2011 , 07:56 AM






ron paii wrote:
Quote:
I have some code in A2010 that interfaces with SolidWorks EPDM api
using early binding. Some user don't have EPDM installed so I would
like to use late binder, currently I have to maintain 2 version of
the FE. The problem is EPDM is a Windows File Explore add-on and has
no separate user interface to call using something like
CreateObject("Outlook.Application"). How can I late bind with an
add-on application?
A user interface is not required. For example, you can use late binding with
a DAO object:

set db=createobject("DAO.Database")

Reply With Quote
  #3  
Old   
Arvin Meyer
 
Posts: n/a

Default Re: Late binding - 09-14-2011 , 08:38 AM



"ron paii" <none (AT) nospam (DOT) com> wrote

Quote:
I have some code in A2010 that interfaces with SolidWorks EPDM api using
early binding. Some user don't have EPDM installed so I would like to use
late binder, currently I have to maintain 2 version of the FE. The problem
is EPDM is a Windows File Explore add-on and has no separate user interface
to call using something like CreateObject("Outlook.Application"). How can I
late bind with an add-on application?

Late binding will not work if the software is not installed at all. You
cannot create a connection to software that just isn't there. The difference
between early and late binding is speed and versioning. The difference in
code is like this:

Early Binding:
' Declare the object as an early-bound object
Dim objAccess As Access.Application

Set objAccess = CreateObject("Access.Application")

' The Visible property is called
objAccess.Visible = True


Late Binding:
' Declare the object as a late-bound object
Dim objAccess As Object

Set objAccess = CreateObject("Access.Application")

' The Visible property is called
objAccess.Visible = True

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://access.mvps.org
Co-author: "Access Solutions", published by Wiley

Reply With Quote
  #4  
Old   
ron paii
 
Posts: n/a

Default Re: Late binding - 09-14-2011 , 09:59 AM



"Arvin Meyer" <arvinm (AT) invalid (DOT) org> wrote

Quote:
"ron paii" <none (AT) nospam (DOT) com> wrote in message
news:j4q77f$jjk$1 (AT) dont-email (DOT) me...
I have some code in A2010 that interfaces with SolidWorks EPDM api using
early binding. Some user don't have EPDM installed so I would like to use
late binder, currently I have to maintain 2 version of the FE. The problem
is EPDM is a Windows File Explore add-on and has no separate user
interface to call using something like
CreateObject("Outlook.Application"). How can I late bind with an add-on
application?


Late binding will not work if the software is not installed at all. You
cannot create a connection to software that just isn't there. The
difference between early and late binding is speed and versioning. The
difference in code is like this:

Early Binding:
' Declare the object as an early-bound object
Dim objAccess As Access.Application

Set objAccess = CreateObject("Access.Application")

' The Visible property is called
objAccess.Visible = True


Late Binding:
' Declare the object as a late-bound object
Dim objAccess As Object

Set objAccess = CreateObject("Access.Application")

' The Visible property is called
objAccess.Visible = True

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://access.mvps.org
Co-author: "Access Solutions", published by Wiley

With late binding, I can check if the application is not installed and not
run the code. With early binding the FE cannot be loaded if the application
is missing.

Reply With Quote
  #5  
Old   
Tony Toews
 
Posts: n/a

Default Re: Late binding - 09-14-2011 , 03:06 PM



On Wed, 14 Sep 2011 07:38:06 -0500, "ron paii" <none (AT) nospam (DOT) com>
wrote:

Quote:
I have some code in A2010 that interfaces with SolidWorks EPDM api using
early binding. Some user don't have EPDM installed so I would like to use
late binder, currently I have to maintain 2 version of the FE. The problem
is EPDM is a Windows File Explore add-on and has no separate user interface
to call using something like CreateObject("Outlook.Application"). How can I
late bind with an add-on application?
Can you post some sample code showing how you start using it?

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

Reply With Quote
  #6  
Old   
ron paii
 
Posts: n/a

Default Re: Late binding - 09-14-2011 , 04:33 PM



"Tony Toews" <ttoews (AT) telusplanet (DOT) net> wrote

Quote:
On Wed, 14 Sep 2011 07:38:06 -0500, "ron paii" <none (AT) nospam (DOT) com
wrote:

I have some code in A2010 that interfaces with SolidWorks EPDM api using
early binding. Some user don't have EPDM installed so I would like to use
late binder, currently I have to maintain 2 version of the FE. The problem
is EPDM is a Windows File Explore add-on and has no separate user
interface
to call using something like CreateObject("Outlook.Application"). How can
I
late bind with an add-on application?

Can you post some sample code showing how you start using it?

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
This is the function I use to login to EPDM

'-------------------
' Opens the Vault and hold open in static var
' Keep ref to vault open for improved speed
'
' Return Reference to the vault
'
Private Function EPDM_GetVault() As EdmVault5

Static m_Vault As IEdmVault12

' Open vault
If m_Vault Is Nothing Then
Set m_Vault = New EdmVault5
' Loginto vault, using current user login
Call m_Vault.LoginAuto("SWVault", "None"), _
GetAccesshWnd())
Else
If Not m_Vault.IsLoggedIn Then
' Loginto vault, using current user login
Call m_Vault.LoginAuto("SWVault", "None"), GetAccesshWnd())
End If
End If

Set EPDM_GetVault = m_Vault ' Return reference to Vault
Exit Function

End Function

Reply With Quote
  #7  
Old   
ron paii
 
Posts: n/a

Default Re: Late binding - 09-14-2011 , 04:37 PM



"ron paii" <none (AT) nospam (DOT) com> wrote

Quote:

"Tony Toews" <ttoews (AT) telusplanet (DOT) net> wrote in message
news:m9227710ts4td27kqkajuo61pu6eplvqsj (AT) 4ax (DOT) com...
On Wed, 14 Sep 2011 07:38:06 -0500, "ron paii" <none (AT) nospam (DOT) com
wrote:

I have some code in A2010 that interfaces with SolidWorks EPDM api using
early binding. Some user don't have EPDM installed so I would like to use
late binder, currently I have to maintain 2 version of the FE. The
problem
is EPDM is a Windows File Explore add-on and has no separate user
interface
to call using something like CreateObject("Outlook.Application"). How can
I
late bind with an add-on application?

Can you post some sample code showing how you start using it?

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

This is the function I use to login to EPDM

'-------------------
' Opens the Vault and hold open in static var
' Keep ref to vault open for improved speed
'
' Return Reference to the vault
'
Private Function EPDM_GetVault() As EdmVault5

Static m_Vault As IEdmVault12

' Open vault
If m_Vault Is Nothing Then
Set m_Vault = New EdmVault5
' Loginto vault, using current user login
Call m_Vault.LoginAuto("SWVault", "None"), _
GetAccesshWnd())
Else
If Not m_Vault.IsLoggedIn Then
' Loginto vault, using current user login
Call m_Vault.LoginAuto("SWVault", "None"), GetAccesshWnd())
End If
End If

Set EPDM_GetVault = m_Vault ' Return reference to Vault
Exit Function

End Function .
I strip out code that looks up the vault name "SWVault"

Call m_Vault.LoginAuto("SWVault", "None"), GetAccesshWnd())

should be

Call m_Vault.LoginAuto("SWVault", "None", GetAccesshWnd())

Reply With Quote
  #8  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Late binding - 09-15-2011 , 12:50 PM



"Arvin Meyer" <arvinm (AT) invalid (DOT) org> wrote in
news:bqmdnRYmqcv9M-3TnZ2dnUVZ_qCdnZ2d (AT) earthlink (DOT) com:

Quote:
Late binding will not work if the software is not installed at
all. You cannot create a connection to software that just isn't
there. The difference between early and late binding is speed and
versioning.
Well, there's also recoverability when the external component is not
installed.

I really don't think the OP thought the software would somehow
magically work if not installed but programmed through late binding
-- I think all he wanted to do was fail gracefully, since it allows
you to continue running code and tell the user it's not installed.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #9  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Late binding - 09-15-2011 , 12:51 PM



"ron paii" <none (AT) nospam (DOT) com> wrote in
news:j4q77f$jjk$1 (AT) dont-email (DOT) me:

Quote:
I have some code in A2010 that interfaces with SolidWorks EPDM api
using early binding.
Basically, you need to find the name of the component that you need
to initialize with CreateObject. You have to poke around the
registry for this. I would start by looking up the name of the file
in the early binding reference, and then search the registry for
that.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #10  
Old   
ron paii
 
Posts: n/a

Default Re: Late binding - 09-15-2011 , 12:59 PM



"David-W-Fenton" <NoEmail (AT) SeeSignature (DOT) invalid> wrote

Quote:
"ron paii" <none (AT) nospam (DOT) com> wrote in
news:j4q77f$jjk$1 (AT) dont-email (DOT) me:

I have some code in A2010 that interfaces with SolidWorks EPDM api
using early binding.

Basically, you need to find the name of the component that you need
to initialize with CreateObject. You have to poke around the
registry for this. I would start by looking up the name of the file
in the early binding reference, and then search the registry for
that.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
With this API New is used instead of CreateObject. I am thinking that the
application is running under Windows explorer. See my code posted earler.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.