|
Hi, everyone!
Suppose I have a istream and I want to read an
integer from a istream. If the length is 0 and
I think the stream is correpted and I won't like
any other operations on the stream later. So I
think I can set the state of the stream. The following
is my sample code. I want to know whether my solution
is correct? Are there some other things to consider?
Source codes:
--------
int data;
/** return value is used to indicate whether the return
value is correct.
*/
bool A::Read (std::istream& is)
{
is.exceptions(ios::failbit|ios::eofbit);
try {
is.read ((char*)&data, sizeof (data));
if (!data) {
is.setstate (ios::failbit);
return false;
}
} catch (ios::failure e)
{
return false;
}
return true;
}
--------
Thanks in advance,
George
|
|
|
|
|
Can someone suggest a method to accomplish writing to a file and at that moment another program would read that same data for its use.
The program is writing a line of floats to just generate data while the other program needs to read and process it.
Using two seperate executables and an ascii file led to apparent file locking issues.
Thanks for any suggestions.
Ken
|
|
|
|
|
A file isn't the most reliable way to transfer data between apps. From your description, a socket would be a better way.
And in any event, you'd still need some IPC to let the second app know that there's data to be read
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
You can do this with a memory mapped file and a named event. Create a named event and open it in both applications. Set it in one thread to signal that the other can read the data. When the data is read reset the event.
http://www.codeproject.com/win32/cmemmap.asp[^]
John
|
|
|
|
|
Thanks for the comments and links.
Ken
|
|
|
|
|
Use an “event” — a synchronization object that allows one thread to notify another that an event has occurred. Events are useful when a thread needs to know when to perform its task. For example, a thread that copies data to a data archive would need to be notified when new data is available. Look for CreateEvent(), SetEvent(), WaitForSingleObject(), etc.
|
|
|
|
|
Hiya when I use these Win32 functions for the registry:
#define REGKEY_SOFTWARE "Pass1"
#define REGKEY_DIRECTORY_PATH "Software\\Projects\\Password"
rc = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
REGKEY_DIRECTORY_PATH,
0,
KEY_QUERY_VALUE | KEY_SET_VALUE,
&hKeyParent );
and then this:
rc = RegSetValueEx( hKeyParent,
_T("Project Password"),
0, REG_SZ,
(const unsigned char *)(REGKEY_SOFTWARE),
sizeof( REGKEY_SOFTWARE) );
it is fine. It inserts my key into the registry no problem. But when I swop RegOpenKeyEx for:
CRegKey *pRegKey;
pRegKey = new CRegKey;
rc = pRegKey->Open( hKeyParent,
REGKEY_DIRECTORY_PATH,
KEY_READ | KEY_WRITE );
it doesn't put my key in. What am I doing wrong with this function??
I have error checking on Open and it returns no errors..
Thanks,
grahamoj.
|
|
|
|
|
You must follow the pRegKey->Open() call with a call to either pRegKey->SetKeyValue() or pRegKey->SetValue().
Why are you using a CRegKey pointer? Just declare it on the stack. Allocating little bits of memory like this is unnecessarily wasteful. Use new only when you have a compelling reason to do so.
|
|
|
|
|
How can you make a CView window appear OUTSIDE the CFrame (CMainFrame?).
The goal is to create a CMainFrame with multiple different CView classes that appear floating on the desktop that all attach to the same CDoc.
- Jeff Sidlosky
jsidlosky@yahoo.com
|
|
|
|
|
So you basically want a whole separate window. One solution is to call the view class Create(). Try with the different window properties.
Kuphryn
|
|
|
|
|
I have my own database server application that optionally runs as service. I need it to restart (or reinitialize in some other way) as the configuration files change. On initialization, I create and store the notification handle by calling FindFirstChangeNotification .
Where is the best place to put the wait function (WaitForSingleObject )?
Regards,
BB
|
|
|
|
|
Bartosz Bien wrote:
Where is the best place to put the wait function (WaitForSingleObject)?
In a separate thread...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi there.
Here's a pretty simple program:
void main(void) {
HRESULT hr = URLDownloadToFile(NULL, "http://www.google.com", "c:\\output.htm", 0, NULL) ;
if (SUCCEEDED(hr)) {
printf("success\n") ;
}
else {
printf("failed\n") ;
}
}
For some reason the URLDownloadToFile call fails. If I put any of a host of other urls in the call the download works perfectly, however, for www.google.com and several other pages (www.yahoo.es for one) the function just refuses to work. I'm completely baffled by this. I can't find any commonality between the pages that fail and I know that www.google.com does indeed exist on the internet.
Has anyone else had problems using the URLDownloadToFile function?
Thanks
|
|
|
|
|
It would help to know the error returned by URLDownloadToFile() . One possibility is that the server doesn't allow downloads without a proper HTTP_REFERER header, which is not present when using that API.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
I experimented with this method and got the same problem for google and a few other sites. The error code is 0x800401e4 which translates to "Invalid syntax"????
Art
|
|
|
|
|
That's right, 0x800401e4 is MK_E_SYNTAX. MSDN describes this error for a different URL Moniker function (they don't even list it as a return value for URLDownloadToFile) and it says:
A moniker could not be created because szURL does not correspond to valid URL syntax for a full or partial URL. This is uncommon, because most parsing of the URL occurs during binding and because the syntax for URLs is extremely flexible.
So what's going on? I can't believe that I just can't use URLDownloadToFile at all in my application because it just doesn't download certain pages...
Also I don't think the problem has to do with a bad header to www.google.com because I can get a response from the google server via telnet by just sending a request line and a "Host" header... They don't seem strangely picky about requiring headers.
|
|
|
|
|
I don't know what is wrong but I tried to get the data using the Internet API functions:
InternetOpen(..)
InternetOpenUrl(..)
InternetReadFile(..)
and it works fine for Google and all the other sites I tried. I suggest you go that route.
Art
|
|
|
|
|
Is there any way to use the "Run As Other User" dialog box from my project with out having to create my own?
I have been searching the net and MSDN. Although, I have found tones of imformation, there does not seem to be a function (undocumented or otherwise) to "Run As Other User".
Sugestions, books, etc... will be appriciated.
Trust in the code Luke. Yea right!
|
|
|
|
|
Hello,
I am using an activex control in my vc++ application and I would like to have the equivalent of an control array in vb. I tried to map the events using ON_EVENT_RANGE and adding a 1st parameter
on every event function as an index in the array. I declared the array as an array of pointers to the activex objects.
But it doesn't work.
So, can this be done? Am I doing something wrong?
|
|
|
|
|
how can i put a binary data chunk in to XML node using MSXML
I've seen some suggestions of converting it to a hex representation.
Any suggestions or examples
|
|
|
|
|
If you were to do it in C#. it is in this URL
Link here
I guess you could check the XML content once you made the method invoked.
|
|
|
|
|
Below is snippet of my compile output for my application. As you can see, I am having linking problems. Any suggestions?
PS - I apologize for this message being a little long, but figured it would be better to post the whole compile errors for all gurus.
Linking...
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Q
BEPBDXZ) already defined in log4cplusD.lib(category.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >(void)" (??1?$basic_strin
g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in log4cplusD.lib(category.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::operator+=(c
lass std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in log4cplusD.lib(category.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::operator+=(c
har const *)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in log4cplusD.lib(threads.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >(char const *,class basic_
string<char,struct std::char_traits<char="">,class std::allocator<char> >::allocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z) already defined in log4cplusD.lib(category.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "bool __cdecl std::operator==(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &,char const *)" (??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocat
or@D@2@@0@PBD@Z) already defined in log4cplusD.lib(priority.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >(class basic_string<char,s
truct std::char_traits<char="">,class std::allocator<char> >::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in log4c
plusD.lib(category.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::operator=(cl
ass std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in log4cplusD.lib(layout.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::assign(class
std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &,unsigned int,unsigned int)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z) already defined in log4cplusD.lib(categ
ory.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::length(void)const " (?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@
@QBEIXZ) already defined in log4cplusD.lib(priority.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >(class basic_string<char,s
truct std::char_traits<char="">,class std::allocator<char> >::allocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) already defined in log4cplusD.lib(layout.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: bool __thiscall std::ios_base::fail(void)const " (?fail@ios_base@std@@QBE_NXZ) already defined in log4cplusD.lib(layout.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE
IXZ) already defined in log4cplusD.lib(category.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::runtime_error::runtime_error(class runtime_error::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)" (??0runtime_error@std@@QAE@ABV?$basic_strin
g@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z) already defined in log4cplusD.lib(pointer.obj)
libcpmtd.lib(iostream.obj) : error LNK2005: "public: __thiscall std::ios_base::Init::Init(void)" (??0Init@ios_base@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(iostream.obj) : error LNK2005: "public: __thiscall std::ios_base::Init::~Init(void)" (??1Init@ios_base@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int,bool)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I_N@Z) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "public: bool __thiscall std::locale::_Iscloc(void)const " (?_Iscloc@locale@std@@QBE_NXZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(ios.obj) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(ios.obj) : error LNK2005: "public: virtual __thiscall std::ios_base::~ios_base(void)" (??1ios_base@std@@UAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(ios.obj) : error LNK2005: "protected: void __thiscall std::ios_base::_Addstd(void)" (?_Addstd@ios_base@std@@IAEXXZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(ios.obj) : error LNK2005: "protected: void __thiscall std::ios_base::_Init(void)" (?_Init@ios_base@std@@IAEXXZ) already defined in msvcprtd.lib(MSVCP60D.dll)
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(dbgheap.obj) : error LNK2005: __malloc_dbg already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(dbgheap.obj) : error LNK2005: __free_dbg already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@
@QBEPBDXZ) already defined in log4cplusD.lib(category.obj); second definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >(void)" (??1?$basic_str
ing@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in log4cplusD.lib(category.obj); second definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::operator+=
(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in log4cplusD.lib(category.obj); second definition
ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::operator+=
(char const *)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in log4cplusD.lib(threads.obj); second definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >(char const *,class basi
c_string<char,struct std::char_traits<char="">,class std::allocator<char> >::allocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z) already defined in log4cplusD.lib(category.obj); secon
d definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "bool __cdecl std::operator==(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &,char const *)" (??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$alloc
ator@D@2@@0@PBD@Z) already defined in log4cplusD.lib(priority.obj); second definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >(class basic_string<char
,struct std::char_traits<char="">,class std::allocator<char> >::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in log
4cplusD.lib(category.obj); second definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::operator=(
class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in log4cplusD.lib(layout.obj); second definition ig
nored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::assign(cla
ss std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &,unsigned int,unsigned int)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z) already defined in log4cplusD.lib(cat
egory.obj); second definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::length(void)const " (?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@st
d@@QBEIXZ) already defined in log4cplusD.lib(priority.obj); second definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >(class basic_string<char
,struct std::char_traits<char="">,class std::allocator<char> >::allocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) already defined in log4cplusD.lib(layout.obj); second definition ignor
ed
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: bool __thiscall std::ios_base::fail(void)const " (?fail@ios_base@std@@QBE_NXZ) already defined in log4cplusD.lib(layout.obj); second definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Q
BEIXZ) already defined in log4cplusD.lib(category.obj); second definition ignored
msvcprtd.lib(MSVCP60D.dll) : warning LNK4006: "public: __thiscall std::runtime_error::runtime_error(class runtime_error::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)" (??0runtime_error@std@@QAE@ABV?$basic_str
ing@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z) already defined in log4cplusD.lib(pointer.obj); second definition ignored
libcpmtd.lib(iostream.obj) : warning LNK4006: "public: __thiscall std::ios_base::Init::Init(void)" (??0Init@ios_base@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll); second definition ignored
libcpmtd.lib(iostream.obj) : warning LNK4006: "public: __thiscall std::ios_base::Init::~Init(void)" (??1Init@ios_base@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll); second definition ignored
libcpmtd.lib(locale0.obj) : warning LNK4006: "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int,bool)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I_N@Z) already defined in msvcprtd.lib(MSVCP60D.dll); second de
finition ignored
libcpmtd.lib(locale0.obj) : warning LNK4006: "public: bool __thiscall std::locale::_Iscloc(void)const " (?_Iscloc@locale@std@@QBE_NXZ) already defined in msvcprtd.lib(MSVCP60D.dll); second definition ignored
libcpmtd.lib(locale0.obj) : warning LNK4006: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprtd.lib(MSVCP60D.dll); second definition ignored
libcpmtd.lib(ios.obj) : warning LNK4006: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in msvcprtd.lib(MSVCP60D.dll); second definition ignored
libcpmtd.lib(ios.obj) : warning LNK4006: "public: virtual __thiscall std::ios_base::~ios_base(void)" (??1ios_base@std@@UAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll); second definition ignored
libcpmtd.lib(ios.obj) : warning LNK4006: "protected: void __thiscall std::ios_base::_Addstd(void)" (?_Addstd@ios_base@std@@IAEXXZ) already defined in msvcprtd.lib(MSVCP60D.dll); second definition ignored
libcpmtd.lib(ios.obj) : warning LNK4006: "protected: void __thiscall std::ios_base::_Init(void)" (?_Init@ios_base@std@@IAEXXZ) already defined in msvcprtd.lib(MSVCP60D.dll); second definition ignored
LIBCMTD.lib(dbgheap.obj) : warning LNK4006: _malloc already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMTD.lib(dbgheap.obj) : warning LNK4006: __malloc_dbg already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMTD.lib(dbgheap.obj) : warning LNK4006: _free already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMTD.lib(dbgheap.obj) : warning LNK4006: __free_dbg already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMTD.lib(crt0dat.obj) : warning LNK4006: _exit already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMTD.lib(fflush.obj) : warning LNK4006: _fflush already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMTD.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCMTD.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCMTD.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCMTD.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
Creating library ../../../../lib/libSharedNetConnectionManagerD.lib and object ../../../../lib/libSharedNetConnectionManagerD.exp
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCMTD" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCMTD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
../../../../Debug/bin/libSharedNetConnectionManager.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
|
|
|
|
|
looks like the lib and the app are using different C runtime libraries. look at Project / Settings / General / Microsoft Foundation Classes for both projects - make sure they are the same.
-c
|
|
|
|
|
File and directory names are Unicode strings and many (most) non-MS apps don't handle them properly.
The Unicode version of openfile dialog can handle 32K characters for a path name while the ANSI version does ~260. This is a good reason alone to always use the Unicode version. Another is if someone uses a non-European language for a directory name.
My question is how can this be done and still have the app work on Win98/ME ?
If an MFC app is built with the Unicode setting on, does one need to install the "Unicode layer" dll's onto a Win98/ME machine?
I thought that I checked and MFC, even when set to Unicode, still limits paths to MAX_PATH. Is there a standard solution?
Is there any advantage in making just the file handling portion of the code wide character?
|
|
|
|
|
search MSDN for "Microsoft Layer for Unicode".
you need this to be able to use UNICODE on win98 and Me.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|