|
messages like ON_EN_SETFOCUS for a CEdit Control is typically sent through its parent,ryt?
This is the situation of CControlBar->Intermediate CWnd->CEdit..
CControlBar is docked on a CMainFrame... CEdit's parent is an intermediate CWnd..
I want SetFocus notifications and ENTER key presses to be handled by CControlBar or on the CMaiNFrame.. is there anyway i can do these?
regards,
Maverick
|
|
|
|
|
I am unable to activate the CButton control that I put on a CDialogBar.
I remember reading somewhere that on a Dialog bar the CButton is disabled.
Can i enable it ?
Thanx in advance
laiju
|
|
|
|
|
Hello. I have the same problem also.. Although I haven't tried it yet, this is the info i got on a website.. hope this helps...
INFO: CDialogBar Button Enabled When Command Handler Present
View products that this article applies to.
Article ID : 98198
Last Review : December 11, 2003
Revision : 1.0
This article was previously published under Q98198
A button in a CDialogBar object is disabled automatically if the command routing does not contain a command handler function for the button.
To enable a button in a CDialogBar object, the command routing must include a command handler for the button. A button command handler can be an ON_BN_CLICKED(), ON_COMMAND(), or ON_COMMAND_UI() message handler and it must appear in the message map of an object in the command routing. If the parent of the CDialogBar object is a CFrameWnd object, then the command is handled by the active child window or view, by the document attached to the view, by the frame window, and by the application (CWinApp object).
NOTE: Because the CDialogBar object is not included in the routing scheme, the ON_BN_CLICKED() or ON_COMMAND() handler must be placed in one of the objects mentioned above that is in the routing scheme and not in the CDialogBar class.
For more information on command routing, see the "Command Routing" section in Chapter 3 of the "Class Library Reference" manual. In Visual C++ 32-bit Edition, version 4.0, see both the "Command Routing" topic of the "Programming with MFC: Overview" in the Books Online and the MFC Technical Note 31, Control Bars.
--------------------------------------------------------------------------------
http://www.kbalertz.com/kb_98198.aspx[^]
|
|
|
|
|
How can i disable the horizontal scroll bar at run time.
laiju
|
|
|
|
|
I havent got any useful hits from google, does anyone here know how to obtain the string representation of an HKEY? Note that HKEY can be any key and not just the top level keys. Thanks!
|
|
|
|
|
I am using MFC and want to know the application folder (typically, but not necessarily "C:\Program Files\MyProgram") so I can read and save an initialization file for the program. A program that uses the main() function, arg[0] is usually the program's command line with subsequent arg[n] being the additional command line parameters. CWinApp does not appear to provide this information and I have looked through the help files and the CodeProject message board without success.
Any help would be greatly appreciated.
TIA
Ron
|
|
|
|
|
Well I dont use MFC I only know the API way so:
you can get it like this:
[code]
char path[_MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), path, _MAX_PATH );
[/code]
Path holds the full address of your exe like "C:\Program Files\Program\test.exe"
just delete text.exe from it and its done...
Well... I am a beginner ...
|
|
|
|
|
|
Check if this code is of any help :-
CString szCurrentDirectory;<br />
{<br />
CString csPath;<br />
<br />
<br />
::GetModuleFileName(NULL,csPath.GetBuffer(MAX_PATH),MAX_PATH);<br />
<br />
csPath.ReleaseBuffer();<br />
<br />
szCurrentDirectory=csPath.Left(csPath.ReverseFind('\\'));<br />
<br />
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thanks to all who responded. Problem solved!
Ron
|
|
|
|
|
:->
I need to Know how many number of disk devices and NIC cards are present in a system (through wmi classes).
how can i access this information.
Pradeep
|
|
|
|
|
Hi all
Will I am using GDI+ to manipulate images.
I am having this strange behaviour with Bitmap::Clone() function.
When I create a Clone from an Image object, and then try to LockBits for the cloned image, I get invalid pointer.
I did a workarround for this:
Bitmap* p_new_image = new Bitmap(p_src_image->GetWidth(),p_src_image->GetHeight(),p_src_image->GetPixlFormat());
Graphics* p_graphics = Graphics::FromImage(p_new_image);
p_graphics->DrawImage(p_src_image,0,0);
delete p_graphics;
will this code is working with LockBits very fine.
The documentation for the clone function is not clear, is this a bug in the Clone function, or I didnt understad the Clone function will?
Regards
Hesahm
Hesham
|
|
|
|
|
Hi guys,
i've implemented an manifest file to my app with following info:
---[cut here]---
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><br />
<assemblyIdentity<br />
version="1.0.0.0"<br />
processorArchitecture="X86"<br />
name="SETUP.EXE"<br />
type="win32"<br />
/><br />
<description>APPLICATIONNAME</description><br />
<dependency><br />
<dependentAssembly><br />
<assemblyIdentity<br />
type="win32"<br />
name="Microsoft.Windows.Common-Controls"<br />
version="6.0.0.0"<br />
processorArchitecture="X86"<br />
publicKeyToken="6595b64144ccf1df"<br />
language="*"<br />
/><br />
</dependentAssembly><br />
</dependency><br />
</assembly>
Since then, my listview doesn't accept item background colours i apply using:
if(lplvcd->nmcd.lItemlParam==1){
lplvcd->clrText = RGB(0,0,0);<br />
lplvcd->clrTextBk = RGB(240,240,255);<br />
}<br />
When i remove manifest, all looks okay, but when i apply it again - colours are missing.
Any idea ?
Regards,Paul.
|
|
|
|
|
I have both VC++ 6.0 and VC++ 7.1, and I notice that my 7.1 version has icons for source control that indicates when a file is locked by another user VS locked by the current user.
Where as VC++ 6.0 only has an icon showing it's locked.
See following screen shot:
http://code.axter.com/SCC_for_vc71_and_vc60.JPG
I'm developing an SCC AddOn for VC++, and I want to know if there is any way of adding the blue lock icon to VC++ 6.0, and if so, how.
I tried using Spy++ to find the tree window handle, but didn't have much luck.
I appreciate any leads to help solve this.
Thanks
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
ompiling...
MP3PLAYERDlg.cpp
Linking...
MP3PLAYERDlg.obj : error LNK2001: unresolved external symbol "public: class CBasePin * __thiscall CAsyncReader::GetPin(int)" (?GetPin@CAsyncReader@@QAEPAVCBasePin@@H@Z)
MP3PLAYERDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CAsyncReader::GetPinCount(void)" (?GetPinCount@CAsyncReader@@UAEHXZ)
MP3PLAYERDlg.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall CBaseFilter::NonDelegatingRelease(void)" (?NonDelegatingRelease@CBaseFilter@@UAGKXZ)
MP3PLAYERDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CAsyncReader::~CAsyncReader(void)" (??1CAsyncReader@@UAE@XZ)
MP3PLAYERDlg.obj : error LNK2001: unresolved external symbol "public: __thiscall CAsyncReader::CAsyncReader(char *,struct IUnknown *,class CAsyncStream *,long *)" (??0CAsyncReader@@QAE@PADPAUIUnknown@@PAVCAsyncStream@@PAJ@Z)
strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)
strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA)
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA)
Debug/MP3PLAYER.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.
MP3PLAYER.exe - 10 error(s), 0 warning(s)
these are the errors i have got when i tried to execute my project....i am doing a project to create an mp3 player
which reads the file bit by bit.....
i am beginneer...i know little about vc++.
so give me a detailed description....
included libraries are strmbasd.lib Vfw32.lib winmm.lib ....
i am using the memfile in directx8 to read data bit by bit..
please give me a solution... if any explanation needed please ask me...
sebin
|
|
|
|
|
sebinfrancis wrote:
these are the errors i have got when i tried to execute my project
wrong. these error happened when trying to link the compiled object files of your project.
sebinfrancis wrote:
so give me a detailed description....
select one error in the output window where you quoted this, and puch F1... msdn exist for that...
ok, now, what does the error say ?
let's take the first one :
MP3PLAYERDlg.obj :
error LNK2001:
unresolved external symbol "public: class CBasePin * __thiscall CAsyncReader::GetPin(int)"
the linker says that there is a call to the member function CAsyncReader::GetPin(int) into MP3PlayerDlg.obj (see the corresponding .cpp file), but it doesn't know such a function...
and all the errors you get are of this style...
so, did you well #include the headers ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi there
I need to find a way to reliably detect the date and time of the last startup/reboot of Windows.
I have found some information that could be used on Win95, Win98, and WinME platforms (checking the date and time of the registry backup files c:\windows\system.da0 and c:\windows\user.da0, or the last accessed time of autoexec.bat).
Is there a similar method that works on all versions of Windows? If not, is there a similar method on WinNT, Win2k, and WinXP?
Cheers,
Johan
|
|
|
|
|
Johan - I'm pretty sure for WinNT, Win2k, WinXP you can query a PDH (Performance Data Helper) Value called 'System Up Time', but I dont have any code here to prove it
Garth
|
|
|
|
|
|
Yes there is a gettickcount() function to calculate the uptime
i think it will return the values in seconds. you can calculate it
accordingly.
any further details refer WMI classes in msdn
Pradeep
|
|
|
|
|
Milliseconds actually.
This will be the simplist, most universal approach, though the DWORD counter will rollover every 49.7 days, so you'll have to take that into account.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
QueryPerformanceCounter and QueryPerformanceFrequency will help. They have a roll-over that is much much more than 49 days.
Don't try it, just do it!
|
|
|
|
|
Thank you everyone for your kind responses
You do however not answer my question, I want to detect the date and time of the last startup/reboot, not the time elapsed since then.
Maybe I should have been a bit more informative, I am adding this code as part of a software protection system, and I want to find a way to detect of the system time has been changed to a valid day within their evaluation period.
On the old Win architecture, this works perfectly by checking the files mentioned above. But how can this be achieved on the NT platform?
/Johan
|
|
|
|
|
I need to write a class which manipulates char in Unicode form.
So i need materials related to implementation techniques for unicode using c++ class..
thanx in advance
|
|
|
|
|
How about using std::wstring instead?
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|