|
Binayak wrote:
Hi,
1. I want to perform different actions depending on user clicking different nodes (tree items) in the tree control. I wanted to write handler for the single click event (NM_CLICK), but, m_Tree.GetSelectedItem() returns the Item which was selected earlier, instead of the one that is selected now. Can anybody tell me how to get the Item on which the user clicks?
That's the wrong message handler, prefer overriding TVN_SELCHANGED. If you _really_ need to use NM_CLICK, I can provide you with a fix to this.
~RaGE();
|
|
|
|
|
Thanks a lot.
It works now
I have some more questions coming up...please help
Thanks again.
|
|
|
|
|
Hi everybody,
I've asked lots of people to help me out here but apparently this seems hard to do. ALL suggestions are more than welcome! If this thing gets solved rapidly I will consider paying a small amount for a solution.
The problem description:
I have a BHO (Browser Helper Object) in a dll. The BHO is loaded when Internet Explorer (iexplore.exe) starts and unloaded when it closes. It performs dynamic dictionary lookups on web pages. In the loading part of the dll
<br />
<br />
extern "C"<br />
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID )<br />
{<br />
if (dwReason == DLL_PROCESS_ATTACH)<br />
{<br />
<br />
_Module.Init(ObjectMap, hInstance);<br />
DisableThreadLibraryCalls(hInstance);<br />
}<br />
else if (dwReason == DLL_PROCESS_DETACH)<br />
_Module.Term();<br />
return TRUE;
}<br />
I have commented out a code section which makes the loading stop if it discovers the caller as the process explorer.exe. This piece of code does everything I want IF it wasn't for the fact that Internet Explorer (iexplore.exe) sometimes runs under the explorer.exe process.
So the problem is, how do I get the dll/BHO to load ONLY ONLY ONLY when Internet Explorer is started and NOT NOT NOT every time when a folder (resides in explorer.exe process) is opened. As you probably know, we all use folders every day and my BHO loads a heavy dictionary every time it is opened.
Now, some of you clever guys out there might say: Why not delay the heavy part loading until you really need it? That is, load it only when you discover you have a web page (and not a folder). That would almost be fair enough if it, among other things, wasn't for a copy protection mechanism that I have in my dll. When the copy protection mechanism sees that there are no more, let's say, evaluation days left for the BHO dll, then a message pops, informing this to the user. And naturally it does this with every opened folder too, not only with Internet Explorer. This is definitely not ok!
And another problem is that the BHO dll sort of hooks on to the operating system since explorer.exe is an important process. For this reason only one would want to get rid of the folder/explorer.exe dependency. Also at installation and uninstallation things become complicated because you have to consider opened folders before you install/uninstall new versions/upgrades... Very annoying and cumbersome!
So, is there anyone out there who can help me with this? Surely there must be a solution cause there are lots (well, some anyway) of BHOs out there that either suffers from the same problem or have solved the problem already.
Thx for all your help! You are free to mail me directly at tommy@internetami.se.
/Tommy
|
|
|
|
|
The trouble is that there really isn't a difference anymore between "IE" and "Explorer" If you run "Explorer" and enter http://www.foo.com into the address bar, suddenly it looks like IE and you can view that web page. If you run "IE" and enter C:\windows in the address bar, suddenly it looks like Explorer and shows that directory.
What I do to tell the difference is try to get an IHTMLDocument interface on whatever is being shown in the view. If that QI fails, then a web page is not being displayed, so you can assume the file system is.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Michael Dunn wrote:
What I do to tell the difference is try to get an IHTMLDocument interface on whatever is being shown in the view. If that QI fails, then a web page is not being displayed, so you can assume the file system is.
I'm assuming you're not doing this from the DllAttach function. (If that's the case, please tell me how!)
If not, well, I've tried that too (after SetSite call) but what that really does is only to relieve me [or the folders] from my heavy dll dictionary loading; still the folders and all that are under the influence of explorer.exe are loading the BHO when opened.
Is there no way to test for differences between the callers other than the process name?! Sounds weird...
Well, well, the solution is still to be found I guess.
Thx Mike,
/Tommy
|
|
|
|
|
Michael Dunn wrote:
What I do to tell the difference is try to get an IHTMLDocument interface on whatever is being shown in the view. If that QI fails, then a web page is not being displayed, so you can assume the file system is.
When can I check for the displayed web page...? I tried in SetSite but I think the document wasn't finished loading. How to know when to test the IHTMLDocument pointer?
/Tommy
|
|
|
|
|
hi.
I have a working application organized like this:
- a main lib: Debug Multithreaded, using MFC
- the application: Debug Multithreaded, using MFC
- various plugins DLLs declared as AFXDLL: Debug Multithreaded DLL, using MFC
I have to link the application to a specific lib (Multithreaded) provided by someone else. To do so, I must activated the "ignore all default librairies".
and now, I can't find the correct lib settings for the various parts of my application.
Does someone have a pointer to where I can find a list of necessary libs and the inclusion order I must respect ?
thanks.
|
|
|
|
|
Hi,
as the title said, I'd like to know how can I display some greek characters in an editBox with visualC++ 6.
I made searches but I found no way to do it.
Thanks for any answer (and please excuse my awful english;))
|
|
|
|
|
Is there anyway to make a case statement use AnsiStrings instead of intergers in Borlands c++
|
|
|
|
|
chris sprague1977 wrote:
Is there anyway to make a case statement use AnsiStrings instead of intergers in Borlands c++
The switch -ed expression enclosed in parentheses must be of an integral type or of a class type for which there is an unambiguous conversion to integral type. This includes int egers, but not necessarily AnsiStrings (whatever those are).
|
|
|
|
|
IS there a way I can do the analogous of sprintf for a char * to a STL string .
or a Format for a CString
Basically i want to write a integer value to a string !
string numText;
char data[20];
int a =100;
sprintf(data,"Num is %d",data);
Is there a way to do this for the string numText !!!!
|
|
|
|
|
you could try:
string numText;<br />
char data[20];<br />
int a = 100;<br />
sprintf(data,"Num is %d",a);<br />
numText = string(data);
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
|
And on Windows CE .NET? The STL implementation there lacks the handy streams...
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
Johann Gerell wrote:
And on Windows CE .NET?
You would use .NET classes anyway. Otherwise, whats the point of using a .NET platform?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
jhwurmbach wrote:
You would use .NET classes anyway
No. ".NET" is a product name here, the .NET framework need not have anything to do with it, but it can.
In our specific case, (a) the compact framework (.NET CF) is buggy and unusable and (b) we do drivers and low level stuff unapropriate for the CF.
jhwurmbach wrote:
Otherwise, whats the point of using a .NET platform?
Since it's the latest version of Windows CE, it offers greater security, better Internet connectivity, more stability and about a gazillion other stuff of interest to mobile developers.
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
Wow! .NET CF comes without .NET.
Microsoft marketing is working really hard on creating a strong brand.
I did not know that.
And on top of it, you do not even get a C++ compiler (that would include iostreams), just a surrogate. It seems you are stuck with sprintf.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
jhwurmbach wrote:
And on top of it, you do not even get a C++ compiler (that would include iostreams), just a surrogate
jhwurmbach wrote:
It seems you are stuck with sprintf
Believe me, I'm so aware of that fact...
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
int main(int argc, char* argv[])
{
ostringstream s;
int a = 100;
s << a;
string numText = s.str();
cout << numText << endl;
return 0;
}
Oh, you also need to include the iostream and sstream headers.
Kevin
|
|
|
|
|
Use a ostringstream .
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
GetWindowText of an edit box (MFC) doesn't return the text if I write in a chinese win98.
I tried ::GetWindowTextW, still no text.
If I write in english, it works.
::GetWindowTextLength return zero for chinese text.
|
|
|
|
|
did you change your application to be in either UNICODE or MBCS ?
I suggest using UNICODE, by defining UNICODE and _UNICODE in the project setting (c++ tab)
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
UNICODE is not applicable on win98, but I used unicows.dll to run unicode application in win98.
I changed my edit box to a rich edit box and the text went fine.
The problem is that I need an edit box, not a rich one.
|
|
|
|
|
that?can you send me some project to see how you did that,cause i cant run apps under win98 even with MSLU
|
|
|
|
|
1. First, change the project settings to unicode:
a. Replace _MBCS with _UNICODE in the "C/C++" tab on the project settings
b. In the "Link" tab, category "output" write wWinMainCRTStartup in the "entry" edit box.
2. Add UNICOW: UNICOW.lib must be before all libraries, so we don't use the "default libraries" and link them ourselves.
here I use the MFC DEBUG lib versions, you can delete the 'd' from the file name to use the RELEASE version.
a. On the "Link" tab, category "general", write the following in the "Object/library modules" edit box:
unicows.lib winspool.lib shell32.lib uuid.lib oleaut32.lib ctl3d32s.lib ole32.lib gdi32.lib comdlg32.lib advapi32.lib comctl32.lib version.lib mpr.lib rasapi
32.lib winmm.lib vfw32.lib kernel32.lib oleacc.lib oledlg.lib user32.lib Uafxcwd.lib LIBCMTD.lib Mfcs42Ud.lib
b. Choose "Ignore all default libraries". (so what we did on a) will affect)
good luck
|
|
|
|