List Info

Thread: Calling CORBindRuntimeHost from VB6




Calling CORBindRuntimeHost from VB6
user name
2006-07-25 17:48:17
Anyone have a VB6 sample of a successful call to
CORBindRuntimeHost? The
situation is an ASP Classic page calls a VB6 COM DLL which
calls a .Net
assembly. Short of creating a .config file for W3WP.exe, I
see no way of
specifying configuration information for this situation (and
some of our
stuff needs it).

 

Here is my declare:

 

Private Declare Function CorBindToRuntimeHost Lib
"mscoree.dll" (ByVal
pwszVersion As String, _


ByVal pwszBuildFlavor As String, _


ByVal pwszHostConfigFile As String, _


ByVal pReserved As Long, _


ByVal startupFlags As Long, _


ByVal rclsid As Long, _


ByVal riid As Long, _


ByVal ppv As Long) As Long

 

 

And I call it like this:

 

    Dim version As String

    Dim buildFlavor As String

    Dim hostConfigFile As String

    Dim Reserved As Long

    Dim startupFlags As Long

    Dim rclsid As Long

    Dim riid As Long

    Dim ppv As Long

    Dim ret As Long

    

    version = "v2.0.50727"

    buildFlavor = "svr"

    hostConfigFile = "C:\dev\SomeTest.config"

    startupFlags =
STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN_HOST

    

    ret = CorBindToRuntimeHost(StrPtr(version),
StrPtr(buildFlavor), _

                                StrPtr(hostConfigFile),
0&,
startupFlags, _

                                0&, 0&, 0&)

 

...or if there is a better way to accomplish what I am
trying to do...

 

 


===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )