|
Please, if somebody between you already tried to compile this existing code on this site (see the subject of the message), under
“Microsoft visual studio.NET 2003”,
say me how to make it go because I followed all the indications of the author(bollwerkj) but always the compiler does not manage to find the file “mscoree.lib” (note: I find this file on my hard disk under the way according to " C:\Program Files\Microsoft Visual Studio .NET 2003 \ SDK \ v1.1 \ Lib”! is it good?).excuse me if you see this question is weak, I am initial
|
|
|
|
|
Try asking in the forum attached to that article, rather than here (which isn't the right place to ask Managed C++ questions either)
|
|
|
|
|
How do I get the HINSTANCE of my dialog based application? I want to pass the HINSTANCE value in LoadStringW function as the first parameter.
|
|
|
|
|
Hi,
Try AfxGetInstanceHandle()
-----------
Mila
|
|
|
|
|
Thanks I actually found it. Please see if you can help me with the other question.
|
|
|
|
|
I found it myself. AfxGetInstanceHandle() will get the HINSTANCE of the app. But now LoadStringW(HINSTANCE hInstance, UINT nID, WORD wLanguageID); is returning zero. Why is this function failing? I am passing the correct language ID (1097).
|
|
|
|
|
Aljechin wrote: But now LoadStringW(HINSTANCE hInstance, UINT nID, WORD wLanguageID); is returning zero.
You need to pass value returned by AfxGetResourceHandle as first parameter.
|
|
|
|
|
That also didn't work. Here's what I am doing.
<br />
CString str;<br />
int ret;<br />
ret = str.LoadStringW((HINSTANCE)AfxGetInstanceHandle(),IDS_STRING102,(WORD)1097);<br />
if(ret)<br />
MessageBox(str,L"Welcome",MB_ICONINFORMATION);<br />
else<br />
{<br />
DWORD dwErr= GetLastError();<br />
}
GetLastError is returning 1815. But i can't find such an error in msdn. Why is this resource loading failing? IDS_STRING102 is an entry in a string table resource. It has the unicode value that must be loaded. If i directly use the unicode string in c++ file, it gets loaded.
|
|
|
|
|
dear, dear.
I mentioned AfxGetResourceHandle in my previous post.
Update you code like this,
CString str;
int ret;
ret = str.LoadStringW((HINSTANCE)AfxGetResourceHandle(),IDS_STRING102,(WORD)1097);
if(ret)
MessageBox(str,L"Welcome",MB_ICONINFORMATION);
else
{
DWORD dwErr= GetLastError();
}
And dont know why I was voted 1 for my previous post.
|
|
|
|
|
prasad_som wrote: AfxGetResourceHandle
Yes, in my previous post I told that also didn't work. Actually I edited it two minutes after posting. What could be the problem?
|
|
|
|
|
Aljechin wrote: GetLastError is returning 1815
This error code states,
"The specified resource language ID cannot be found in the image file."
See if you are going wrong there.
|
|
|
|
|
Actually this is the first time I am using Unicode in a string table. It works fine with non unicode strings. There is no error. Is there some special setting that I need to do in that string table or my project for loading the string successfully in runtime? I thank you very much for your time.
|
|
|
|
|
I'm not sure. How you are sending last parameter ? i.e. language Id.
From error it seems, its not defined in resource file.
Is it different from English ? If yes, is it defined in .rc?
|
|
|
|
|
prasad_som wrote: How you are sending last parameter ? i.e. language Id.
ret = str.LoadStringW((HINSTANCE)AfxGetInstanceHandle(),IDS_STRING102,(WORD)1097);<br />
It is unicode and of course different from english. I don't know if its defined in .rc file. How do I do that?
|
|
|
|
|
prasad_som wrote: How you are sending last parameter ? i.e. language Id.
<br />
ret = str.LoadStringW((HINSTANCE)AfxGetInstanceHandle(),IDS_STRING102,(WORD)1097);<br />
It's of course not english. I don't know if its defined in .rc. How do I do that?
|
|
|
|
|
Are you sure a stringtable entry exists for id "IDS_STRING102" in the language section "1097"?
The error indicates it doesn't exist.
|
|
|
|
|
Mark Salsbery wrote: in the language section "1097"?
I think I need to check out that. What is the language section? the string IDS_STRING102 does exist in stringtable and the value of that is a unicode string. If i put a non unicode string, it gets loaded.
|
|
|
|
|
The STRINGTABLE resource has a LANGUAGE option but apparently tha's not the problem if it
works for a non-unicode string table entry.
|
|
|
|
|
Hi
I m writing a client server program. in that i recevice some data from client, and that may be too large some times, so i have a MSG SIZE field in my message. so if i receive less number of bytes than MSG SIZE icall receive again assuming there will be some data to receive.
But when i call recv function i dont if i would get the remainig data or the whole data including the last received data.
What is the exact behaviour of recv() in receiving fragmented messages.
please reply ASAP. thank you
bye
P.Somasundaram
|
|
|
|
|
you can see the socket as a FIFO. what recv() as returned you is definitely extracted from the queue.
|
|
|
|
|
hi toxcct,
so you mean, say if i had received 256 bytes in recv() and if the MSG SIZE is 1600, then the second call will receive the remianing 1344 bytes isnt it.
but i tried uppending the first received message to the second received message but the format was not correct. i dont think it does so.
|
|
|
|
|
|
thank you
i will read and come back
bye
|
|
|
|
|
I have 2 CEdit - m_edit1,m_edit2.
CString sRezult;
m_edit1.GetWindowText(sRezult);
if(sRezult == "20")
{
m_edit2.SetWindowText("World");
break;
}
But i want this to work if i enter 200 or 2000 or 2006!
How?
Bravoone
|
|
|
|
|
Hi,
you can change
if(sRezult == "20")
to
if( sRezult.Left(2).Compare( "20" ) == 0 )
-----------
Mila
|
|
|
|