|
true/false (well, that what he said in his post)
|
|
|
|
|
I prefer to be sure...
|
|
|
|
|
true/ false is stored in that
|
|
|
|
|
what about
bool f = temp == "true";
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 still remember it.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Well I forgot for a while, but then suddenly I spotted you vulture ready for hitting me!
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
|
|
|
|
|
hehehhehe!!!
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
bool bVal = (temp == "true"?true:false);
-@SuDhIrKuMaR@-
|
|
|
|
|
why do you need the ?: operator ? the std::string::operator==() already returns a bool.
in the same direction, why wouldn't you write this then :
bool bVal = ((temp == "true") == true ? true : false)
or
bool bVal = (((temp == "true") == true) == true ? true : false)
or just
bool bVal = (temp == "true")
|
|
|
|
|
Hi,
I have a class CMyPropertySheet derived from CPropertySheet . I have added a CButton control and a CToolbar on this propertysheet. I have also added command handlers for the button and toolbar buttons. I have created property sheet as modeless propertysheet with WS_CHILD style set.
Handler for button gets called, however, the toolbar is never gets enabled. I see that the toolbar is in disabled state.
If I remove the WS_CHILD style from CMyPropertySheet creation, everything works fine, as expected.
Any help would be highly appreciated.
Regards,
Paresh.
|
|
|
|
|
Hi,
I have a little problem with global hooks in my application. After setting the hook, the hook DLL gets attached only to two processes (the app which created the hook and a random process - last time I ran it it was Winamp;p) instead of all processes in the system.
Here's the code I use to create the hook:
void HookManager::Init(ListenerWindow *l) {
l->GetListeners().push_back(this);
TCHAR dllPath[MAX_PATH];
GetCurrentDirectory(MAX_PATH,dllPath);
#ifdef XWS_64
_tcscat_s(dllPath,MAX_PATH,_T("\\XWSHook64.dll"));
#else
_tcscat_s(dllPath,MAX_PATH,_T("\\XWSHook.dll"));
#endif
mHookInstance = LoadLibrary(dllPath);
if(!mHookInstance)
throw _T("Could not load the hook DLL.");
void (*pfnSetSharedHookHandles)(HWND,HHOOK) = (void(*)(HWND,HHOOK))
GetProcAddress(mHookInstance,"SetSharedHookHandles");
HOOKPROC pfnShellHookProc = (HOOKPROC)
GetProcAddress(mHookInstance,"ShellHookProc");
if(!pfnSetHookHandles || !pfnShellHookProc) {
FreeLibrary(mHookInstance);
mHookInstance = NULL;
throw _T("Could not locate the hook procedures.");
}
mShellHook = SetWindowsHookEx(WH_SHELL,pfnShellHookProc,mHookInstance,0);
if(!mShellHook) {
FreeLibrary(mHookInstance);
mHookInstance = NULL;
throw _T("Could not establish the system hook.");
}
pfnSetSharedHookHandles(l->GetHwnd(),mShellHook);
}
The only thing the hook DLL code really does is displaying a message box with the id of the current process in DllMain (with DLL_PROCESS_ATTACH). The ShellHookProc function doesn't do anything apart from calling CallNextHookEx().
Does anybody have an idea what can be wrong with it?
Thanks in advance,
Kosomot
|
|
|
|
|
I think you should also post your code for Shell Procedure also.
-@SuDhIrKuMaR@-
|
|
|
|
|
I didn't post the ShellHookProc, because currently it looks like this:
__declspec(dllexport) LRESULT ShellHookProc(int nCode,WPARAM wParam,LPARAM lParam)
{
return CallNextHookEx(g_hHook,nCode,wParam,lParam);
}
So I don't think this is the problem.
|
|
|
|
|
So your main purpose is dll injecting rather than hooking?
And there is also a chance that the message box function failed e because the window classes is not registerd yet. Try puttin a OutputDebugString() instead of messagebox.
|
|
|
|
|
Well, no. I'm keeping the hook proc empty for testing, until I'll manage to properly hook all processes. It contains more code, actually, but it's commented out.
Doesn't OutputDebugString() work only in the process that is being debugged? Because only the message from the host process is printed out.
I tried adding a MessageBeep() instead of printing anything, and it beeps only twice, so apparently DllMain is called only for two processes.
|
|
|
|
|
|
I am not able to open the link.
-@SuDhIrKuMaR@-
|
|
|
|
|
|
You want the same sample to be generated through Wizard.?
-@SuDhIrKuMaR@-
|
|
|
|
|
No. Normally when we run the wizard by selecting MFC Appln it creats CMainFrame, ..Doc, ..View, ..App etc., classes but this MDI sample doesn't have anything like this.
|
|
|
|
|
Hi all
Is there any way by whch I can Convert a .xls file into filterd html file(Pure html file). I am able to convert xls File into HTML by using "SaveAs" Method but this converted file is not a filtered HTML. If there is any library avilable to convert this Unfiltered HTML to Filtered plz let me know about that.
Thanks in advance.
|
|
|
|
|
i have the status bar in a dialog and i give the string to be displayed inside the statusbar using the code given below inside the button click,but the s="in progress" doesn't get displayed and only "sucess" is displayed finally,what's wrong with the code.the problem is iam not able to show two status inside the same button click.what should be done???
void test::OnBnClicked1()
{
s="in progress";
m_bar.SetPaneText(0,s);
if(i>0)
{
call(&a);
printf(".....");
}
s="success";
m_bar.SetPaneText(0,s);
}
and
Raja
|
|
|
|
|
what does your call(&a) function do. Does it take a lot of time to get the processing done. May be it would be too fast for you to see the change from "in progress" to "success". Won't be a good idea, but try putting some Sleep(/*timeinterval in msec (may be 10000)*/) and notice the change. The sleep should be placed beween the two SetPaneText [just before s="success"]. if it doesn't show "in progress" you need to check elsewhere
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
It is because you only have one thread: the message queue of your application is processed in the same thread as the rest of your application code. It means that if you do a lenghty process in one of your function, you won't be able to process messages anymore, which means your GUI seems frozen and is not updated (thus, you won't be able to see your text on the status bar). The solution is to start a new thread and put your lenghty process there. Once finished, you can send a message to your main window so that it can change the text of the status bar.
|
|
|
|
|
i have the same problem even after implementing that long call(); operation in a thread!!!!
Raja
|
|
|
|