|
hi
i defined an accelerator Ctrl+T to generate ID_TMPDLG. i put
ON_COMMAND(ID_TMPDLG, &Ct2App::OnTmpDlg)
but the function is not called. i tried to see whether to message for the accelerator is generated correctly and i tested it in:
BOOL Ct2App::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == 'T')
return CWinAppEx::PreTranslateMessage(pMsg);
return CWinAppEx::PreTranslateMessage(pMsg);
} by defining a break point, i realized that the line is hit and the message is produced correctly. but i don't know why the command ID_TMPDLG is not generated or received by the application. i tried to handle the command in another places like main frame and child view, but it didn't help and the command is not still generated or received. i don't know whether the accelerator message is not converted into the command or the message is lost somewhere.
what can i do?
thx
|
|
|
|
|
1.) create an accelerator resource.
2.) load them: _haccel = LoadAccelerator(0,MAKEINTRESOURCE(<idaccel_res>))
3.) translate them by calling TranslateAccelerator()
have a nice day.
|
|
|
|
|
oh thanx
so u mean my defined accelerator is not loaded or is not translated?
i put it in the only one pre-existing accelerator list with the id of IDR_MAINFRAME. if it's not loaded the other defined accelerators in the list must also not work, but they do. for example Ctrl+S brings up the Save As dialog, etc.
how can i justify this and how can i check that whether an accelerator is loaded or translated properly and where in the program does this happen?
thx
|
|
|
|
|
"so u mean my defined accelerator is not loaded or is not translated?"
yes indeed - set a breakpoint at the TranslateMessage of the base class. enshure your accelerators are loaded. it seems only the predefined accelerators will work.
good luck.
|
|
|
|
|
i couldn't find TranslateMessage! it seems to be an API function, not belonging to any class. TranslateMessage of what class u mean?
|
|
|
|
|
Hi,
how do i receive full path of a specified process with it's name.
with Process32First and Process32Next functions, i will receive the name of specified process (the szExeFile member of PROCESSENTRY32 struct)
but to have full path?
please help me.
Zo.Naderi-Iran
|
|
|
|
|
You may call GetModuleFilenameEx[^] (after calling OpenProcess[^] for retrieving process handle from process id).
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
[My articles]
|
|
|
|
|
i include the psapi header:
#include psapi.h
but it is an error : unresolved externals
?
Zo.Naderi-Iran
modified on Thursday, December 9, 2010 6:39 AM
|
|
|
|
|
Did you link with Psapi.lib?
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
[My articles]
|
|
|
|
|
no, only include psapi.h
Zo.Naderi-Iran
|
|
|
|
|
The try to link with the library (select Project->Project Properties menu item, then, on the newly appeared window, choose Configuration Properties->Linker->Input , finally add Psapi.lib to the Additional Dependecies list).
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
[My articles]
|
|
|
|
|
it is ok, thank you
Zo.Naderi-Iran
|
|
|
|
|
You are welcome.
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
[My articles]
|
|
|
|
|
Including a header file and linking with a library are two separate things.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi all,
i have to Append the String Values in CListBox just Like ClistCtrl Does.
I mean i am appending the String values inside the ClistBox with some Gaps but they are not Alligned Properly.
I have to Display just like CListControl.
Code:
-----
CListBox.AddString("one"+ "-----------------" +"1"); //Equal Space Padding automatically depending on Chars in List.
CListBox.AddString("Twently"+ "-------------" +"2");
The Padding of Small and Big charters in CListBox must just appear as CListCtrl.
Give a solution for this.
Thanks,
Uday.
|
|
|
|
|
I am not sure I understand your question but I suspect that your CListBox is using a proportional font so individual characters are only as wide as they need to be. You probably want to use a fixed width font, such as Courier, where each character is the same width in pixels.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
You might take a look at SetTabStops[^] in MSDN.
Using that, you can still use proportional fonts.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hello
I am loading an image file using gdiplus Bitmap class, and changing the transparency using ColorMatrix, and draw the image in device context, its showing fine in transparency. now i want to save this file in disk (with transparency). is there anyway to do that?
i am doing like this.
Bitmap gbmp = Bitmap::FromFile("C:\\anyimage.bmp");
ImageAttributes imgAttr;
ColorMatrix tcm =
{
1.0f, 0.0f, 0.0f, 0, 0,
0.0f, 1.0f, 0.0f, 0, 0,
0.0f, 0.0f, 1.0f, 0, 0,
0.0f, 0.0f, 0.0f, 0.6f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 1.0f
};
imgAttr.SetColorMatrix(&cm, Gdiplus::ColorMatrixFlagsDefault,Gdiplus::ColorAdjustTypeBitmap);
Graphics g(dc.GetSafeHdc());
g.DrawImage(gbmp, Gdiplus::Rect(0, 0, gbmp.GetWidth(), gbmp.GetHeight()), 0, 0, gbmp.GetWidth(), gbmp.GetHeight(),UnitPixel, &imgAttr);
after this, i need to save this image in disk.
Thanks
A. Gopinath.
|
|
|
|
|
Hi,
See Gdiplus::Image::Save() sample here[^].
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
nice: but the doing man builds his own moon. and the wise man learns how others change the world (by me).
|
|
|
|
|
Hi,
I used InternetGetConnectedState() of afxinet.h class to get the availability of internet in my application. But this clas is giving exception. If I comment this function, application is runing fine.
Is there any way to check the internet availability?
|
|
|
|
|
Could you provide more details about the exception ? Did you use your debugger to check the state of the different variables ?
|
|
|
|
|
Hi,
InternetGetConnectedState() isn't a class, it is a function inside wininet.dll and it works fine for me. Are you using it correctly? Did you read the relevant page in the MSDN documentation?
|
|
|
|
|
Before abandoning the function, you should carefully examine the exception to understand what's happening (and, as already suggested, you may post the exception message here for getting better help).
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
[My articles]
|
|
|
|
|
Hi All,
As u can deduce from the title, I'm using visual Studio 6.0 and i want use the Microsoft Platform SDK for some kind of project.
The main idea is that i'm new to the SDK, i download the Microsoft Platform SDK Server 2003 R2 (which is the compatible one for VS6).
I download some code from this site and when i tried to compile it, it said thjat some files were missing, such DShow.h, so i added the includes files by tools->options->directories->includes files.
now when i compile my project i've got those errors :
--------------------Configuration: LiveVideo - Win32 Debug--------------------
Compiling...
CaptureVideo.cpp
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(115) : error C2143: syntax error : missing ';' before '*'
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(115) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(115) : error C2501: 'm_pCapture' : missing storage-class or type specifiers
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(123) : error C2143: syntax error : missing ';' before '*'
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(123) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(123) : error C2501: 'm_pCaptureMoniker' : missing storage-class or type specifiers
C:\Documents and Settings\FST-Admin\Bureau\Prj 3 VC 6.0\Source code\CaptureVideo.cpp(33) : error C2065: 'm_pCapture' : undeclared identifier
...................................................................................................
Generating Code...
Error executing cl.exe.
I'm not sure if what i did was right or a big mistake, or the Microsoft Platform SDK still not recognised into my VS6.0.
So plz, some help will be appreciated.
"The Ultimate Limit Is Only Your Imagination."
modified on Wednesday, December 8, 2010 4:21 PM
|
|
|
|