Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Code stops working after installing SP2 on WinXP

Posted on 2004-10-20
8
Medium Priority
?
334 Views
Last Modified: 2008-02-01
I posted this question in the C++ section under "Programming" a couple of days ago, but haven't got a solution yet.  I guess I should try posting it in this section.

I have a client-server application.  The server is running in a WinXP Pro. machine, and the client is running in a Win2K machine.  Brefore SP2 was installed, everything was working fine.  However, after the install of SP2, I got a "RPC server is unavailable" error on the client.  I put the "RestrictRemoteClients" setting (DWORD) with value of 0 under \\HKLM\SOFTWARE\Policies\Microsoft\Windows NT\RPC\ on the server machine.  It didn't help at all.

Basically, the client program needs to create a COM object on the server by doing the following:

CComPtr<IPrintJob> spPrintJob;
HRESULT hr = CoCreateInstance2( _T("Server"), CLSID_PRINTJOB, &spPrintJob, true );

The returned hr value is 0x800706BA.  The CoCreateInstance2 function is below:

template <class Q>
static HRESULT CoCreateInstance2( LPTSTR lpszHost,
const CLSID& clsid, Q** ppq, bool bUnAuthenticated = false, DWORD dwClsCtx = CLSCTX_SERVER )
{
     (*ppq) = 0;
   
     if (lpszHost)
     {
          USES_CONVERSION;

          COAUTHINFO cai = { RPC_C_AUTHN_NONE, 0, 0, RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, 0, 0 };
          COSERVERINFO csi = { 0, T2W(lpszHost), 0, 0 };

          if ( bUnAuthenticated )
          {
                  csi.pAuthInfo = &cai;
          }

          MULTI_QI mqi = { &(__uuidof(Q)), 0, 0 };
           
          HRESULT hr = ::CoCreateInstanceEx( clsid, 0, dwClsCtx, &csi, 1, &mqi );

          if (FAILED(hr)) return hr;
           
          (*ppq) = (Q*)(mqi.pItf);
          return S_OK;
     }

     return ::CoCreateInstance( clsid, 0, dwClsCtx, __uuidof(Q), (void**)(ppq) );
}


Please advise.  Thanks.
0
Comment
Question by:cmsdiginet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 2

Expert Comment

by:tomasg18
ID: 12367312
Have you tried disabling the firewall on the Windows XP SP2 machine?  If the application works with the firewall disabled, then you need to open ports for your application to work.  
0
 

Author Comment

by:cmsdiginet
ID: 12371101
I turned off the firewall on XP machine.  That didn't help at all.
0
 
LVL 27

Accepted Solution

by:
Asta Cu earned 1000 total points
ID: 12373631
Microsoft has offered FREE support for Windows XP SP2; here's some info on that, used it and very much helped some problems that couldn't be resolved directly.  

Hopefully Experts here can help you, but it may be worth some time to check out your FREE options here in the event it is an issue that requires escalation to Microsoft for a solution that doesn't yet exist.  I'm not sure how long this will be free, and have used the Tech Chat interface and been happy.  But as always, your call.

http://support.microsoft.com/oas/default.aspx?LN=en-us&gprid=6794&x=16&y=11

Asta
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:cmsdiginet
ID: 12438846
I sent an email to Microsoft Support yesterday, but hasn't got any reply yet.
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 12438888
I use the TECH CHAT option instead because it is immediate.
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 12735850
Thank you, I am happy I could be of some help to you here; although a "C" grade typically means you didn't get what you hoped to achieve, in my humble opinion.  Sorry for the delay in responding, have been ill....  Best wishes, ":0) Asta
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 12763752
Thank you for the Feedback on this issue; I do appreciate it and commented there as well.   Personally speaking, the fact that Microsoft still offers free support for the Windows XP SP2 update, is a win-win scenario from a couple of perspectives.  First, in my humble opinion, the developers for Windows benefit by hearing from the end-users on problems found and roadblocks to the new releases so they can address the issues and rollout fixes in future releases and secondly, we all benefit anytime we can interact with developers to share our problems and workarounds and also get the added benefits on future releases which incorporate these fixes.  Best wishes, ":0) Asta
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question