|
Hi Michael, I know close to zero about tracking tooltips, but found this article about them with seemingly good stuff on the subject. First thing that caught my eye is the guy sends the two messages TTM_TRACKPOSITION and TTM_TRACKACTIVATE in reversed order than you. Could this make a difference?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
I have a few classes I want to put in a DLL. These class and resources uses other side classes. Now, if I include these side classes with the main classes, and then in my prohgram that I want to link the DLL to also have these classes (because they are like CButtonXX and other types) what will happen?
How should I be strcuturing something like this? All my classes and dialogs rely on the same inherited Button, label ect classes. So the big if is if I have TWO DLL that has two diff ... that both rely on these side classes. Now what will happen if I want to link them to a project?
Thanks in advance.
|
|
|
|
|
My guess is you won't have any problem with the scenario you describe, apart from some bloat due to the duplication of CButtonXX code. For added safety, make sure none of the classes exported has any method inline (i.e. defined inside the class declaration), so you will rest asure each part uses its own CButtonXX instantiation.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Without changing anything I can no longer compile. It looks like I'm missing some library or something. Does anyone have any ideas? Here's my error messages.
nafxcwd.lib(strcore.obj) : warning LNK4006: "void __stdcall
SerializeElements(class CArchive &,class ATL::CStringT<char,class
StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > *,int)"
(?SerializeElements@@YGXAAVCArchive@@PAV?$CStringT@DV?$StrTraitMFC@DV?$ChTra
itsCRT@D@ATL@@@@@ATL@@H@Z) already defined in CCrystalTextHelper.obj; second
definition ignored
CCrystalTextHelper.obj : error LNK2019: unresolved external symbol
"protected: class CMap<int,int,unsigned long,unsigned long>::CAssoc *
__thiscall CMap<int,int,unsigned long,unsigned
long>::GetAssocAt(int,unsigned int &,unsigned int &)const "
(?GetAssocAt@?$CMap@HHKK@@IBEPAVCAssoc@1@HAAI0@Z) referenced in function
"public: int __thiscall CMap<int,int,unsigned long,unsigned
long>::Lookup(int,unsigned long &)const " (?Lookup@?$CMap@HHKK@@QBEHHAAK@Z)
CrystalEditorColorsDlg.obj : error LNK2001: unresolved external symbol
"protected: class CMap<int,int,unsigned long,unsigned long>::CAssoc *
__thiscall CMap<int,int,unsigned long,unsigned
long>::GetAssocAt(int,unsigned int &,unsigned int &)const "
(?GetAssocAt@?$CMap@HHKK@@IBEPAVCAssoc@1@HAAI0@Z)
SyntaxOptions.obj : error LNK2001: unresolved external symbol "protected:
class CMap<int,int,unsigned long,unsigned long>::CAssoc * __thiscall
CMap<int,int,unsigned long,unsigned long>::GetAssocAt(int,unsigned int
&,unsigned int &)const " (?GetAssocAt@?$CMap@HHKK@@IBEPAVCAssoc@1@HAAI0@Z)
CrystalEditorColorsPropPage.obj : error LNK2001: unresolved external symbol
"protected: class CMap<int,int,unsigned long,unsigned long>::CAssoc *
__thiscall CMap<int,int,unsigned long,unsigned
long>::GetAssocAt(int,unsigned int &,unsigned int &)const "
(?GetAssocAt@?$CMap@HHKK@@IBEPAVCAssoc@1@HAAI0@Z)
CCrystalTextHelper.obj : error LNK2019: unresolved external symbol
"protected: class CMap<class ATL::CStringT<char,class StrTraitMFC<char,class
ATL::ChTraitsCRT<char> > >,char const *,class CKeywordList *,class
CKeywordList *>::CAssoc * __thiscall CMap<class ATL::CStringT<char,class
StrTraitMFC<char,class ATL::ChTraitsCRT<char> > >,char const *,class
CKeywordList *,class CKeywordList *>::GetAssocAt(char const *,unsigned int
&,unsigned int &)const "
(?GetAssocAt@?$CMap@V?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@AT
L@@PBDPAVCKeywordList@@PAV3@@@IBEPAVCAssoc@1@PBDAAI1@Z) referenced in
function "public: class CKeywordList * & __thiscall CMap<class
ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> >
>,char const *,class CKeywordList *,class CKeywordList *>::operator[](char
const *)"
(??A?$CMap@V?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@PBDPAV
CKeywordList@@PAV3@@@QAEAAPAVCKeywordList@@PBD@Z)
Thanks.
|
|
|
|
|
Hmmm, have you tried a "Rebuild All"?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
yes - i've tried it. i've even reinstalled vc7 but i think i'm not linking to some library that should be. i don't know what's happened. it's like my lib is gone - the problem is, i'm not sure which lib it is.
|
|
|
|
|
Hello, the codegurus around the world.;)
Error message says that you can compile the code, but not link the library
needed.
So, try to check your setting of how to find the library path and so on.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
dear all,
how can i restrict multiple instance of
an exe?
please.......
anju
|
|
|
|
|
Run it on a very small computer...
... or, check J.M.Newcomers (IIRC) exellent article (here on CP), or, search this forum for CreateMutex and you'll get some tips.
|
|
|
|
|
ROFLMAO
<centre>
"Never tell people how to do things. Tell them what to do, and they will surprise you with their ingenuity." - General George S. Patton Jr.
|
|
|
|
|
No - seriously - this Newcomer guy is good!
|
|
|
|
|
Create a named mutex object when your app starts up. In your second app, if another mutex exists with that name, then exit the program. This is how VB implements their version of this.
|
|
|
|
|
kilowatt wrote:
This is how VB implements their version of this.
I didnt know that. How is it done from VB?
Nish
Oh, I don't know why she's
leaving, or where she's gonna go
I guess she's got her reasons but I just don't wanna know
'Cos for 24 years I've been living next door to Alice
24 years just waitin' for a chance
To tell her how I feel and maybe get a second glance
Now I gotta get used to not living next door to Alice
|
|
|
|
|
kilowatt wrote:
This is how VB implements their version of this.
I didnt know that. How is it done from VB?
Forget about it! Even if this is the "offical" way to do it, it has some bad limitations, especially in NTs multiuser/multidesktop environment. I strongly recommend to read the excellent article from Joseph which shows everything about this topic. Some ready to use C-Code can that takes account of this problems can be found here.
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
I think Nish was simply asking how you get access to the previous instance feature in VB. I don't think that just because VB implements it this way, that says this is the "official" way to do it.
|
|
|
|
|
You reference the app object and test the hPrevInstance variable. It will return true if there is an previous instance of the app, false if there is not.
If (App.PrevInstance) Then
MsgBox "Previous Instance Found"
Else
MsgBox "No Previous Instance"
End If
Basically this feature is implemented internally with the named mutex as I mentioned earlier in the thread.
|
|
|
|
|
This is what I use.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
create a static instance for a type
ex: static CMyClass *pInstance;
// you need to initialize it...
CMyClass *CMyClass::pinstance = NULL;
add the following functions
// constructing the object
CMyClass *CMyClass::GetInstance()
{
if(pInstance== NULL)
pInstance = new CMyClass;
return pInstance;
}
// destructing the object
void CSystemManager::DeleteInstance()
{
if( pInstance)
delete pInstance;
pInstance = NULL;
}
apart from constructor and destructor...
Now... you can happily access the singleton thro GetInstance() function.
call DeleteInstance() when you are done with that.
-anu
|
|
|
|
|
ihave a probelm, i got a property sheet and some property pages, when i try to add controls like buttons or whatever, the program crashes, could it be that i'm using the property page in a dockable toolbar ? there are no memory leaks anyway, i don't know how to solve it.
|
|
|
|
|
|
maybe the idea is stupid
class CBookFormatsDlg : public CDialog
{
// Construction
public:
CBookFormatsDlg(CWordFormat *pWordFormat = NULL,UINT nDlgIDD = IDD_BOOK_FORMATS,CWnd* pParent = NULL); // standard constructor
virtual ~CBookFormatsDlg();
// Dialog Data
//{{AFX_DATA(CBookFormatsDlg)
enum { IDD = IDD_BOOK_FORMATS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
CPropertySheet* m_dlgPropSheet;
CTitleSet* m_pTitleSet;
CPageSet* m_pPageSet;
COtherSet* m_pOtherSet;
// ....
};
--------------------------------------------------------------------------------------------------
CBookFormatsDlg::CBookFormatsDlg(CWordFormat *pWordFormat,UINT nDlgIDD,CWnd* pParent /*=NULL*/)
: CDialog(nDlgIDD, pParent)
{
//{{AFX_DATA_INIT(CBookFormatsDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_dlgPropSheet = new CPropertySheet();
m_pTitleSet = new CTitleSet();
m_pPageSet = new CPageSet();
m_pOtherSet = new COtherSet();
m_pWFormat = pWordFormat;
m_pWordFormats = &(((CTdbookApp *)AfxGetApp())->m_sysWordFormats);
m_nPreSelIndex = -1;
m_nSelFormatID = -1;
}
CBookFormatsDlg::~CBookFormatsDlg()
{
if( m_pTitleSet != NULL)
delete m_pTitleSet;
if( m_pPageSet != NULL)
delete m_pPageSet;
if( m_pOtherSet != NULL)
delete m_pOtherSet;
if( m_dlgPropSheet != NULL)
delete m_dlgPropSheet;
}
BOOL CBookFormatsDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// ...
m_dlgPropSheet->AddPage(m_pTitleSet);
m_dlgPropSheet->AddPage(m_pPageSet);
m_dlgPropSheet->AddPage(m_pOtherSet);
m_dlgPropSheet->Create(this, WS_CHILD | WS_VISIBLE, 0);
m_dlgPropSheet->ModifyStyle(0, WS_TABSTOP);
m_dlgPropSheet->ModifyStyleEx(0, WS_EX_CONTROLPARENT);
CRect rcSheet;
CWnd *pWnd = GetDlgItem(IDC_SHEETS);
if( pWnd != NULL )
{
pWnd->GetWindowRect(&rcSheet);
ScreenToClient(rcSheet);
}
else
GetWindowRect(&rcSheet);
m_dlgPropSheet->SetWindowPos(NULL, rcSheet.left-4, rcSheet.top-4, rcSheet.Width(), rcSheet.Height(),
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
m_dlgPropSheet->SetActivePage(0);
// ....
return TRUE;
}
|
|
|
|
|
I am trying to make a keyinput dialog which can then send input to any Cwnd. I had seen a keyboard project on Cp but there was one problem that it could not enter things into a child of a child because it was within the dialog.
Thus I am exploring the Attachthreadinput myself. What I don't understand is if this dialog has the CWnd of the edit or ... in another running program through maybe WM_COPYDATA, do I really need the Attachthreadinput call? What if I just send WM_COPYDATA back and forth with the keys pressed? Would this be good?
If I want to use the attachthreadinput, where would I really put this? I want to be able to get to the nested CWnd inside a dialog or View.
Thanks.
|
|
|
|
|
When I use
ATD(number)
to connect another modem (use in HyperTerminal).
I can not send command to modem because it send command as data to another modem.
And how can I use AT command to switch modem to voice mode? Can I use 2 modem to talk together?
lenhan
|
|
|
|
|
How can I get an event when modem connect to internet?
I want to write a application that execute immediately after connect to Intenet.
lenhan
|
|
|
|
|