|
It is safe to remove them if you don't want to use VC6 anymore. VS 2002 and later did not use these markers.
|
|
|
|
|
the comment delimiters only used by IDE(vc6.0) , so when you add code manually, you can add code in anywhere. and you can remove the comment delimiters, but the IDE class warized will can't use!
|
|
|
|
|
I'm currently playing around with the Log component of the Boost C++ library. I searched for a DB backend, found nothing but "Does anyone know if Boost::Log can write into a DB?", and hoping that someone on here can answer me that one: Does anyone know if Boost::Log can write into a DB?
The scariest moment is always just before the Start - Stephen King Die Frauen warten auf die Liebe, und die Männer warten auf die Frauen - Wolf Wondratschek
|
|
|
|
|
Dear all:
I try to use hook to detect touch input globally. I using WH_CALLWNDPROC of hook to detect and write in dll. I use hook like this
g_hInstance = AfxGetInstanceHandle();
g_hPreviousHook = SetWindowsHookEx(WH_CALLWNDPROC, &CallWndProc,g_hInstance, 0);
and in my CallWndProc process
LRESULT CALLBACK CallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if(0 > nCode)
return CallNextHookEx(g_hPreviousHook, nCode,
wParam, lParam);
PMSG msg = (PMSG) lParam;
UINT32 pointerId = GET_POINTERID_WPARAM(wParam);
POINTER_INPUT_TYPE pointerType;
return CallNextHookEx(g_hPreviousHook, nCode, wParam,
lParam);
}
when I add the GetPointerType(pointerId, &pointerType) into the code and debug, it will load the dll failed and occur debug assert failed, and jump into appmodul.cpp.Jump into
extern int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, int nCmdShow);
extern "C" int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,_In_ LPTSTR lpCmdLine, int nCmdShow)
#pragma warning(suppress: 4985)
{
return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}
when I disable GetPointerType(pointerId, &pointerType)
, the application work fine. I don't know what happen,
Does anybody try to use this or know why?
Thank for your help, Victor
modified 10-Mar-14 21:54pm.
|
|
|
|
|
You're not installing a mouse hook.
Rather, you're installing a CallWndProc hook.
From this hook proc, you're trying to get the pointer Id from WPARAM .
The documentation of CallWndProc[^] says -
Type: WPARAM
Specifies whether the message was sent by the current thread. If the message was sent by the current thread, it is nonzero; otherwise, it is zero.
I'm guessing you should use MouseProc[^] here.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
I like to use HitTest to identify a splitter pane via mouse.
It is a virtual function / method declared "protected" in base CSplitterWnd class.
I have never used this and have no idea what is the correct syntax.
I would appreciate any help.
Vaclav
Ok I build an override function with instance of base class, but still cannot figure out how to get pass the "protected" virtual function.
-- modified 9-Mar-14 20:16pm.
|
|
|
|
|
Isn't it:
CSplitterWnd::HitTest(blah, blah);
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Nope,
cannot access function declared protected.
|
|
|
|
|
If you (publicly) derive from the base class, you should have access to all protected members of the base class from your derived class. So the start of your class definiton should look like
class MyClass : public CSplitterWnd
If you have a protected in this line instead of the public, it will not work. Also the access will only be available from your derived class, not from any other class that uses an instance of the derived class.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
Thanks,
you found the problem. My splitter is derived from CMDIChildWnd.
I am not sure why, but it works as a splitter OK.
And since I am still using VC6.0 MFC multiple inheritance should work, but that is a ton of work to remove all the ambiguities...
I was going to use HitTest to maximize selected pane, so I better stick with moving splitter bars.
|
|
|
|
|
HitTest is not a function that you call using the instance of a class.
Rather, it is a virtual function that you can override, so that the MFC framework can call it using a base class object reference.
There are other similar virtual functions like OnInitDialog for example.
From the HitTest override, you simply check the point passed in and return one of the HTXXX values.
For example, to move a dialog by clicking and dragging anywhere on it, just like its caption, you simply return HTCAPTION from the overridden HitTest method of the CDialog derived class.
This is how it will be called internally -
class CMyFramework
{
public:
void foo() { this->bar(); }
protected:
virtual void bar() { }
};
class COne : public CMyFramework { };
class CTwo : public COne { };
class CTen : public CNine
{
protected:
virtual void bar()
{
cout << "MyBar" << endl;
}
};
The framework simply calls the CMyFramework::foo method and it will call CTen::bar because it is virtual.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
modified 10-Mar-14 11:31am.
|
|
|
|
|
Standard MFC MDI adds new view(s) to “Window” menu submenu.
Could someone give me a hint how is it accomplished when the application starts?
I am little familiar with dynamic menu / submenu operation but I cannot find how it gets started in creation of submenu under “Window” menu item. I did not get very far tracing the creation of the main frame.
Any help will be as always appreciated.
Cheers
|
|
|
|
|
|
Thanks Richard,
I know about InsertMenuItem, I was looking for where in the initial setup is it used and I found it.
As far as CTabbedPane I have made two decisions - if I get an income from my programming hobby I'll spring for the latest MS VS or I'll ditch my VC6.0 and start over using Linux.
Just for illustration - I did checked MS site for "2013 requirements" and my IE locked up. Unless I am wrong - MS express / semifree stuff does not come with MFC.
|
|
|
|
|
True, MFC is not provided free with the Express editions. However, if you decide to switch to C# you get the complete .NET development library, which provides everything that MFC does, and more.
|
|
|
|
|
But ... don't I have to "upgrade" to windows x.y to keep the .NET current? If so it is still spending $ on this hobby which I could use on bying beer.
|
|
|
|
|
Your choice, of course. Stick with whichever technology you prefer.
|
|
|
|
|
Hi, if Key-Value pairs are like:
40000 "40000 is a first number"
41020 "41020 is a second number"
....
use CMapStringToString or CMap<int,int,string,string> to store.
Then which one is better in look up efficiency?
CMapStringToString or CMap<int,int,string,string>
|
|
|
|
|
econy wrote: Then which one is better in look up efficiency? I don't know, but I cannot imagine having to convert between ints and CStrings just to use the CMapStringToString could possibly be worth it, I would start with the CMap.
|
|
|
|
|
Why don't you test that?
Veni, vidi, vici.
|
|
|
|
|
Lookup requires comparing keys, i. e. calling the operator < and maybe operator == . Since these operators are more efficient for ints than they are for strings, I suspect that CMap is better. However, the rest of the looking-up algorithm that does not involve comparing keys may play a much more significant role on performance overall, so you might not notice a difference.
You should also consider whether there are other operations than looking up which are called often, e. g. insertion, removal, converting keys to different formats, etc.: E. g. if you spend a lot of time reading keys from a text source or writing them as text, then it may be advisable to just stick with string keys rather than converting them back and forth all the time!
|
|
|
|
|
Hi
I got handle to Grid Control of window of another ( external ) application. Used EnumChildWindows for getting child window handle.
But I am unable to read text from that grid control.
Can anyone provide any pointers for this ? Thanks in Advance.
|
|
|
|
|
The WM_GETTEXT message will only return the text of the window whose handle you provide. It will not include the content of child windows, as exist in a grid control.
|
|
|
|
|
Hi, am building a GUI MFC application, I have several toolbars in my application, i want my toolbars to auto align according to my application frame width, the code i have been tried is given below. By this code the toolbar is simply align in a single row. what should i do to reach my goal? thanks in advance
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
tb1.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
tb4.EnableDocking(CBRS_ALIGN_ANY);
tb8.EnableDocking(CBRS_ALIGN_ANY);
tb9.EnableDocking(CBRS_ALIGN_ANY);
tb2.EnableDocking(CBRS_ALIGN_ANY);
tb3.EnableDocking(CBRS_ALIGN_ANY);
tb6.EnableDocking(CBRS_ALIGN_ANY);
tb7.EnableDocki:confused:ng(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&tb9);
DockPaneLeftOf(&tb8, &tb9);
DockPaneLeftOf(&tb4, &tb8);
DockPaneLeftOf(&m_wndToolBar, &tb4);
DockPaneLeftOf(&tb1, &m_wndToolBar);
DockPaneLeftOf(&tb7, &tb1);
DockPaneLeftOf(&tb6, &tb7);
DockPaneLeftOf(&tb3, &tb6);
DockPaneLeftOf(&tb2, &tb3);
A learner
|
|
|
|
|
Your intention is not totally clear, can you try and explain better what you are trying to do and what is not working ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what is used to.
|
|
|
|
|