|
|
|
|||||
|
Difference of ice code in dll or exe?
The same (client side) ice code ,in dll (call by main exe as export function ) or in exe (inline).
The code in main exe can run fine. But the same code in dll ,then be called by main exe ,the vc2003 debuger throw the error? My question is when I put the (client side) ice code in dll ,and call by the main exe program, what should I do? |
|
|||||
|
The DLL part:
void __declspec( dllexport ) getowners(::worm::OwnerSeq &os) { ........................ communicator = Ice::initialize(argc, 0); Ice::ObjectPrx obj = communicator->stringToProxy("localhost:tcp -p 888888:udp -p 888888 mproxy=0; mproxy = localhost::UserHostPrx::uncheckedCast(obj); mproxy->GetServerManager(lockkey,sm); ... sm=::worm::ServerManagerPrx::uncheckedCast(sm); sm->GetAllOwner(os); ........................ } The Main part: void mmdlg::OnBnClickedButton1() { ::worm::OwnerSeq os; getowners(os);//this function in dll part; .... ::worm::OwnerPrx own1; try { own1=::worm::OwnerPrx::checkedCast(os[0]); own1->ice_ping();//error !!!!!!!!!!!!why?? } catch(const IceUtil::Exception& ex) { std::ostringstream ostr; ostr << ex; std::string s = ostr.str(); AfxMessageBox(CString(s.c_str()), MB_OK|MB_ICONEXCLAMATION); } ::worm::StringSeq desc; desc.push_back("HostName"); ::worm::StringSeq info; try { own1->PullString(desc,info);//ice: PullString (stringseq desc,stringseq info); //stringseq==> sequence<string> stringseq; } catch(...) { } AfxMessageBox(_T(info[0].c_str())); .... } If I paste the code in dll to main exe (in function OnBnClickedButton1),the code run fine. why? |
|
|||||
|
the same code (the client side ) could not get the same result in dll and in main exe.
And in the dll ,the vc2003 debuger throw the error ,that the error could not be catch by ice. Could you write the example that the client program call the function (all the ice code ). |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What's the difference between generatecs.exe and slice2cs.exe? | bartley | Help Center | 1 | 08-09-2006 08:37 PM |
| Difference between Console and Service Application? | lkw | Help Center | 7 | 06-24-2006 09:51 PM |
| code contrib | asmirnov | Comments | 1 | 05-31-2006 09:34 AM |
| difference between proxies from class and from interface | kovacm | Help Center | 3 | 05-29-2005 05:57 PM |
| performance difference | zigzag | Bug Reports | 3 | 05-23-2005 10:42 PM |