Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 04-08-2008
leo leo is offline
Registered User
 
Name: leo wang
Organization: SuperMap.inc
Project: DGIS
 
Join Date: Mar 2008
Posts: 23
how to use ICE in VC6.0??

always occur "Only multi-threaded DLL libraries can be used with Ice" error ??

I builded an ATL com project and have added include path/lib path(ice3.2.1 for VC6.0 had installed)

What I have done something wrong?
Reply With Quote
  #2 (permalink)  
Old 04-08-2008
benoit's Avatar
benoit benoit is online now
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,542
Hi,

It looks like you're using the wrong compiler settings to compile your application (most likely /ML or /MLd). You need to use the /MD or /MDd compiler option to compile Ice applications, see here for more information on these options.

Cheers,
Benoit.
Reply With Quote
  #3 (permalink)  
Old 04-08-2008
leo leo is offline
Registered User
 
Name: leo wang
Organization: SuperMap.inc
Project: DGIS
 
Join Date: Mar 2008
Posts: 23
have resolved
Reply With Quote
  #4 (permalink)  
Old 04-08-2008
leo leo is offline
Registered User
 
Name: leo wang
Organization: SuperMap.inc
Project: DGIS
 
Join Date: Mar 2008
Posts: 23
thanks for replying
but occur new problem...

d:\ice-3.2.1-vc60\include\stlport\stl\debug\_vector.h(277) : error C2953: 'vector' : template class has already been defined


how can I use "MS STL" and stlport lib at the same time( in ATL com project)?
Reply With Quote
  #5 (permalink)  
Old 04-08-2008
leo leo is offline
Registered User
 
Name: leo wang
Organization: SuperMap.inc
Project: DGIS
 
Join Date: Mar 2008
Posts: 23
d:\ice-3.2.1-vc60\include\stlport\stl\debug\_debug.h(166) : warning C4005: '_STLP_DEBUG_CHECK' : macro redefinition
d:\ice-3.2.1-vc60\include\stlport\stl\_config.h(375) : see previous definition of '_STLP_DEBUG_CHECK'
d:\ice-3.2.1-vc60\include\stlport\stl\debug\_debug.h(167) : warning C4005: '_STLP_DEBUG_DO' : macro redefinition
d:\ice-3.2.1-vc60\include\stlport\stl\_config.h(376) : see previous definition of '_STLP_DEBUG_DO'
d:\ice-3.2.1-vc60\include\stlport\stl\debug\_vector.h(277) : error C2953: 'vector' : template class has already been defined
d:\ice-3.2.1-vc60\include\stlport\stl\debug\_vector.h(277) : see declaration of 'vector'
d:\ice-3.2.1-vc60\include\ice\proxy.h(492) : error C2027: use of undefined type 'Object'
d:\ice-3.2.1-vc60\include\ice\objectf.h(19) : see declaration of 'Object'
d:\ice-3.2.1-vc60\include\ice\proxy.h(492) : error C2039: 'ice_facet' : is not a member of 'ProxyHandle<class Ice::Object>'
d:\ice-3.2.1-vc60\include\ice\localexception.h(601) : error C2079: 'badMagic' uses undefined class 'vector<unsigned char,class _STL::allocator<unsigned char> >'
Error executing cl.exe.
Reply With Quote
  #6 (permalink)  
Old 04-08-2008
benoit's Avatar
benoit benoit is online now
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,542
Hi,

You need to move the stlport include directory to the top of the list of includes directories in the Visual Studio options (in the IDE, choose Tools->Options->Directories and select "Include files"). This is necessary so that the compiler uses the STL headers from the STLport library instead of the Visual C++ STL library.

You might also want to check the settings of the demo/Ice/MFC projects, it might help for your ATL project.

Cheers,
Benoit.
Reply With Quote
  #7 (permalink)  
Old 04-08-2008
leo leo is offline
Registered User
 
Name: leo wang
Organization: SuperMap.inc
Project: DGIS
 
Join Date: Mar 2008
Posts: 23
have resolved,thanks for your help
Reply With Quote
  #8 (permalink)  
Old 04-14-2008
leo leo is offline
Registered User
 
Name: leo wang
Organization: SuperMap.inc
Project: DGIS
 
Join Date: Mar 2008
Posts: 23
new problem
.................................................. .................................
ice file

module UVSPClient
{
struct USERINFO
{
string realname;
string account;
string nickname;
string UUID;
};
interface ClickObject
{
nonmutating bool isClicked();
nonmutating USERINFO getUserInfo();
bool isExist(string Account);
bool register(UVSP::Platform::RegisterInfo RegInfo);
int Validate(string Account,string Pwd);
};
};

.................................................. ................................
ValidateClient.h

// ValidateClient.h: interface for the CValidateClient class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_VALIDATECLIENT_H__980078BD_40E6_4661_ AEF8_327A3702476A__INCLUDED_)
#define AFX_VALIDATECLIENT_H__980078BD_40E6_4661_AEF8_327A 3702476A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CValidateClient : public UVSPClient::ClickObject
{

public:
CValidateClient();
virtual ~CValidateClient();
public:
static CValidateClient* getValidateClient();

virtual bool isClicked(const ::Ice::Current* current);

virtual ::UVSPClient::USERINFO getUserInfo(const ::Ice::Current* current);

virtual bool isExist(const ::std::string& Account, const ::Ice::Current* current);

virtual bool _cpp_register(const ::UVSP::Platform::RegisterInfo& RegInfo, const ::Ice::Current* current);

virtual ::Ice::Int Validate(const ::std::string& Account, const ::std::string& pwd, const ::Ice::Current* current);


private:
static CValidateClient* _pthis;
};

#endif // !defined(AFX_VALIDATECLIENT_H__980078BD_40E6_4661_ AEF8_327A3702476A__INCLUDED_)

.................................................. ........................................
.cpp

// ValidateClient.cpp: implementation of the CValidateClient class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ValidateClient.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CValidateClient* CValidateClient::_pthis = NULL;

CValidateClient::CValidateClient()
{

}

CValidateClient::~CValidateClient()
{

}

CValidateClient* CValidateClient::getValidateClient()
{
if(_pthis == NULL)
// _pthis = new CValidateClient();

return _pthis;
}

bool CValidateClient::isClicked(const ::Ice::Current* current)
{
return true;
}
UVSPClient::USERINFO CValidateClient::getUserInfo(const ::Ice::Current* current)
{
UVSPClient::USERINFO ui;
return ui;
}
bool CValidateClient::isExist(const ::std::string& Account, const ::Ice::Current* current)
{
return true;
}
bool CValidateClient::_cpp_register(const ::UVSP::Platform::RegisterInfo& RegInfo, const ::Ice::Current* current)
{
return true;
}
Ice::Int CValidateClient::Validate(const ::std::string& Account, const ::std::string& pwd, const ::Ice::Current* current)
{
return 0;
}

.............................................

Compiling...
ValidateClient.cpp
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : error C2259: 'CValidateClient' : cannot instantiate abstract class due to following members:
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.h(12) : see declaration of 'CValidateClient'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isClicked(const struct Ice::Current &) const' : pure virtual function was not defined
.\ice cpp file\UVSPClickObjectC.h(325) : see declaration of 'isClicked'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'struct UVSPClient::USERINFO __thiscall UVSPClient::ClickObject::getUserInfo(const struct Ice::Current &) const' : pure virtual function wa
s not defined
.\ice cpp file\UVSPClickObjectC.h(328) : see declaration of 'getUserInfo'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isExist(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<c
har> > &,const struct Ice::Current &)' : pure virtual function was not defined
.\ice cpp file\UVSPClickObjectC.h(331) : see declaration of 'isExist'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::_cpp_register(const struct UVSP::Platform::RegisterInfo &,const struct Ice::Current &)' : pure vi
rtual function was not defined
.\ice cpp file\UVSPClickObjectC.h(334) : see declaration of '_cpp_register'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'int __thiscall UVSPClient::ClickObject::Validate(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<c
har> > &,const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > &,const struct Ice::Current &)' : pure virtual function was not defined
.\ice cpp file\UVSPClickObjectC.h(337) : see declaration of 'Validate'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : error C2259: 'CValidateClient' : cannot instantiate abstract class due to following members:
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.h(12) : see declaration of 'CValidateClient'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isClicked(const struct Ice::Current &) const' : pure virtual function was not defined
.\ice cpp file\UVSPClickObjectC.h(325) : see declaration of 'isClicked'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'struct UVSPClient::USERINFO __thiscall UVSPClient::ClickObject::getUserInfo(const struct Ice::Current &) const' : pure virtual function wa
s not defined
.\ice cpp file\UVSPClickObjectC.h(328) : see declaration of 'getUserInfo'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isExist(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<c
har> > &,const struct Ice::Current &)' : pure virtual function was not defined
.\ice cpp file\UVSPClickObjectC.h(331) : see declaration of 'isExist'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::_cpp_register(const struct UVSP::Platform::RegisterInfo &,const struct Ice::Current &)' : pure vi
rtual function was not defined
.\ice cpp file\UVSPClickObjectC.h(334) : see declaration of '_cpp_register'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'int __thiscall UVSPClient::ClickObject::Validate(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<c
har> > &,const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > &,const struct Ice::Current &)' : pure virtual function was not defined
.\ice cpp file\UVSPClickObjectC.h(337) : see declaration of 'Validate'
Error executing cl.exe.

UVSP CLib.dll - 2 error(s), 10 warning(s)



.................................................. .
what 's wrong???
Reply With Quote
  #9 (permalink)  
Old 04-14-2008
benoit's Avatar
benoit benoit is online now
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,542
Hi,

Check the declaration of the methods in UVSPClickObjectC.h, you'll see that they don't match the declaration of the methods in your class defined in ValidateClient.h. Specifically, const ::Ice::Current* current should be const ::Ice::Current& current.

Cheers,
Benoit.
Reply With Quote
  #10 (permalink)  
Old 04-14-2008
leo leo is offline
Registered User
 
Name: leo wang
Organization: SuperMap.inc
Project: DGIS
 
Join Date: Mar 2008
Posts: 23
I have corrected from "const Ice::Current*" to "const Ice::Current&",but the problem also exist!
.................................................. ...............
ice file

module UVSPClient
{
struct USERINFO
{
string realname;
string account;
string nickname;
string UUID;
};
interface ClickObject
{
nonmutating bool isClicked();
nonmutating USERINFO getUserInfo();
bool isExist(string Account);
bool Register(UVSP::Platform::RegisterInfo RegInfo);
int Validate(string Account,string Pwd);
};
};

.................................................. ..............
.h file

// ValidateClient.h: interface for the CValidateClient class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_VALIDATECLIENT_H__980078BD_40E6_4661_ AEF8_327A3702476A__INCLUDED_)
#define AFX_VALIDATECLIENT_H__980078BD_40E6_4661_AEF8_327A 3702476A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CValidateClient : public UVSPClient::ClickObject
{

public:
CValidateClient();
virtual ~CValidateClient();
public:
static CValidateClient* getValidateClient();

public:
virtual bool isClicked(const ::Ice::Current& current);

virtual ::UVSPClient::USERINFO getUserInfo(const ::Ice::Current& current);

virtual bool isExist(const ::std::string& Account, const ::Ice::Current& current);

virtual bool Register(const ::UVSP::Platform::RegisterInfo& RegInfo, const ::Ice::Current& current);

virtual ::Ice::Int Validate(const ::std::string& Account, const ::std::string& pwd, const ::Ice::Current& current);


private:
static CValidateClient* _pthis;
};

#endif // !defined(AFX_VALIDATECLIENT_H__980078BD_40E6_4661_ AEF8_327A3702476A__INCLUDED_)

.................................................. ..................
.cpp file

// ValidateClient.cpp: implementation of the CValidateClient class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ValidateClient.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CValidateClient* CValidateClient::_pthis = NULL;

CValidateClient::CValidateClient()
{

}

CValidateClient::~CValidateClient()
{

}

CValidateClient* CValidateClient::getValidateClient()
{
if(_pthis == NULL)
_pthis = new CValidateClient();

return _pthis;
}

bool CValidateClient::isClicked(const ::Ice::Current& current)
{
return true;
}
UVSPClient::USERINFO CValidateClient::getUserInfo(const ::Ice::Current& current)
{
UVSPClient::USERINFO ui;
return ui;
}
bool CValidateClient::isExist(const ::std::string& Account, const ::Ice::Current& current)
{
return true;
}
bool CValidateClient::Register(const ::UVSP::Platform::RegisterInfo& RegInfo, const ::Ice::Current& current)
{
return true;
}
Ice::Int CValidateClient::Validate(const ::std::string& Account, const ::std::string& pwd, const ::Ice::Current& current)
{
return 0;
}

.................................................. .....................
Compiling...
ValidateClient.cpp
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : error C2259: 'CValidateClient' : cannot instantiate abstract class due to following members:
e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\validateclient.h(12) : see declaration of 'CValidateClient'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isClicked(const struct Ice::Current &) const' : pure virtual function was not defined
e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\ice cpp file\uvspclickobjectc.h(325) : see declaration of 'isClicked'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'struct UVSPClient::USERINFO __thiscall UVSPClient::ClickObject::getUserInfo(const struct Ice::Current &) const' : pure virtual function wa
s not defined
e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\ice cpp file\uvspclickobjectc.h(328) : see declaration of 'getUserInfo'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : error C2259: 'CValidateClient' : cannot instantiate abstract class due to following members:
e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\validateclient.h(12) : see declaration of 'CValidateClient'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isClicked(const struct Ice::Current &) const' : pure virtual function was not defined
e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\ice cpp file\uvspclickobjectc.h(325) : see declaration of 'isClicked'
E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'struct UVSPClient::USERINFO __thiscall UVSPClient::ClickObject::getUserInfo(const struct Ice::Current &) const' : pure virtual function wa
s not defined
e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\ice cpp file\uvspclickobjectc.h(328) : see declaration of 'getUserInfo'
Error executing cl.exe.

UVSP CLib.dll - 2 error(s), 4 warning(s)


??????????????????????????????????
what 's wrong?
Reply With Quote
  #11 (permalink)  
Old 04-14-2008
benoit's Avatar
benoit benoit is online now
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,542
The declaration of your methods doesn't match the one from UVSPClient::ClickObject defined in the uvspclickobjectc.h header. You should open this header file and check the lines given by the compiler to see the expected declaration (line 325 and 328).

Most likely, the problem is caused by a missing "const" at the end of the method declaration since you've declared the methods as "nonmutating".

Btw, you shouldn't use the "nonmutating" keyword: it has been deprecated. Instead you should use "idempotent" and ["cpp:const"], for example:

Code:
// Slice
["cpp:const"] idempotent bool isClicked();
Cheers,
Benoit.
Reply With Quote
  #12 (permalink)  
Old 04-14-2008
leo leo is offline
Registered User
 
Name: leo wang
Organization: SuperMap.inc
Project: DGIS
 
Join Date: Mar 2008
Posts: 23
heve resolved,
thank you very much for help!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ice client coredump on VC6.0 richardma Help Center 2 02-22-2006 08:58 PM
how can i compile ice file in vc6 IDE ? memorialday Help Center 2 11-22-2005 08:05 AM
error when use ice 2.1 and vc6.0 ralf3 Help Center 3 03-18-2005 09:18 AM
Problem when use ice 2.1 and ace on vc6.0! help! ralf3 Help Center 9 03-17-2005 11:51 PM
Strange compilation error with VC6 / Ice 1.4.0 annekat Help Center 3 07-05-2004 02:15 PM


All times are GMT -4. The time now is 11:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.