Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need help with linking internet and my VFP app.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00079192
Message ID:
00109804
Vues:
28
>When I started using FoxISAPI under NT 4.0, I had the same error. I didn't understand it but did find that it had something to do with DCOMCNFG.EXE configuration setup. Everytime I generated a new .EXE, I got the error. Then by going into DCOMCNFG and re-applying the security references, it appeared to work ok...
>
>Again, not positive why but it did work for me...


In VFP 5.0 you need to rebuild the DCOM settings each time. Actually, the settings stay in place, but VFP blows away the registry links that link the
server ClassID and hte DCOM settings.

In VFP 6.0 servers don't blow away the settings so you only have to set
it once and you're done. I built a routine that does this automatically
and use it as part of my build process (DO BLDOLE which has embedded
the EXE and ProgId for the server). The code looks like this (there are a few
Web Connection dependencies here, but you can figure out what's happening):
************************************************************************
PROCEDURE DCOMCnfgServer
***********************
***  Function: Sets the security attributes of an Automation server
***            to Interactive User
***    Assume: Only works for Interactive user for now
***      Pass: lcProgId  -  Program ID for the server (wcdemo.wcdemoserver)
***            lcRunAs   -  User Account (Default: Interactive User)
***    Return: nothing
*************************************************************************
LPARAMETER lcProgId, lcRunAs
LOCAL lcProgId, loAPI, lcClassId, lcServerName

lcRunAs=IIF(type("lcRunAs")="C",lcRunAs,"Interactive User")
lcProgId=IIF(type("lcProgId")="C",lcProgId,"")
loAPI = CREATE("wwAPI")

*** Retrieve ClassId and Server Name
lcClassId = loAPI.ReadRegistryString(HKEY_CLASSES_ROOT,;
                                     lcProgId + "\CLSID",;
                                     "")
lcServerName = loAPI.ReadRegistryString(HKEY_CLASSES_ROOT,;
                                        lcProgId + "","")

IF ISNULL(lcClassId) or ISNULL(lcServerName)
  wait window nowait "Invalid Class Id..."
  RETURN
ENDIF
  
wait window "Configuring server security for "+CR+;
             lcProgId + CR + lcServerName  nowait

*** Now add AppId key to the ClsID entry
if !loAPI.WriteRegistryString(HKEY_LOCAL_MACHINE,;
        "SOFTWARE\Classes\CLSID\"+lcClassId,"AppId",lcClassID,.t.)
   wait window "Unable to write AppID value..."  nowait
   RETURN
ENDIF                                     


*** Create a AppID Entry if it doesn't exist
if !loAPI.WriteRegistryString(HKEY_CLASSES_ROOT,;
        "AppID\"+lcClassId,CHR(0),CHR(0),.t.)
   wait window "Unable to write AppID key..."  nowait
   RETURN
ENDIF                                     

*** Write the Server Name into the Default key
loAPI.WriteRegistryString(HKEY_CLASSES_ROOT,;
                          "AppID\"+lcClassId,"",;
                          lcServerName,;
                          .t.)

*** Write Interactive User (or user Accounts)                          
loAPI.WriteRegistryString(HKEY_CLASSES_ROOT,;
                          "AppID\"+lcClassId,"RunAs",;
                          lcRunAS,;
                          .t.)

wait window "DCOM security context set to: " + lcRunAs nowait                          
RETURN 
+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform