|
Hello all
I'm trying to enable context sensitive help for cproperty sheet. I created a Dialog project by select "Use context sensitive help" from appwizard. I added a button to the Dialog and written the following handler.
MyDialog::OnClick()
{
MyPropertySheet sheet("SampleSheet");
sheet.AddPage(new MyPropertyPage());
sheet.DoModal();
}
when click event is occured it shows up propertypage and if I click "Help" button or f1 key I'm getting "Help topic does not exist, contact application vendor".
I edited the afxDlg.rtf and added the following
#HIDD_MYSHEET This is mysheet help
<page-break>
HIDD_MYHEET id defined in .hm file.
I also added an entry in .hpj file under map section like
#define HIDD_MYSHEET <value defined="" in="" .hm="" file="">
I'm not able to figure out where I'm doing wrong. if any one knows how to do enable help for the propertysheet please help me.
Many thanks for your help.
Hari.
|
|
|
|
|
Try calling ModifyStyleEx(0, WS_EX_CONTEXTHELP) in your CPropertySheet's OnInitDialog.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Hello HPSI
thanks for the reply. I tried it but I'm getting the same error . Any idea how to solve.
Thanks
Hari.
|
|
|
|
|
Hi
I've copied a .exe file of around 4MB to another computer to test the program out there.
That computer is on WinNT4, P4 2.4Ghz, 256 MB RAM (SP6)
I tried to open the .exe file, works great on Win2k, XP and alsoo on NT4 SP1. (The NT4 computer is a virtual one, vmware usage .. just for testing purposes)
Now, i get an error :'Program too big to fit in memory' when i try to open the file.
What is the problem and how can i solve it?
Greetings
Jens
|
|
|
|
|
Hi The tool tips for my tree control remain on my dlg and any other window behind my dlg untill i minimize my dlg or select another window how can i fix this
also i have a group box that creates the sunken look for my custom tree control how do i stop it from showing through my tree control without losihng that sunken look
thanks
|
|
|
|
|
Hi,
try to change tree control style.
|
|
|
|
|
Marissa182 wrote:
i have a group box that creates the sunken look for my custom tree control how do i stop it from showing through my tree control without losihng that sunken look
Hide the groupbox (ShowWindow(SW_HIDE)) and use CreateEx:
GetDlgItem(IDC_ZONETREE_FRAME)->ShowWindow(SW_HIDE);
CRect frameRect;
GetDlgItem(IDC_ZONETREE_FRAME)->GetWindowRect(frameRect);
ScreenToClient(&frameRect);
DWORD dwStyle = WS_CHILD|WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_SHOWSELALWAYS|TVS_HASBUTTONS;
zone_tree.CreateEx(WS_EX_CLIENTEDGE, "SysTreeView32", "mytree", dwStyle,
frameRect, this, IDC_ZONETREE);
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Now I meet several problems
1.virtual void operator()(const char* string)=0; // call using operator
2.template <class TClass> class TSpecificFunctor : public TFunctor
//TFunctor is a class
3.TSpecificFunctor<TClassA> specFuncA(&objA, TClassA::Display);
4.TFunctor** vTable = new TFunctor*[2];
5.delete[] vTable;
6.(*vTable[1]) ("TClassB::Display called!"); // via operator "()"
//Why is Table[1]" put into the bracket?
Can you tell me their meaning?
Thank you in advance!
The following codes you can refer:
// This code was compiled and tested with Borland C++ Builder 5.0. Let me know
// if there is something I should mention for the use with other compilers.
#pragma hdrstop // Borland C++ Builder specific
#pragma argsused // do.
#include <iostream.h> // due to: cout
// abstract base class
class TFunctor
{
public:
// two possible functions to call member function. virtual cause derived
// classes will use a pointer to an object and a pointer to a member function
// to make the function call
virtual void operator()(const char* string)=0; // call using operator
virtual void Call(const char* string)=0; // call using function
};
// derived template class
template <class TClass> class TSpecificFunctor : public TFunctor
{
private:
void (TClass::*fpt)(const char*); // pointer to member function
TClass* pt2Object; // pointer to object
public:
// constructor - takes pointer to an object and pointer to a member and stores
// them in two private variables
TSpecificFunctor(TClass* _pt2Object, void(TClass::*_fpt)(const char*))
{ pt2Object = _pt2Object; fpt=_fpt; };
// override operator "()"
virtual void operator()(const char* string)
{ (*pt2Object.*fpt)(string);}; // execute member function
// override function "Call"
virtual void Call(const char* string)
{ (*pt2Object.*fpt)(string);}; // execute member function
};
//-----------------------------------------------------------------------------------------
// 4.3 Example of How to Use Functors
// dummy class A
class TClassA{
public:
TClassA(){};
void Display(const char* text) { cout << text << endl; };
/* more of TClassA */
};
// dummy class B
class TClassB{
public:
TClassB(){};
void Display(const char* text) { cout << text << endl; };
/* more of TClassB */
};
// main program
int main(int argc, char* argv[])
{
// 1. instantiate objects of TClassA and TClassB
TClassA objA;
TClassB objB;
// 2. instantiate TSpecificFunctor objects ...
// a ) functor which encapsulates pointer to object and to member of TClassA
TSpecificFunctor<TClassA> specFuncA(&objA, TClassA::Display);
// b) functor which encapsulates pointer to object and to member of TClassB
TSpecificFunctor<TClassB> specFuncB(&objB, &TClassB::Display);
// 3. create array with pointers to TFunctor, the base class and ...
TFunctor** vTable = new TFunctor*[2];
// ... assign functor addresses to the function pointer array
vTable[0] = &specFuncA;
vTable[1] = &specFuncB;
// 4. use array to call member functions without the need of an object
vTable[0]->Call("TClassA::Display called!"); // via function "Call"
(*vTable[1]) ("TClassB::Display called!"); // via operator "()"
// 5. release
delete[] vTable;
// hit enter to terminate
cout << endl << "Hit Enter to terminate!" << endl;
cin.get();
return 0;
}
|
|
|
|
|
Aleon666 wrote:
virtual void operator()(const char* string)=0;
This is a pure-virtual function. It has no definition, and must be implemented in a derived class.
Aleon666 wrote:
template <class TClass> class TSpecificFunctor : public TFunctor
This is a template class defintion. It allows a class to be customised using varying parameter - it's a template for producing more specialised classes.
Aleon666 wrote:
TSpecificFunctor<tclassa> specFuncA(&objA, TClassA::Display);
This creates an instance of the TSpecificFunctor class that has been specialised with the parameter "TClassA "
Aleon666 wrote:
TFunctor** vTable = new TFunctor*[2];
This creates an array of 2 pointers to TFunctor objects.
Aleon666 wrote:
delete[] vTable;
This deletes the array of pointers to TFunctor objects created above.
Aleon666 wrote:
(*vTable[1])("TClassB::Display called!");
"*vTable[1] " is put in brackets so that the "*" would apply to the vTable[1] part. It needs to be there because vTable[1] is a pointer to a TFunctor , but the object itself is needed - it must be dereferenced first. If the brackets were not there, the code would not compile because it will try to call
vTable[1]("TClassB::Display called!"); which is non-valid code because vTable[1] is a pointer.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thank you very much!
I have been illuminated by you.
Thanks again
Today is valentine's day for our chinese people
Will you send some presents to your lover if he/she is in China
|
|
|
|
|
You're welcome
Aleon666 wrote:
Today is valentine's day for our chinese people
Will you send some presents to your lover if he/she is in China
Nope, she's in Australia
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello all,
I just built a small program to log SMB connects. Using NetFileEnum I can pretty much log which user opens which directories and which files. But now I want to link this information to the host PC of the user. I can get all the users with their PCs using NetSessionEnum, but I can't link both.
Situation;
I have a public account on a big network, called LAN. Now with the thing I built I can see which files and dirs are opened by user LAN, yet I can't see from which PC it comes. And user LAN can be logged in from loads of PCs at the same time. I can use NetSessionEnum to get the PCs, but then I can't link it to the files they opened.
Does anyone have any idea how I can get this information full?
Thanks,
- Fahr
|
|
|
|
|
have class?where?
thanks!
|
|
|
|
|
http://www.fmod.org
Free for non-commercial use...
Kochise
In Cod we trust !
|
|
|
|
|
|
Hi, I would like to disable displaying "..." suffix when text in ListView column header is longer that header's current width. For example Total Commander does it. Is there any way?
Thanks in advance.
|
|
|
|
|
You can't, it's hard-coded, it all depends on the wish of the coder who added to "..." or not...
Kochise
PS : Total Commander is great, I use it anywhere, home, office, ...
In Cod we trust !
|
|
|
|
|
I want a modal dialog box to perform some automatic tasks after it is shown on the screen. In that tasks there can also appear a messagebox, so if I use the Windows Message OnSetFocus(), the messagebox will keep coming up, because every time the user clicks OK on the message box, the dialog gets his focus. Is there a way to achieve this?
Thnxx
|
|
|
|
|
harmendejong wrote:
I want a modal dialog box to perform some automatic tasks after it is shown on the screen.
Near the end of OnInitDialog() , just post a message to the dialog.
|
|
|
|
|
At the end of your OnInitDialog function, post a custom message to your dialog using PostMessage. The code in your handler will be executed after your dialog is displayed.
#define WMU_MYCUSTOMMESSAGE WM_APP + 1
...
ON_MESSAGE(WMU_MYCUSTOMMESSAGE, OnMyCustomMessage)
...
BOOL CMyDialog::OnInitDialog()
{
...
PostMessage (WMU_MYCUSTOMMESSAGE, 0, 0);
return FALSE;
}
...
void CMyDialog::OnMyCustomMessage(LPARAM, WPARAM)
{
}
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi, guys:
First time for me posting here, forgive my rudeness or other unwelcomed.
I'm repairing a software with several dll's. My duty is to cut down any dll and import anything in them into main source code.
Are there any articles on this topic or some advice ?
TIA
-gusd
|
|
|
|
|
I've done this several times and the most effective way has been to convert the DLLs into libraries.
First, get a list of all the files in the project (it's not unusual to have some files in the directory which aren't actually in the project.)
Second, remove the DllInit function. Usually you don't need to replace it with anything since it doesn't do anything. If it does, you can often create a small private class and instantiate it globally. If that won't work, simply add Init() and DeInit() functions then call them from the main program in the proper manner and sequence.
DO NOT get fancy at this point. It's a huge temptation, but one you must resist.
Third, fix up the headers. You don't need the "dllimport"/"dllexport", etc stuff. (Nor do you need the .def file.) Add #pragma comment(lib, "put library name here.lib") to the header.
Fourth. Ensure the libraries are subprojects of the master project. Add the subprojects to the master. Set the dependencies and paths and you're off!
Fifth, oh, and go through the main project to ensure you aren't "manually" loading the DLLs or accessing them through a pointer or other such strangeness.
|
|
|
|
|
Hi all
I create internal control in my ATL project and i want
call it IpersistStreamInitImpl::Load(LPSTREAM pStream) method immediatly but how i can recognize what pStream used this control????
Thanks
|
|
|
|
|
I'm trying to serialize a class that I've derived from CArray. It's just an array of CString objects:
class CFormList : public CArray<CString, CString&> {
DECLARE_SERIAL(CFormList);
...
}
Then I include the IMPLEMENT_SERIAL macro:
IMPLEMENT_SERIAL(CFormList, CArray, 1);
When I compile I'm getting this error:
error C2955: 'CArray' : use of class template requires template argument list
I've also tried changing the IMPLEMENT_SERIAL line to this:
IMPLEMENT_SERIAL( CFormList, CArray<CString, CString&> );
But that give me this compile error:
warning C4002: too many actual parameters for macro 'IMPLEMENT_SERIAL'
error C2039: 'classCArray' : is not a member of 'CString'
I'm totally at a loss for why I'm getting these errors . Has anyone else seen this?
Thanks,
Mike Ellertson
|
|
|
|
|
It's a limitation of the macro expansion capability of the preprocessor. The preprocessor splits the parameters where it sees commas. It does not parse its parameters at all. Basically, what it means is that the only way you can do this is to get the MFC source definitions for IMPLEMENT_SERIAL() and code it directly, rather than using the macro.
It's a pain in the neck, but the only way, I'm afraid.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|