[omniORB] More MFC Fun
ryan.tecco
rtecco@voxel.ummu.umich.edu
Mon, 14 Jun 1999 17:45:12 -0400 (EDT)
All right, here goes. I have an MFC app. Included below are the classes
that I am using to get CORBA into the application. In trying to call a
remote method, I get a 'Unhandled exception in KERNEL32.DLL'. Using the
debugger, I traced into the program and got it crashing out at a call to
OmniProxyCallWrapper::invoke(this, _call_desc);
Any ideas? My server implementation is running on Irix 6.5.
Here is my client classes:
Client::Client()
{
int argc = 0;
orb = CORBA::ORB_init(argc,NULL,"omniORB2");
boa = orb->BOA_init(argc,NULL,"omniORB2_BOA");
///open local file "iiop.txt" for the IOR
ifstream inFile("iiop.txt", ios::in);
IOR = " ";
inFile >> IOR;
if(IOR == " "){
cerr << "Make sure that 'iiop.txt' from the remote machine is in
the local directory." << endl;
//exit(1);
}
try{
remObj = orb->string_to_object(IOR.c_str());
}
catch(CORBA::COMM_FAILURE& ex){
cerr << "Caught system exception COMM_FAILURE, unable to
contact the "
<< "object." << endl;
}
catch(omniORB::fatalException& ex){
cerr << "Caught omniORB2 fatalException. This indicates a bug is
caught "
<< "within omniORB2.\nPlease send a bug report.\n"
<< "The exception was thrown in file: " << ex.file() << "\n"
<< " line: " << ex.line() << "\n"
<< "The error message is: " << ex.errmsg() << endl;
}
catch(...){
cerr << "Caught a system exception." << endl;
}
}
Client::~Client()
{
CORBA::BOA::getBOA()->impl_shutdown();
}
void Client::sendRequest(AppRequest req)
{
AppLaunchObj_var temp = AppLaunchObj::_narrow(remObj);
if (CORBA::is_nil(temp)) {
cerr << "Cannot call remote method with a nil reference." << endl;
return;
}
temp->launch(req);
return;
}
#ifndef CLIENT
#define CLIENT
#include "AppLaunchObj.h"
#include <fstream>
#include <iostream>
#include <string.h>
#include <string>
using namespace std;
class Client
{
public:
Client();
~Client();
void sendRequest(AppRequest req);
///CLIENT PUBLIC MEMBER FUNCTIONS HERE
private:
CORBA::ORB_ptr orb;
CORBA::BOA_ptr boa;
std::string IOR;
CORBA::Object_var remObj;
///CLIENT PRIVATE MEMBERS HERE
};
#endif
Thanks for any help in advance.
rt
--------------
ryan.tecco
734.476.6646
the university of michigan
"i'll never forget my life
as a carrot."