|
I need some tips to debug my MFC app. When I close my application it (sometimes) still appears as a running app in the Task Manager. My app is quite big and I’ve not myself written all the code. Where should you start figuring out the problem? I’ve read a lot of Articles in this topic but I cant find any really good one for my problem.
Should I use any kind of Tool or… All tips are welcomed!
_____________________________
...and justice for all
APe
|
|
|
|
|
d00_ape wrote:
When I close my application it (sometimes) still appears as a running app in the Task Manager.
Often this is because your program creates one or more additional threads that were not shut down. They are still running, so your application is still in Task Manager, even though the main GUI thread has ended.
|
|
|
|
|
The strange is I'm not creating any new threads. I've figured if the reason is that I'm not properly closing down all dialogs (Created with CWnd::Create). Could that be the reason?
_____________________________
...and justice for all
APe
|
|
|
|
|
please help me to solve this problem
i am using the ShellExecuteEx to open a text file but an error occures
ERROR_ACCESS_DENIED if the os is NT.
thanks
|
|
|
|
|
1) Check the permissions on the file
2) Make sure you're setting the cbSize variable:
blah.cbSize = sizeof(SHELLEXECUTEINFO);
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
How to convert char * to const char * ?
LPSTR s1;
LPCSTR s2;
s1 to s2
Thank you.
|
|
|
|
|
You don't have to. The conversion is done automatically.
|
|
|
|
|
LPSTR smenu;
GetMenuString(hmenu_options_thread1,uIDCheckItem,smenu,0,MF_BYCOMMAND);
MessageBox(hWnd, smenu,"Thong bao",MB_OK);
It appear an error, why is it ?
Thank you.
|
|
|
|
|
microsoftcertificate wrote:
LPSTR smenu;
Buddy, you forget to provide memory to smenu .
microsoftcertificate wrote:
LPSTR smenu;
GetMenuString(hmenu_options_thread1,uIDCheckItem,smenu,0,MF_BYCOMMAND);
MessageBox(hWnd, smenu,"Thong bao",MB_OK);
Right code will be something like this
LPSTR smenu=NULL;
int nSize=GetMenuString(hmenu_options_thread1,uIDCheckItem,NULL,0,MF_BYCOMMAND);
smenu=new TCHAR[nSize+1];
GetMenuString(hmenu_options_thread1,uIDCheckItem,smenu,nSize,MF_BYCOMMAND);
MessageBox(hWnd, smenu,"Thong bao",MB_OK);
if(smenu)
{
delete []smenu;
smenu=NULL;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
microsoftcertificate wrote:
Thanks.
Mention Not Buddy!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
There is no real conversion!
char * and const char * are the same data types, but for the latter, there is only read-permission given by the compiler. When the software is compiled, there should be no difference at all!
So:
s2 = s1;
Don't try it, just do it!
|
|
|
|
|
when we double click a bat file, we see a DOS window, the program is command.com
my question is:
can we redirect standard output, error and input streams of command.com to my own app?
i.e. in my app, i use CreatePipe(...) for command.com and send command line to it to execute the coomad line then read responding from it to my app.
any links or hints for my question?
thanks
includeh10
|
|
|
|
|
includeh10 wrote:
when we double click a bat file, we see a DOS window, the program is command.com
my question is:
can we redirect standard output, error and input streams of command.com to my own app?
i.e. in my app, i use CreatePipe(...) for command.com and send command line to it to execute the coomad line then read responding from it to my app.
any links or hints for my question?
Try this site: Click[^]
especially: http://www.robvanderwoude.com/redirection.html[^]
|
|
|
|
|
i need to redirect to my app, not a file.
in other words, command.com is invisible, i can not find clue on the web-site.
is it ur site? it looks great.
includeh10
|
|
|
|
|
|
hi
i have the string as str1 and then concatenated in str2 and now i have to execute it
str1="\"c:\Program Files\Demo\xyz.dll\"" ;
str1="regsvr32.exe /u " + str1;
how can i execute this programatically.
Itried with ShellExecute and system but it does not work
waiting for reply
Best Regards
|
|
|
|
|
Try this
string sFile(_T("regsvr32"));
string sParam(_T("/u \"F:\\Data\\MAPIProp\\mapiprop.dll\""));
::ShellExecute(NULL,_T("open"),sFile.c_str(),sParam.c_str(),0,SW_SHOW);
|
|
|
|
|
u can find source code of regsvr32.exe in VC++ samples, which is just a few of lines.
add the few lines inside ur app, things will be much easier and better - then you do not need regsvr32.exe again.
includeh10
|
|
|
|
|
Could you tell me what are differences between CComBSTR and _bstr_t ?
Thanks in advance.
|
|
|
|
|
|
When do we use CComBSTR or _bstr_t ?
Thank you.
|
|
|
|
|
microsoftcertificate wrote:
When do we use CComBSTR or _bstr_t ?
Depending on Situation!
CComBSTR use ATL.dll and _bstr_t use msvcrt.dll
anyways _bstr_t is always better as it's come after CComBSTR and Still in process of upgradation!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi
I am working with a win32 application. I am drawing 4 ellipses in a line on the window. When I draw the second ellipse, I want the first ellipse to be erased on the window and so on..i.e at a time I should see only one ellipse moving on the window in a line.
I am doing the painting in on WM_PAINT handler
I tried using InvalidateRect(NULL, rect, FALSE), it worked but the background drawing which was there on the window initially is getting erased, and the program is going into infinite loop.
Can anyone please give me some suggestions on this?
Thanks
osi-sys
|
|
|
|
|
I really think you are doing too much in your paint routine. The animation calculations should be left outside of your paint routine. Keep the painting very simple.
Your paint loop should only be concerned with painting the single 'current' ellipse.
Also, it can take care of erasing the location of the 'previous' ellipse if you want. Disabling background erasing might reduce your flicker.
Another option is to draw to a memory device context and blit that to the screen during your painting. This will reduce your flicker. And you can erase into the memory DC the old ellipse (an operation that will NOT be visible ont he screen), draw into it the new ellipse, and blit to the screen, then repeat.
|
|
|
|