Solved

Router Programming

Posted on 2001-07-19
2
249 Views
Last Modified: 2013-11-20
Hello All,

I am programming to connect to a router using MPRAPI.lib

Can anybody please help me in debugging this.
I have called the very first function:

CString lpszServerName("Cisco");
BSTR lpwsServerName;
lpwsServerName = lpszServerName.AllocSysString();
MPR_SERVER_HANDLE *phMprServer;
DWORD pRouterConnect;

pRouterConnect = MprAdminServerConnect(                              lpwsServerName,          phMprServer);                                  
On Executing this code I am getting the following error:

(RPCRT4.DLL): 0xC0000005: Access Violation.

Can anybody help me out in solving this, please.

Thanks,
Shobha
0
Comment
Question by:shobha_jk
[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
  • 2
2 Comments
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6297638
what is the signature of MprAdminServerConnect ??

from what you have shown it would be

DWORD MprAdminServerConnect(BSTR,MPR_SERVER_HANDLE *);

however I think it might be

DWORD MprAdminServerConnect(LPCWSTR, MPR_SERVER_HANDLE *);

now the first parameter looke like an [in] and the second looks like an [out] parameter - who is responsible for allocation of the second parameter maybe this is what you should have

MPR_SERVER_HANDLE hMprServer;
CString szServerName("Cisco");
DWORD dwRouterConnect;
USES_CONVERSION;
dwRouterConnect = MprAdminServerConnect(T2W(szServerName), &hMprServer);
                                 
just a guess

0
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 100 total points
ID: 6297642
ah I see it is in the platform SDK and its defined as

DWORD MprAdminServerConnect(LPWSTR, MPR_SERVER_HANDLE *);

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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