|
I want to access explorer toolbar.for example i want to hide the menu bar on the explorer that appears when i open drive C. Can anybody help me how to do that in visual C++ 6. The problem is that i can get handle to menu of any window that is active on desktop just by getting handle to window.but how to get handle to toolbar of active window because as far as i think the menu of explore is not just menubar as in dialog based application but it is menu bar over a toolbar.
|
|
|
|
|
On a dialog application I would like to capture keyboard input when I press a button and then stop when the button is pressed again.
I have included the WM_CHAR and WM_KEYDOWN messages on the dialog, but they are not activated.
I can type into an Edit box on just press keys when over the dialog, but breakpoint in
void CKeyBoard_CDNUDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) is never reached.
Is there something else I need to do in order to get the keyboard characters pressed.
|
|
|
|
|
You need to do it in PreTranslateMessage.
BOOL CMyDialog::PreTranslateMessage(MSG* pMsg) <br />
{<br />
if (pMsg->message == WM_KEYDOWN)<br />
{<br />
if (pMsg->wParam == some_key_code)<br />
{<br />
Do_SomeThing();<br />
}<br />
}<br />
<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}
|
|
|
|
|
Thanks now doing it in PreTranslateMessage, but all the normal keys I process seem to be upper case, even when I change the Caps Lock.
ARe they a flag that controls the case?
sweep123
|
|
|
|
|
how can i work with htmlhelp in visual studio .net (visual C++)?
i want use ::HtmlHelp() but when i compile i get the error:
Fatture error LNK2001: unresolved external symbol "struct HWND__ * __stdcall HtmlHelpA(struct HWND__ *,char const *,unsigned int,unsigned long)" (?HtmlHelpA@@$$J216YGPAUHWND__@@PAU1@PBDIK@Z)
somebody can help me please?
thanks a lot
|
|
|
|
|
Make sure you link to htmlhelp.lib. By default it is located in C:\Program Files\HTML Help Workshop\Lib
|
|
|
|
|
where i set the link to the library htmlhelp.lib?
thanks and merry christmas
|
|
|
|
|
Go to project properties to Linker section. Also look for C++ FAQ on this site... IIRC it has info about that plus more stuff you probably want to learn.
|
|
|
|
|
I want to access Window Procedure of another processes window. I just want to display address of that window procedure.
In short Something like SPY++.
To add to above, GetWindowLong fails for GWL_WNDPROC (but works for GWL_HWNDPARENT) and GetLastError returns 0.
Does this fail because the target window lies in different process?
If yes, then how does SPY++ do same thing
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I am developping in VC 6 and my app. do not run over XP.
Could somebody help me?..
|
|
|
|
|
What's the problem you are facing.
Still Alone in this beautiful world
My Articles
|
|
|
|
|
The project run with win 98. In Xp simply, the app. do not start. I haven't any error, only do not run.
I thought that the problem is the plataform, isn't it?
Something special to install?
|
|
|
|
|
Hmmm. Is it a debug build? If so, build a release version and try that - it doesn't need the non-distributable DEBUG dlls for CRT and MFC.
You should check the dependencies (using DEPENDS.EXE) to see that the DLLs it needs are on your XP platform. Do you get any diagnostic messages at all?
Steve S
Developer for hire hired!
|
|
|
|
|
Thank you, I have solvered my problem, just was my CRY.Rpt Control... Thank again....
|
|
|
|
|
Friends,
I am opening a file using std::fstream . The purpose is to read all the contents of file into a buffer and then close the file. Program uses this buffer later.
The problem is that i am not an expert of fstream . I am using a function Read() , to copy data from file to buffer. The problem is the allocation of buffer. Lets see what i am doing:
fstream file("somefile.txt");
char *pBuffer = CreateNewBuffer(100) // 100 is buffer size
while(!file.eof())
{
file.read(buffer,100);
// Blah Blah
}
I don't know the number of bytes actually present in the file and so i am creating the buffer of size 100.
Is there any way to find out that how many bytes are there in the file OR how many bytes left, so that there will only be one Read() call instead of loop??
And most important for me is that how may bytes are actually read into the buffer.
Imtiaz
|
|
|
|
|
std::ifstream isn't designed to allow the reading of the entire filesize. The function _filelength in <io.h> will give you the length of a file. Be warned that this function is limited to the size of a long, so for very large files you'll need to use a platform dependant API (See MSDN).
The following function taken from the boost::regex sample code (regex_grep_example1.cpp) is one example of how to efficiently and safely allocate space using std::string. This is not the simplest solution, it is flexible. However without profiling this is micro-optimisation that probably isn't going to help. Note the use of reserve and capacity to ensure appropriate growth system for you buffers. You may be able to tweak initial size and growth rates if you know roughly what size the file will be.
void load_file(std::string& s, std::istream& is)
{
s.erase();
if(is.bad()) return;
s.reserve(is.rdbuf()->in_avail());
char c;
while(is.get(c))
{
if(s.capacity() == s.size())
s.reserve(s.capacity() * 3);
s.append(1, c);
}
}
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
hi all,
I have added Edit Box to MFC Dialog base Program.I also activated auto Horizontal Scroll Bar and Vertical Scroll bar..
How do I show a Message (say "hellow") when click on a Scroll bar of that edit box.?
If any know that please reply me...
Thanks in advance..
|
|
|
|
|
Add Message Handlers for EN_HSCROLL and EN_VSCROLL messages and display MessageBox there.
Now, I hope you know how to add message handlers. If you dont, u can find it in any basic level MFC Book.
Regards,
Still Alone in this beautiful world
My Articles
|
|
|
|
|
hi,
I added that messages to Application..
void CA1Dlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
AfxMessageBox("hi");
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
But it is not working and not displying the Message
I have used MFC Dialog wizard to create the Application..
thanks in advance
|
|
|
|
|
i want to know about is it possible to have a command button in vc++ like in vb6.
|
|
|
|
|
Yeah Why noT every Thing that is possible in VB is possible in vc also.
siva_nkl33 wrote:
command button
Use CButton if you are using MFC
use HBUTTON hBut=(HBUTTON)CreateWindow("BUTTON"......); in WIN32apis
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
I am getting an error as"Breakpoint has been reached"
while using VC++ rich edit text box
Can anybody help me find solution
Grace
|
|
|
|
|
Try rebuilding the project. Or just ignore it and run program further by pressing F5.
|
|
|
|
|
Dear friends,
I am declaring a template class in header file and defining its methods in cpp file. As such i am getting an error of "unresolved external symbols" whenever i create object of this class.
Instead, if i define the methods in *.h file and remove cpp file, the errors are removed and program runs fine. Can anyone tell me whats the problem:
////////////////////////////////////////////////////////////////////////////
// File MyTemplate.h
template <class T> class TMyTemplate
{
public :
TMyTemplate();
~TMyTemplate();
};
template <class T>
TMyTemplate<T>::TMyTemplate()
{
}
template <class T>
TExpandableBuffer<T>::~TExpandableBuffer()
{
}
/////////////////////////////////////////////////////////////////
i.e i declared and defined functions in header file and this works fine for me. But if i remove the methods definition from header to cpp file the compiler starts giving me error of "Unresolved External Symbols" whenever i create object of class like:
TMyTemplate<char> myTemplate;
Imtiaz
|
|
|
|
|