|
The Problem is only with the intialization of WINSOCK.
Sudhir Kumar
|
|
|
|
|
|
Hi,
In my application LoadString works fine for English resource and fails for Japanese resource.
Could some one give me some info regarding this?
Thanks.
|
|
|
|
|
Member 1003415 wrote: ...fails for Japanese resource.
Have you tried calling GetLastError() to find out why?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Have you tried calling GetLastError() to find out why?
Or more easily by adding @err,hr in watch window.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I am getting this LNK6004 compilation error.
i checked the link incrementally in the settings/link
but still the same problem
|
|
|
|
|
Member 1003415 wrote: but still the same problem
Have you done a "rebuild all" since?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi
I know I can use SNMP to get a lot of information from printers. But I'd like to know if I can stop users from printing if the total number of printed pages exceed some value, say 4000.
The printer in use is Xerox Phaser 4510, there are about 50 of them. I've already tried changing configurations by code, using SNMP++ but many printer attributes are read-only (including the one's to set the print host access list).
I'm open to alternatives!
Thanks, Icaro.
|
|
|
|
|
How do I cast(not the C style cast plz) _bstr_t to CString?
|
|
|
|
|
|
Try this code:
_bstr_t bstr(_T("_bstr_t toCString test"));
CString str;
W2A(bstr, str.GetBuffer(256), 256);
strName.ReleaseBuffer();
Sudhir Kumar
|
|
|
|
|
you code is not consistent. W2A() gets only one parameter, which is the string to cast.
also GetBuffer() is in its good use here (rarely goodly used, to it's important to notice it !) but it's not necessary. prefer using the CString::operator=() instead, and don't use W2A() but T2A() if the source is unicode independent (otherwise, it's your _b_str construction which shouldn't use _T())
|
|
|
|
|
|
Have you even tried:
_bstr_t b("This is very hard.");
CString c1 = (LPCTSTR) b;
CString c2 = static_cast<LPCTSTR>(b);
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hey man, no C -style cast plz!
(coz 2 simple, plz plz urgent!)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You can call copy() function of bstr to convert to CString.
eg:-
_bstr_t strTemp = "hi";
CString csTemp = strTemp.copy();
This will work fine.
akt
|
|
|
|
|
Akt_4_U wrote: _bstr_t strTemp = "hi";
CString csTemp = strTemp.copy();
hai, thats a nice bit of coding, but there is small performance issue, let me explain you, _bstr__t::copy will make a copy of underlining BSTR variable and pass it to csTemp, who again make copy of same and destroyed newly created BSTR variable. thought for small string the performance issue would be less, but for big string, this could present problem
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
_bstr_t bstrStart(bstr); <br />
<br />
CString s;<br />
<br />
s.Format(_T("%s"), (LPCTSTR)bstrStart);<br />
<br />
AfxMessageBox(s);
Try this. Hope this will work for u.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Thanks.. I'm using this:
bstr_t bstrStart(bstr);
CString s;
s = static_cast<LPCTSTR>bstrStart;
|
|
|
|
|
SimplySane wrote: How do I cast(not the C style cast plz) _bstr_t to CString?
_bstr_t have overloaded LPCTSTR parameter, you can directly cast your _bstr_t object to CString. without any problem.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hello Friends,
I have the following lines of code. The CRHPostMessageToParent() calls parent to parent class methods.
AfxMessageBox(_T("Page2::Inside TellPArent"));
this->CRHPostMessageToParent(WM_CHANGED_DS, (int)&deptStock);
this->ShowWindow(SW_HIDE);
this->CRHPostMessageToParent(WM_SHOW_NEXT_VIEW, i);
AfxMessageBox(_T("Page2::Finished TellParent"));
These codes start running untill the previous line code is not completed. I want to ensure, that it should proceed to next line only when the first is completed. The CRHPostMessageToParent() calls PostMessage () to parent & returns void. The parent function OnChanged_DS() returns LRESULT.
In Java, this can be achived by assigning each task in thread and synchronizing it, which makes sure that the process is completed & then only the handle is released.
How do I achive the same in VC++6? I hope I have explained my situation to the best. If yet not, ask me.
Thanks
Terry
|
|
|
|
|
Trupti Mehta wrote: How do I achive the same in VC++6?
You can also use synchronization.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You can use MFC sync classes like CMutex,CEvent and CSemaPhore.
Sudhir Kumar
|
|
|
|
|
Does your CRHPostMessageToParent call PostMessage or SendMessage? Using SendMessage means that control does not return until the message has been processed which sounds like what you want.
Judy
|
|
|
|
|
JudyL_FL wrote: Does your CRHPostMessageToParent call PostMessage or SendMessage?
Did you miss:
The CRHPostMessageToParent() calls PostMessage ()...
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|