Solved

Router Programming

Posted on 2001-07-19
2
248 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 98
Unix / Linux grid computing 5 169
How to determine file rename from EventLog ? 2 58
zeroFront challenge 7 124
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 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