|
Terminate project ? The processes are detached. Thanks.
RGB
|
|
|
|
|
i try to pass the following global function pointer to a c library function (cvcamSetProperty) which required the third parameter as callback function pointer.
---------------------------------------------
BOOL CXFaceRecognitionDlg::OnInitDialog()
{
//
// some code had been eliminated
//
// making call the the c library function
cvcamSetProperty(0, CVCAM_PROP_CALLBACK, callback2);
}
void callback2(IplImage* image)
{
}
---------------------------------------------
the compilation stage works fine and no problem at all.
however, when i try to pass the member function pointer, it failed
---------------------------------------------
BOOL CXFaceRecognitionDlg::OnInitDialog()
{
//
// some code had been eliminated
//
// making call the the c library function
cvcamSetProperty(0, CVCAM_PROP_CALLBACK, &CXFaceRecognitionDlg::callback);
}
void CXFaceRecognitionDlg::callback(IplImage* image)
{
}
---------------------------------------------
here is the error message which i obtain when i try to compile the above code:
D:\Documents and Settings\Administrator\Desktop\XFaceRecognition\XFaceRecognitionDlg.cpp(144) : error C2664: 'cvcamSetProperty' : cannot convert parameter 3 from 'void (__thiscall CXFaceRecognitionDlg::*)(struct _IplImage *)' to 'void *'
There is no context in which this conversion is possible
may i now how can i solve this problem?
thank you.
regards
yccheok
|
|
|
|
|
I think it should be static function, if it is a member of a class(plus check the actual signature it might need to be __cdecl)
|
|
|
|
|
Declare the callback function as static function of the class
class CXFaceRecognitionDlg:: .......
{
:
static void callback(IplImage* image);
:
}
and i think you should not use the & for the call, just use the static function name :
cvcamSetProperty(0, CVCAM_PROP_CALLBACK, CXFaceRecognitionDlg::callback);
|
|
|
|
|
Hi all,
I'm trying to catch WebBrowserEvents from within the toolband. This is basicaly the code im using, but it doesnt seem to work. Has anyone done this before and/or sees what im doing wrong.
class ATL_NO_VTABLE CToolbar :
public CComObjectRootEx<ccomsinglethreadmodel>,
public CComCoClass<ctoolbar, &clsid_toolbar="">,
public IDeskBand,
public IObjectWithSiteImpl<ctoolbar>,
public IInputObject,
public IDispatchImpl<itoolbar, &iid_itoolbar,="" &libid_guciolib="">,
public IDispEventImpl<0, CToolbar, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 0>
...
BEGIN_SINK_MAP(CToolbar)
SINK_ENTRY_EX(0, DIID_DWebBrowserEvents2, DISPID_ONFULLSCREEN,OnFullScreen)
SINK_ENTRY_EX(0, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2, BeforeNavigate2)
END_SINK_MAP()
...
public:
STDMETHOD(OnFullScreen) (BOOL FullScreen);
STDMETHOD(BeforeNavigate2) (LPDISPATCH pDisp , VARIANT* URL,VARIANT* Flags, VARIANT* TargetFrameName,VARIANT* PostData, VARIANT* Headers, BOOL* Cancel);
...
STDMETHODIMP CToolbar::FullScreen(LPDISPATCH pDisp, VARIANT *URL, VARIANT *Flags, VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, BOOL *Cancel)
{
::MessageBox(NULL,"ONFULLSCREEN event!","IE",MB_OK);
return 0;
}
STDMETHODIMP CToolbar::BeforeNavigate2(LPDISPATCH pDisp, VARIANT *URL, VARIANT *Flags, VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, BOOL *Cancel)
{
::MessageBox(NULL,"ONBEFORENAVIGATE event!","IE",MB_OK);
return 0;
}
Greeting
snajper
|
|
|
|
|
|
Hi all,
how can I customize the botton in the windows function MessageBox()?
Is there a class to do this?
Thanks
Piccinaco
|
|
|
|
|
define "customize the button"
|
|
|
|
|
One solution is to design your own simple message dialogbox.
Kuphryn
|
|
|
|
|
No, you get the standard buttons. If you need custom ones, you'll have to make a separate dialog box.
|
|
|
|
|
There is no "official" way to do so, and most people that tried found it easier to "clone" the windows message box, rather than hooking the existing one.
You find a few imlementations on CP.
Clickety[^]
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Been playing around with DnsQuery() but i can't find a way to convert from IP4_ADDRESS to a string.
Hoping you can help me.
ScorpioMidget
|
|
|
|
|
Microsoft provides functions to retrieve the four bytes of the IP adress. So call them one after another, and use a CString or strcat to concatenate the result.
~RaGE();
|
|
|
|
|
Many thanks, i've got it working now.
ScorpioMidget
|
|
|
|
|
Does gethostbyaddr() or inet_ntoa() work for you?
|
|
|
|
|
Not tried them yet, will have a go in a few minutes.
ScorpioMidget
|
|
|
|
|
I have a question regarding a MSComm Control on a simple dialog form with a thread that exits with an error code 0x1.
A new project created with VC++ 6.0 App Wiz, simple dialog, with a MSComm control and a variable mapped to m_Commm and one command button, OpenClose.
In 'OnOpenClose' place:
m_Comm.SetCommPort(1);
m_Comm.SetPortOpen(true);
// Doesn't seem to matter whether I
// put additional code in here or not.
m_Comm.SetPortOpen(false);
While using an external analyzer, I can see that the port in question is opening and closing, in fact with additional code I can send and receive data through this port, but always when I close the port the debug window shows a message that the thread has closed with error code 0x1. As near as I can tell this corresponds to ERROR_INVALID_FUNCTION.
So my question is; Do I actually have an invalid function, or am I misreading the thread error message?
|
|
|
|
|
I have been using MSComm for a while now, and I don't use the .SetPortOpen(FALSE), just let the destructor close it when the application exits. This works fine when I exit the app then sue Hyperterminal etc..
Elaine
The tigress is here
|
|
|
|
|
i recomment not to use mscomm32.ocx,it sometimes does not work well in windows 2k and windows xp,you can use class CSerialPort that can be download from internet
|
|
|
|
|
Hi all,
Is there any way to enum all DCs in a domain, using ADSI or DS API on a win2000 box ???I have already done this sometime ago using NetServerEnum (NETAPI).
- I´ve found DsGetDcOpen/DsGetDcNext but they require Windows XP or later...
- I´ve tried the "Role Property" for IADSComputer Class, but the WinNT and LDAP providers doesn´t suport it...
Thanks in advance
|
|
|
|
|
Question:
Is it possible to hide and to inactivate a button on a dialogbox if a certain condition has occured?
|
|
|
|
|
ShowWindow(SW_HIDE)
EnableWindow(FALSE)
|
|
|
|
|
get access to the button (or other control) inside the dialog (this is the this in the code !)
if its allready exists as a member var, everythings fine ...
myBnt.EnableWindow( FALSE );
myBnt.ShowWindow( SW_HIDE );
if not get its CWnd-Pointer via the controls resource id :
CWnd* pBnt = this->GetDlgItem( IDC_BUTTON1 );
if(pBnt != NULL) pBnt->EnableWindow( FALSE );
if(pBnt != NULL) pBnt->ShowWindow( SW_HIDE );
|
|
|
|
|
Thanks a lot!
Meanwhile I found that it also seems to work with:
myB.ShowWindow(SW_HIDE); and
myB.ShowWindow(SW_SHOWNORMAL);
Is there a difference between myB.ShowWindow(SW_SHOWNORMAL); and
myB.EnableWindow( FALSE );
Another question:
In my application I do not have any 'OK' or 'Cancel' buttons. But if I press the enter button on my keybord the application terminates... and I don't know why.
|
|
|
|
|
Vassili wrote:
Is there a difference between myB.ShowWindow(SW_SHOWNORMAL); and
myB.EnableWindow( FALSE );
Yes.
Vassili wrote:
In my application I do not have any 'OK' or 'Cancel' buttons. But if I press the enter button on my keybord the application terminates... and I don't know why.
Even though you don't have an OnOK() or OnCancel() handler, the defaults are still being called. They, in turn, call EndDialog().
|
|
|
|