|
Maybe you should try a "specialization" of template classes? I suppose it may look like this:
template< class BASE >
class COMMON : public BASE
{
. . .
};
template< class BASE >
class CLASS : public COMMON< BASE >
{
};
template< >
class CLASS< CDialog > : public COMMON< CDialog >
{
. . .
};
template< >
class CLASS< CFormView > : public COMMON< CFormView >
{
. . .
};
Usage:
CLASS< CDialog > dlg;
CLASS< CFormView > form;
I hope this works.
|
|
|
|
|
I already figured but thanks, anyway.
Anybody dealing with the same issue should know to have all the specialized functions inline in the header file if want to get rid of LNK2006 errors..
|
|
|
|
|
Hi to all,
I am compiling DirectX 9.0 SDK Sample Code Filter in VC6, it is compiling successfully. (Filter is DSNetwork Filter)
But when same code I compile in VC++ 2005, it is showing errors (as follows),
1. fatal error C1083: Cannot open source file: 'c:\DXSDK\Samples\C++\DirectShow\Filters\Change': No such file or directory c1
2. command line error MIDL1003 : error returned by the C preprocessor (2) midl
3. error PRJ0019: A tool returned an error code from "Performing Custom Build Step" dsnetifc
4. error BK1506 : cannot open file '.\Debug_Unicode\dsnetifc_i.sbr': No such file or directory BSCMAKE
5. error C2146: syntax error : missing ';' before identifier 'PVOID64' C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h 222
6. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h 222
7. error C2146: syntax error : missing ';' before identifier 'Buffer' C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h 5940
& many more..
plz. help me.
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
Try this:
Go to Tools->Options->Project and solutions -> VC++ Directories
Show library files -> Library files
At top include
D:\DXSDK\Samples\C++\DirectShow\BaseClasses\Release(or Debug)
at last
D:\DXSDK\lib
Show library files -> Include files
At last
D:\DXSDK\Include\DShowIDL
D:\DXSDK\Include
D:\DXSDK\Samples\C++\DirectShow\BaseClasses
Regards
Amar
|
|
|
|
|
pls help me for the sln
how to find out
whether the Directory is persent or Not(C drive or D Drive)
is there any API available in C++?
|
|
|
|
|
What exactly u want. To find the Directory or Drive?
Come online at:-
fitiyal@yahoo.com
|
|
|
|
|
1)To find the Drive?
2) To Find out Directory?
|
|
|
|
|
Use FindFirstFile()
Come online at:-
fitiyal@yahoo.com
|
|
|
|
|
You can use good old _stat() or _access()
|
|
|
|
|
use
PathFileExists()
nave
|
|
|
|
|
Use GetFileAttributes() to determine the presence of a file or directory.
|
|
|
|
|
See
<br />
BOOL o=PathFileExists("d:\\mp");
WIN32_FIND_DATA lp;<br />
<br />
HANDLE handle=FindFirstFile("d:\\mp",&lp);
CloseHandle(handle);<br />
|
|
|
|
|
Hello
i work on CTI sofwtare with TAPI 3 and i catch all events from a line.
But, i have a HRESULT fail on the get_CallInfoString function when there are a event:
function used for Event form TAPI_EVENT.TE_CALLINFOCHANGE:
private void OnCallInfoEvent(ITCallInfoChangeEvent pEvent)
{
try....
string callerIDName = pEvent.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLERIDNAME);
string callerIDNumber = pEvent.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLERIDNUMBER);
catch....
finally
}
Thanks Jerome
|
|
|
|
|
Hello,
Does anyone know a few tricks to make Edit controls behave like "smart labels"? That is; I want them to be read-only, but not have a caret. It's nice being able to copy the text using Ctrl+C, something which a simple static control cannot offer.
I assume there is a simple subclassing trick you can do. If you know it, feel free to tell me.
--
Behold, for I am THE CORRUPTOR!
|
|
|
|
|
What about the other way round, implement copy operation on a CStatic ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
How do you select text in a static?
--
Behold, for I am THE CORRUPTOR!
|
|
|
|
|
Hi,
I have a give a CString value from one class to Editcontrol of another class.
Example- In GrpView.cpp,
CString Strnum = "123";
I have to put this value in Dialog.cpp ,in Edit control of that particular dialog.
Can we do this like this,Is there any way?Pls help me
Anu
|
|
|
|
|
hi,
In the CDialog Class Declare a CString Variable and also in the View Class when you populate the CDialog Class.
CView Class
CDialogInstance dlg;
dlg.strNameValue = strViewClassString;
dlg.DoModel();
Good Luck.
Uday kiran
|
|
|
|
|
Do your dialogs have a parent child relationship.
If affirmative you can use
GetParent();
else
you will need to pass a pointer of your class in another class and after that you can start using the variable/s / data of one class from another.
eg :
CMyDialog *myDlg=new CMyDialog();
myDlg->m_pParent=this;
myDlg->DoModal();
and in the header file of the child include the dialogs header file(for calling class.)and declare CMyFirstDialog m_pParent;
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
See here if its good for you
<br />
(1)<br />
CDialogyour dlg;<br />
dlg.strNameValue = String;<br />
dlg.DoModel();<br />
-------------------<br />
(2)
CMain* m_Main=(CMain*)GetParent();<br />
m_Main->values or functions<br />
-------------------<br />
(3)<br />
CMain *m_Main;<br />
m_Main=new CMain();<br />
m_Main.Create(...);
m_Main.yourvariable=Values;<br />
--------------------<br />
|
|
|
|
|
Thanks but its not fulfil my need..I have a seperate keyboard other than our system keyboard.
I have class for that as keyboard.cpp,if i press 1 in that keyboard it goes to WM_KEYDOWn in that class and it goes to OnKEyDown in that particular CView class which one is active,but the number should typed in Edit control of dialog which is invoked by clicking the view window.
The WM_KEYDOWn function only goes to avtive View CGrpView and not to that particular dialog.So,i thought to get that all values which are entered in seperate keyboard in to CString and then give this CString value to Edit control..
My Objective is : when i pressed 1 in seperate keyboard it should get entered in that edit box in the dialog..
Anu
|
|
|
|
|
I have problems following you, but maybe what you need is something completly different and is more along the lines of a "focus follows mouse" setting for the whole Windows-Gui?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
You want when you click 1 it insert to edit and run wm_keydwon,right?
|
|
|
|
|
Yes, when i clicked 1 it goes to keyboard.cpp,ther i wrote
void CKBoard::OnLButtonUp(UINT nFlags, CPoint point)
{
case 51 :
ActiveView->PostMessage(WM_KEYDOWN,49,0); break;
}
It executes the line and then it goes to OnkeyDown() in that particular dialog,their i wrote..
void CFaceDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
case 49:
case 97:
sSktNumValue += "1";
break;
}
This is coding..when i debugged this coding the control after executing WM_KEYDOWN...It should go to Onkeydown() in that dialog..But the control goes to OnKEyDown() in te particular view where the dialog exist...So i wrote the codings of Dialog OnKeyDown() in to THat view class OnKeyDown() function.
Thats im asking is there anyway to get value which i pressed in keyboard go to dialog OnKeyDown or the control goes as it is View class OnKeyDown()but the final value should entered in that particular Dialog edit box...
Pls give any solution..
Anu
|
|
|
|
|
WM_CHAR isnt good for you
|
|
|
|