|
If your are specifically looking for .NET stuff (i.e. managed extensions) I have no idea. For learning visual studio and MFC I'd recommend:
-Practical Visual Studio C++ 6.0, Bates & Tompkins, ISBN 0-7897-2142-2
deals with an older version of visual studio, but it's a very good introduction
-Visual C++ .NET bible, Archer & Whitechapel, ISBN 0-7645-4837-9
mostly MFC related, but under the VS.Net enviroment. Bit in at the deep end compared to
the book above, but written for the right version of VS
Have fun!
Cheers,
Mark
|
|
|
|
|
Ok, i can easily write _T("Charge Control Valve") to make a Unicode string out of my ASCII string at compile time.
But _T("チャージコントロール") in the same source file doesn't work. I can't even write or paste it into my source file.
The only idea i have is
WCHAR myString[] = {0x1234, ... , 0x0000 };
Another question, can i avoid LoadString and get a pointer to the strings in the stringtable?
Thanks
|
|
|
|
|
Look up the definition of the _T macro
#ifdef UNICODE
#define _T(x) L##x
#else
#define _T(x) x
#endif So in a UNICODE build _T("Hi") becomes L"Hi" and in an SBCS or MBCS build it becomes "Hi" .
Try using L instead of _T .
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for your reply, but that doesn't solve my problem.
My problem is that i want japanese strings in the source code, but the IDE and Compiler doesn't support unicode source files (VC6). I've now made a Perl Script that creates arrays or WCHAR's from the unicode string. Any better idea?
WCHAR jpn[] = {0x0032, 0x6B21, 0x30A8, 0x30A2, 0x0000};<br />
AfxMessageBox (jpn);
|
|
|
|
|
Hi,
Do I have any realistic hope of being able to diagnose a bugcheck if I have the minidump file?
I am an app developer, and I know nothing about kernel-mode. I know the error code: 0x10000050.
Is there a resource I could use to learn how to use the dump file, or would it just be a goose-chase since I am not expert at kernel-mode stuff?
Thanks,
Rich
|
|
|
|
|
Hi everyone,
I am trying to use the boost multithreading library. I am having a
problem as the join() function for the thread never returns. I am using
a boolean variable to indicate when the thread should stop running.
Here is basically a stub of what I am doing:
<br />
bool m_RunThread = false;<br />
scoped_ptr<boost::thread> myThread;<br />
<br />
void MyObject::StartThread()<br />
{<br />
m_RunThread = true;<br />
myThread.reset(new boost::thread(boost::bind<br />
(&MyObject::MyThreadFunc, this)));<br />
}<br />
<br />
void MyObject::StopThread()<br />
{<br />
m_RunThread = false;<br />
myThread.join();
<br />
... Never gets here....<br />
<br />
}<br />
<br />
void MyObject::MyThreadFunc()<br />
{<br />
while (m_RunThread)<br />
{<br />
}<br />
}<br />
However, the join() function in StopThread never returns. I think that
using a variable to synchronize this is probably not a good idea. Any
thoughts and suggestions?
Cheers,
K
|
|
|
|
|
Have you verified that MyObject::MyThreadFunc ever exits? Perhaps it's spinning in a loop.
Steve
|
|
|
|
|
Yup. It definitely exits, as if you put a breakpoint in there after the condition is met, it never gets there. Also, m_RunThread member is declared as volatile.
Cheers,
K
|
|
|
|
|
Sorry, but I'm not sure if it exits or not after reading you reply. When you say, "It definitely exits" it makes me think it exits but when you say, "it never gets there" I'm not so sure. If you put a breakpoint at all return points of the thread function does one get hit?
Steve
|
|
|
|
|
Anyone know of an easy way to search a vector for the following:
Lets say I have a vector with 80,000 structures in it and I want to search for duplicate strDevice strings in each struct. Is there a easy or fast way to do this with out pulling the first string and compairing it to the other 79,999 then pulling the second and third etc...
const struct s_item
{
CString strDevice,
strIP,
strLID;
};
std::vector<s_item> v_items;
Any ideas?
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
you could add them to a std::map and in each node, keep the index of the std::vector of the string ...
for example ( with letters )
vector : a b c d a b a a c d e f a b
loop the vector, for each item, insert in the map
a (idx 0, 4, 6, 7, 12 )
b (idx 1, 5, 13 )
...
at the end, you have a map of all uniq words, with a vector of the index in the vector of each string ( or structure )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
using stl::find() algorithm seems to work fine for me.
My articles
BlackDice
|
|
|
|
|
First you need a way of comparing s_item s for equality based on the strDevice string:
struct DeviceIDsEqual : binary_function<s_item, s_item, bool>
{
bool operator()(const s_item& f, const s_item& s) const
{
return f.strDevice == s.strDevice;
}
}
We also need the vector sorted so we need to compare if one s_item is less the another based on the strDevice string.
struct DeviceIDsLess : binary_function<s_item, s_item, bool>
{
bool operator()(const s_item& f, const s_item& s) const
{
return f.strDevice < s.strDevice;
}
}
Now we first sort then eliminate duplicates:
typedef vector<s_item>::iterator VI;
sort(v_items.begin(), v_items.end(), DeviceIDsLess());
VI newEnd = unique(v_items.begin(), v_items.end(), DeviceIDsEqual());
m_items.erase(newEnd, v_items.end());
Of if you just want to find the duplicates you can use the adjacent_find algorithm.
This code needs the following includes:
<functional>
<algorithm>
and the following:
using namespace std;
Steve
-- modified at 23:48 Monday 6th February, 2006
|
|
|
|
|
Thank you this is exactly what I was looking for. I need to brush up on templates and STL
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
My software has unicode display problem. I followed UNICODE articles from this site. But my software menu still can not display UNIcode under the English Win XP OS (Unicode font was installed. On the same computer, the notepad can display unicode. )
Any body has same experience and how you solved this problem?
Many thanks,
|
|
|
|
|
I am looking for some gauge controls like the Dundas gauges, but for MFC and not .NET.
Commercial is ok, but as always free would be better
Thanks
|
|
|
|
|
Hi All,
I remember seeing a call that would allow you to download a file via a url in MSDN, I can't for the life of me, remember what it was called.
Anybody know?
Thanks.
Mike
|
|
|
|
|
I think URLDownloadToCacheFile(...) and URLDownloadToFile(...) are what you are looking for. There is an article here on CP that demonstrates at least one of those functions.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
URLDownloadToFile
rrrado
|
|
|
|
|
I have a dialog MFC application. Sometimes I show the modeless dialog above parent dialog to display some progress of worker thread. Progress window can be currently moved along the screen. How to make it clipped by parent dialog ? (Something like a view window in the MDI Frame)
Thank you!
rrrado
|
|
|
|
|
By doing so you would be eliminating one of the features of a modeless dialog in this context - why not just show the progress on the underlying dialog and save yourself the trouble?
Anyway, you can handle WM_MOVE on the modeless dialog, and constrain its movement to the bounds of the parent window. This will not really clip the modeless dialog, but that too is not such a good idea because you would be allowing the user to effectively hide the modeless window, again eliminating one of the basic features of a modeless dialog.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I cannot show it in underlying window because it contains big area which is useless when not working and there is not enough room in parent window for this.
I'm handling parent movement exactly as you've wrote but it allows to move it for example above right edge of parent and then move parent together with progress to right edge of desktop so progress will be hidden. I don't want to handle all such situations including minimizing window, etc.
There must be some easier sulution and I want to know it
For example WinRar shows progress this way and it looks good
rrrado
|
|
|
|
|
please don't ... me think it goes against good normal Microsoft's UI behaviour ..
BUT ... you could do something different ...
if your progress dialog is modeless and does not really show information ( apart from the progree ); add a status bar to your dialog application and and display the progress in there insted on a popup modeless dialog.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
When selecting an item in a listview I can only highlight the first item, not the entire row. Where´s the problem ?
int nItem = m_Liste.GetNextSelectedItem(pos);
m_Liste.SetItemState( nItem, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
m_Liste.EnsureVisible( nItem, FALSE);
|
|
|
|
|
Check LVS_EX_FULLROWSELECT extended style
rrrado
|
|
|
|