|
MFC is just a wrapper around WIN32 API. So, if you take the WIN32 API, then remove 1 parameter (the HWND), you get the MFC API (that then calls the WIN32 API)!
Spy++ can show this effect though. Check out the window styles on a window before a modal dialog is displayed and then after
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
I have downloded a readymade dll from net. I now want to use it in my project.There is a demo code given with the dll on how to use the dll.In this code all the header files of classes defined in the dll are included in the external dependencies folder of the demo project.Do i have to do a similar thing in order to use the dll?If yes how? I went by the traditional method of menu item-Project->Settings->adding .lib file->including the function header in my proj directory but it didnt work.
Pleasecan wnybody solve my doubt?
ITS VERY URGENT!
Sayali
|
|
|
|
|
external dependencies are header files which are not part of project but included from other files in the project. They are automatically added to "external dependencies" folder in the project during compilation, you can't add them manually.
you said it didnt work - can you explain what are errors or warnings.
Saurabh
|
|
|
|
|
Well I have got a dll and an application which uses that dll downloaded from the internet(from site code project.com.u can aslo check it).There is a folder named external dependencies.In this folder all the files of the dll are added.When i tried to do the same thing for my application ,the programme DOESN'T GIVE AN ERROR IN COMPILATION OR THE BUILD PROCESS.But i also cant use the classes from the dll.It then gives a error of not able to open the header file of the class in the dll.(By the way i have included the comment #include "classheader".h in my cpp and h files;where "classheader" is the name of the header file of the class)
I wanted to know how to you link the dll such that its .h files come in the external dependencies folder.Because in the normal implicit and explicit linking which i tried the files are added in the application source and header files only...
please help
|
|
|
|
|
Make sure you add the relevant lib in
Project Settings -> Link -> General -> Object/Library modules
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
I have pointer to some window (HWND). How can I know if the window is blocked by its dialog box. In other words, I need to know if there is open dialog box (modal)
Thanks
|
|
|
|
|
A dialog box is usually a child of the parent application's main window. If the HWND you have is the main window, use EnumChildWindows to enumerate the child windows of the main window. For each child window, use GetClassName to get the window class of the child. Most dialogs have the class name #32770 . This would at least let you know if the application has a dialog open; unfortunately, it doesn't tell you whether the open dialog is modal or not.
Software Zen: delete this;
|
|
|
|
|
Yes the HWND I have is the main window.
I used EnumChildWindows but unfortunately the function does not "see" dialog boxes.
|
|
|
|
|
It sounds like your dialog is therefore a 'top-level' window. You can use EnumWindows in that case. You might try using GetWindowThreadProcessId to compare the process ID's of your main window to other top-level windows. Other top-level windows with the same process ID are probably dialogs opened by the application.
Software Zen: delete this;
|
|
|
|
|
I have a customized menu, which has a background, icon and sidebar.But what I can't accomplish is to remove the white bounding border(what I mean is the thin white rectangular lines surrounded the bottom and top menu item and of course the menu items in between), anyone can provide advices?
Thanks
|
|
|
|
|
We currently working on WLAN Load Balancing Project.
We need to find the RSSI Value b/w the Station(that is going to connect) and AP as well as the Station that have already connected.
I have come to know about the WMI but lack knowledge.
We don't want to develope any drivers rather using some API that provides control over the device.
Any API that do suport such things???.
Any :-DTUTORIALS , link, tips, SDKs are appreciated.
Thanks
Khalid
|
|
|
|
|
I have a singledocument MFC app. In the mainwindow it displays a listview. If you pick an item in that view a couple of docking Toolsbars with views should show a preview and Informations of that item. You know ACDSee? Than you know what I speak of.
I managed to set things up so far and it works. When selection changes the view sends a message (SendMessage()) with an ID to my MainFrame class and that one loads the new information in the preview tool bars (it calls the functions for loading in the toolbar classes).
Now I have the problem that changing selection in the mainview gets a little bit bumpy. When pressing the down key the selection cicles through the view. Without the views the speed is allways the same. With the views it stops sometimes but the speed changes again and again.
What I want is a steady speed.
The other downside is that the toolbars crashes. It is not a fatal error, the toolbars still work but the updated Informations are not displayed anymore. Even the overall appearance of the bars look damaged. I use a class from codeproject for them: CSizingControlBar so its difficult to say if its a problem with that class or a memory / message issue of my app.
Anyway I would be grateful if someone could help me with the first issue, and even more if someone knows something about the second one.
|
|
|
|
|
Hey all. I have a deque<MenuPtr> and MenuPtr is typedef of shared_ptr<Menu> . Not sure what i am doing wrong but I get the following error message when i run deque.clear();
Unhandled exception at 0x004590e9 in menu.exe: 0xC0000005: Access violation reading location 0xfaaafaa2.
What is happening in that method? It remove the shared pointers from the list and anything else? Or am I doing something really dumb?
Cheers.
Luke
|
|
|
|
|
You'd have to post your code, I can't tell much from what you've posted, other than it's a bad pointer exception.
I just whipped this and it worked fine.
#include "stdafx.h"
#include <boost/shared_ptr.hpp>
#include <deque>
#include <crtdbg.h>
class Menu
{
int m_x;
int m_y;
public:
Menu(int x, int y) : m_x(x), m_y(y)
{}
Menu(const Menu& menu)
{*this = menu;}
virtual ~Menu()
{}
Menu& operator=(const Menu& menu)
{
if (this != &menu)
{
m_x = menu.m_x;
}
return (*this);
}
};
typedef boost::shared_ptr<Menu> MenuPtr;
int _tmain(int argc, _TCHAR* argv[])
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
Menu* one = new Menu(1,2);
Menu* two = new Menu(3,4);
std::deque<MenuPtr > myDeque;
myDeque.push_front(MenuPtr(one));
myDeque.push_back(MenuPtr(two));
return 0;
}
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Sorry don't have the code on me right now. I'll reply again later when at home. But i'll try to get it across now. I have a Menu class that contains a deque of other MenuPtr's as you can add Menu object to Menu objects.
One way is vis Menu::add(MenuPtr& menu);
or Menu::add(Menu* menu);
So in another class I have a Menu object which I add other Menu object to, etc.
I have been messing around with both, but when I use the Menu* one I never delete the pointer I created so that should cause a problem. So I get the error when I do Menu::clear which clears the list of child menus. or when I quit the program as in the deconstrutor it also call clear().
Hope this makes it clear. I'll be back home later and look at the code again.
Thanks
Luke
|
|
|
|
|
i had this problem before.
it is because of size of Entities you En/Deque in Queue.
it is not the same value that queue thinks!
for example you Enque 5 Byte Entities But Que try to dequeue 10 Bytes Entities.;P
M.Mehrdad.M
|
|
|
|
|
Hmm ok. Any idea of why this would happen. Or how did you overcome the problem?
Luke
|
|
|
|
|
Hi!
Can anybody help me on how to disable Maximize box of the context menu(upper right hand side of the dialog box) at runtime.
Thanks.
|
|
|
|
|
Disable:
<br />
DWORD d;<br />
d = GetWindowLong(AfxGetApp()->GetMainWnd()->m_hWnd,GWL_STYLE);<br />
d = d & (~WS_MAXIMIZEBOX);<br />
SetWindowLong(AfxGetApp()->GetMainWnd()->m_hWnd,GWL_STYLE,d);
Enable:
<br />
DWORD d;<br />
d = GetWindowLong(AfxGetApp()->GetMainWnd()->m_hWnd,GWL_STYLE);<br />
d = d | WS_MAXIMIZEBOX;<br />
SetWindowLong(AfxGetApp()->GetMainWnd()->m_hWnd,GWL_STYLE,d);<br />
this is this.
|
|
|
|
|
how to open visual c++ that i get from msdn, there is no .dsw exstension, i try to open .vcproj but in can't
can some body help me
|
|
|
|
|
Sounds like you're trying to use VC6 when all the samples now are probably VC2003. There are a lot of changes in between compilers, mostly standards compliance, but most samples would still work I reckon if you create a project and copy the files in. Unless they are MFC, MFC has significant changes also.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I'm still new to VC++6.0.
I have a combobox which is of the dropdown list type.
My problem is whenever you have selected an item and I press "enter" key, this causes my whole application to exit and this is not acceptable as user is still filling the form.
Would appreciate your help on how to stop this?
Urgent need of help.
Thanks.
Regards,
Jap.
|
|
|
|
|
'ESC' is the same as pressing Cancel, and 'RETURN' is the same as pressing OK. Handle OnOk and OnCancel, and suppress the call to the base class if the key is down. GetAsyncKeyState is, from memory, the method to use to do this. You call it twice, as it is buffered. The first call clears the buffer, the second tells you if the key is down.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
THanks! it works already..
|
|
|
|