|
is this correct usage?:
_bstr_t test;
test = szCompletePath;
szCompletePath is a null terminated string (char szCompletePath[MAX_PATH]) and then pass test in a function that takes an LPOLESTR parameter?
thanks
|
|
|
|
|
That's fine, but
_bstr_t test(szCompletePath);
is better, because it is more efficient
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
But when i pass the test variable in the IShellFolder::ParseDisplayName function, it returns the error code -2147024809 which, accoring to the Error Lookup means "The parameter is incorrect.". Any ideas?
|
|
|
|
|
Dunno - it looks like it should be OK to me.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Try casting again the string to const WCHAR* (or const wchar_t*)
when calling ParseDisplayName , since that function need an OLE String.
Good luck!
One good thing about getting older, you don't lose the ages you've been!
|
|
|
|
|
Does anybody know of any articles describing the basics behind drawing lines between nodes. It would be a simple, general CAD tool which could be expanded to make programs for drawing flowcharts, electric circuitry diagrams, etc.
Haakon S.
|
|
|
|
|
are you talking about path-finding techniques to find the shortest path without crossing over your other components in your diagram?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Yes, that is one essential feature.
Haakon S.
|
|
|
|
|
I found a book called game programming gems that contains a whole set of AI to find those paths.
You may be able to find something on the internet or one of the game programming sites that has a code sample that will do this for you.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Is there a way to get the same effect as TRACE in debug mode but in release mode. I have a program that can trap the messages, I just need to know how to send those messages. It seems that AfxTrace and AtlTrace both disapear in release build.
Thanks,
Clint
|
|
|
|
|
clintsinger wrote:
AfxTrace and AtlTrace both disapear in release build
This is by design. Use OutputDebugString()
John
|
|
|
|
|
|
|
I have a custom control but it doesn't get any mouse messages. I had the same problem with a static control and someone told me to check Notify and that fixed it.
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
Have you subclassed a static control to make your custom control? If so, then the following code (I copied it out of MSDN) may help:
DWORD dwStyle = ::SetWindowLong(m_hWnd, GWL_STYLE);
if (!(dwStyle & SS_NOTIFY)) {
::SetWindowLong(m_hWnd, GWL_STYLE, dwStyle | SS_NOTIFY);
}
"The laws of nature, the laws of man
This volatile paradox will never stand"
-Plasticity, Front Line Assembly
|
|
|
|
|
The SS_NOFIFY is a static control style. This one is just derived from CWnd. Any other ideas?
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
If you use spy++ on your control window does it receive mouse messages?
"The laws of nature, the laws of man
This volatile paradox will never stand"
-Plasticity, Front Line Assembly
|
|
|
|
|
no
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
UINT CClass::OnNcHitTest(CPoint point)
{
return HTCLIENT;
//return CClass::OnNcHitTest(point);
}
i used this in a CStatic subclass, now u can just keep a look out for those mouse messages
hope this works.
|
|
|
|
|
Thanks!
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
Hi everyone,
i tried to use the multimap(STL) but I got an error "fatal error: Cannot open include file: 'multimap' C++" I already installed the all the files that I got from sgi... STL Version 3.3, I installed it in "C:\Program Files\Microsoft Visual Studio\VC98\Include"
Here's my code:
#include <string>
#include <iostream>
#include <multimap>
using namespace std;
struct ltstr
{
bool operator()(const char* s1, const char* s2) const
{
return strcmp(s1, s2) < 0;
}
};
int main()
{
multimap<const char*,="" int,="" ltstr=""> m;
m.insert(pair<const char*="" const,="" int="">("a", 1));
m.insert(pair<const char*="" const,="" int="">("c", 2));
m.insert(pair<const char*="" const,="" int="">("b", 3));
m.insert(pair<const char*="" const,="" int="">("b", 4));
m.insert(pair<const char*="" const,="" int="">("a", 5));
m.insert(pair<const char*="" const,="" int="">("b", 6));
cout << "Number of elements with key a: " << m.count("a") << endl;
cout << "Number of elements with key b: " << m.count("b") << endl;
cout << "Number of elements with key c: " << m.count("c") << endl;
cout << "Elements in m: " << endl;
for (multimap<const char*,="" int,="" ltstr="">::iterator it = m.begin();
it != m.end();
++it)
cout << " [" << (*it).first << ", " << (*it).second << "]" << endl;
}
What could be the problem?
Thanks/Regards
Sidney
|
|
|
|
|
Use #include <map> instead.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I used the #include <map> and I got 14 WARNINGS to many to enumarate it here
but <map> is for map only right? or is it the same file that I shall include if I used multimap?
here's my code after I changed it to <map>:
#include <string>
#include <iostream>
#include <map>
using namespace std;
struct ltstr
{
bool operator()(const char* s1, const char* s2) const
{
return strcmp(s1, s2) < 0;
}
};
int main()
{
multimap<const char*, int, ltstr> m;
m.insert(pair<const char* const, int>("a", 1));
m.insert(pair<const char* const, int>("c", 2));
m.insert(pair<const char* const, int>("b", 3));
m.insert(pair<const char* const, int>("b", 4));
m.insert(pair<const char* const, int>("a", 5));
m.insert(pair<const char* const, int>("b", 6));
cout << "Number of elements with key a: " << m.count("a") << endl;
cout << "Number of elements with key b: " << m.count("b") << endl;
cout << "Number of elements with key c: " << m.count("c") << endl;
cout << "Elements in m: " << endl;
for (multimap<const char*, int, ltstr>::iterator it = m.begin();
it != m.end();
++it)
cout << " [" << (*it).first << ", " << (*it).second << "]" << endl;
}
Thanks/Regards
Sidney
|
|
|
|
|
There is a known issue with VC6 sucking that means you will get warnings unless you #pragma them away. The problem is VC, not STL.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
A bug? humm... MS is bad did you try running the simple code which used multipam? I need the multimap to work co'z the cannot accomodate my data criteria... can you try running it?
Thanks/Regards
Sidney
|
|
|
|