regsvr32.exe

Top | runas.exe | regsvr32.exe | qbxmlrp2e | Sample Code


Note, the following comes from "regsvr32.exe /?" regsvr32.exe

Usage: regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname


QuickBooks qbxmlrp2e Details

Top | runas.exe | regsvr32.exe | qbxmlrp2e | Sample Code


  1. When you implement DCOM in your integrated application, you can use the qbxmlrp2e.exe with your product. It is not be necessary to edit the code for this program.

  2. The only big difference between DCOM and non-DCOM code is the CoCreateInstanceEx call.

  3. DCOM on Win98/ME does not allow auto-launching of servers. The "/RegServer" command option of qbxmlrp2e.exe sets up the registry to run qbxmlrp2e.exe at boot time using the "RunServices" registry key on Win98/ME systems. Under Win98/ME, the qbxmlrp2e.exe server is written to stay running even if the lock count of objects running goes to zero. We must keep the qbxmlrp2e server running since it cannot be automatically launched by DCOM.

  4. You might ask, why use the wrapper "qbxmlrp2e". This wrapper is necessary to get around some issues with communicating with QB using DCOM. In the future, if these issues are resolved, we might be able to DCOM directly to the qbxmlrp2Lib.IRequestProcessor2.

    Issue A: If we DCOM directly to QB when QB UI is running, we receive an error from the BeginSession call. This QB/DCOM problem only occurs on WinNT/2000/XP machines. We take care of this issue by having the wrapper RunAs "Interactive User".

    Issue B: QuickBooks qbxmlrp2 is a DLL. Using DCOM, the server has to be set up to run in a separate process. Instead of setting up QB's qbxmlrp2 to run in a surrogate Host, we run a wrapper that is an EXE that does not need a surrogate.

    Issue C: The Win98/ME autolaunching issue is not taken care of in the QB qbxmlrp2, so our wrapper takes care of this issue.

  5. The one issue which is not taken care of in this DCOM_SDKTest program is to be able to communicate with QB when there is not anyone logged into the QuickBooks WinNT/2000/XP computer. (This is not an issue when doing DCOM to a QB computer running Win98/ME.) The qbxmlrp2e will not work because it runs as "Interactive User" since there is no interactive user when noone is logged into the computer. To get around this problem, create a second wrapper. Set up the second wrapper to RunAs "Launching User". The second wrapper must be setup with permissions in dcomcnfg. Then in the program, if you receive the error that you cannot create the instance of qbxmlrp2e, then try to create the instance of the second wrapper and use that second wrapper in the calls in your code.

  6. "What about DCOM and QBFC". An integrated app can do DCOM and also use QBFC. First the QBFC must be installed on the same computer as your integrated app. Second, use the calls to QBFC to build the XML request and to parse the XML response. Then "get" or "put" the XML request or response from QBFC and pass these XML strings to and from the qbxmlrp2e wrapper.


Sample Image Of Code

Top | runas.exe | regsvr32.exe | qbxmlrp2e | Sample Code


The link below provides an image of sample code.

Sample code presented. Text file.


RUNAS USAGE

Top | runas.exe | regsvr32.exe | qbxmlrp2e | Sample Code


RUNAS [ [/noprofile | /profile] [/env] [/netonly] ]
/user:<UserName> program

RUNAS [ [/noprofile | /profile] [/env] [/netonly] ]
/smartcard [/user:<UserName>] program

/noprofile
specifies that the user's profile should not be loaded. This causes the application to load more quickly, but can cause some applications to malfunction.
/profile
specifies that the user's profile should be loaded. This is the default.
/env
to use current environment instead of user's.
/netonly
use if the credentials specified are for remote access only.
/savecred
to use credentials previously saved by the user. This option is not available on Windows XP Home Edition and will be ignored.
/smartcard
use if the credentials are to be supplied from a smartcard.
/user
<UserName> should be in form USER@DOMAIN or DOMAIN\USER
program
command line for EXE. See below for examples

RunAs Examples

> runas /noprofile /user:mymachine\administrator cmd

> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"

> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

RunAs Notes

NOTE: Enter user's password only when prompted.
NOTE: USER@DOMAIN is not compatible with /netonly.
NOTE: /profile is not compatible with /netonly.