Solved

Code stops working after installing SP2 on WinXP

Posted on 2004-10-20
8
332 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 500 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

623 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