|
Usually you can pass a pointer on your main window to the callback function. If the parameter of the callback function is LPVOID, you will have to typecast it to your window type.
if it looks like
CMyDialog::callbackfunction(... , LPVOID pointer)
use it like this :
callbackfuntionc(...,this);
and in the function
CMyDialog::callbackfunction(... , LPVOID pointer)
{
CMyDialog *pMain=(CMyDialog*)pointer;
pMain->m_variable=0;
}
~RaGE();
|
|
|
|
|
static function can not access non-static members.
Look at the Code Project FAQs for anouther way to implement callback functions.
INTP
|
|
|
|
|
You can define a static varible member in the class including callback function
if something has happened you can change the varible
of course it is an indirect way.
|
|
|
|
|
Boost can let you do this. Here's a starting point, but for a much better example download boost and look at the sample code for boost::thread
http://www.codeproject.com/vcpp/stl/boostintro.asp#xx563708xx[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
This is standard C++ stuff which you should find in any good C++ Reference book.
Here is a code snippet:
class CBookmarks
{
public:
void ScanBookmarks( void (CBookmarks::*Scan_Func)( const BMRK, const ulong, const ulong ), const ulong var1, const ulong var2, const LN_NUM ln_num );
};
void
CBookmarks::ScanBookmarks( void (CBookmarks::*Scan_Func)( const BMRK, const ulong, const ulong ), const ulong var1, const ulong var2, const LN_NUM ln_num )
{
}
bits
CBookmarks::ClmChanged( const LN_NUM ln_num, const LN_CLM clm, const int dir )
{
m_changed_bookmarks = 0x00;
ScanBookmarks( _ClmChanged, clm, dir, ln_num );
return m_changed_bookmarks;
}
void
CBookmarks::_ClmChanged( const BMRK mp, const LN_CLM clm, const ulong dir )
{
if ( mp->m_ln_clm >= clm )
{
mp->m_ln_clm += dir;
MASKON( mp->m_status, MOVED );
BITON( m_changed_bookmarks, mp - m_bookmarks );
mp->m_ln_oclm = MARK_OFF;
}
}
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I created two projects, whose names are same
How to know their pathes respectively
(VC6)
|
|
|
|
|
U can use GetModuleFileName
Arjan.
|
|
|
|
|
Hi,
use GetModuleFileName(NULL, Buffer, BufferLength);
Regards
Frank
|
|
|
|
|
Yeah,
sorry
but you have mistaken my meaning
I want to know the path through Microvisual Studio 6.0 window not by programming
that is,look at Microvisual Studio 6.0 interface on computer screen and then know the path of my project
Have I expressed my meaning clear?
|
|
|
|
|
Go into the fileview (the third tab, near ressource), right-click the workspace name and choose properties.
~RaGE();
|
|
|
|
|
Thank you!
Now I know the way
I think that
it is not very easy
and the microsoft corps should show the path at a more outstanding position
thank you again!
|
|
|
|
|
You can also just right click any editor window and select "Properties" from the popup menu.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi to everybody!
Is somebody knows, how can i listen to specific pin notification of a Serial Port or a Parallel Port ?
|
|
|
|
|
I have written an MDI application.
I wolud like to create on the desktop of my application
an hyperlink to my web page
How can I do this?
I'm able to create an hyperlink in the dialog box but I'm
not able to create it on the desktop of my application
|
|
|
|
|
What do you mean with the desktop of your application ? If it is in the toolbar, then you would consider using a rebar, with Chris' CHyperLink control.
~RaGE();
|
|
|
|
|
|
I want to start DirectX programming. I get the SDK and samples with it, but I want some tutorial about how to begin. The document with the SDK is not good for beginnig.
Mazy
No sig. available now.
|
|
|
|
|
IMHO, compared with what is available on the net, the SDK samples are not bad for getting started. There is a DirectX forum at <www.gamedev.net> You'll probably get more leads to tutorials from the posters there.
Good Luck with DirectX!
-Roger
|
|
|
|
|
Thanks Roger. I find GameDev.net forum.
Mazy
No sig. available now.
|
|
|
|
|
Here are some code about DeviceIoControl:
BTemp=DeviceIoControl
(
hDrive, // handle to device
IOCTL_STORAGE_CHECK_VERIFY, // dwIoControlCode operation
NULL, // lpInBuffer; must be NULL
0, // nInBufferSize; must be zero
NULL, // lpOutBuffer; must be NULL
0, // nOutBufferSize; must be zero
&BytesReturned, // number of bytes returned
NULL // OVERLAPPED structure
);
this function "DeviceIoControl" is to check whether the floppy disk has been changed(If the function succeeds, the return value is nonzero.If the function fails, the return value is zero.)
Something wrong happens here:
BTemp is a minus when I test on a wrong floppy device which does not work well while it is plus when on a work-well floppy device
does this mean that a returned minus value says the floppy device is error?
|
|
|
|
|
Hi All,
I have a webbrowser object and I want to open the new window link in same parent window and not let the child window to open. I searched for new window method and found it as..OnNewWindow2(LPDISPATCH FAR* ppDisp, BOOL* Cancel)..where assigning cancel to to non zero value does the job of letting open the IE in new window..but I dont know how to get it to navigate to the link user has clicked on...I found an example in VB but that takes in the parameter as URL and in VC..i wasnt able to find any such method..I need it to be done..can anyone out there help me out..any help or pointers are highly appreciated..Thanks a lot in advance..
Himanshu
|
|
|
|
|
When I add information to access table ,I use this code !
set.m_access_attribute = GetDlgItemInt (IDC_EDIT1);
How can I warn to fill edit box if it is forgotten ?
emroz
|
|
|
|
|
GetDlgItemInt has two more parameters. The actual syntax is: UINT GetDlgItemInt( int nID, BOOL* lpTrans = NULL, BOOL bSigned = TRUE ) const;
If the edit box doesn't contain a valid numeric value then pTrans would become 0.
BOOL pTrans;
int iValue = GetDlgItemInt( IDC_EDIT1, &pTrans );
if( pTrans == 0 )
AfxMessageBox( "Please enter a numerical value!");
else
set.m_access_attribute = iValue;
I haven't tried to compile the code so it might contain errors.
Another way is to force the edit box accept only integers and that can be done in the resource editor. Right-click on the edit box, select properties, and then in the styles tab select Number.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
how is it done when using a dialog with a toolbar?
thanks
|
|
|
|
|
If your program is dialog based, then how did you attach a toolbar to it?
Anyways, since you didn't accept the answer from Eugene (sorry if I misspelled the name), then you can try something like this (only if the toolbar is dialog based):
GetDlgItem( IDC_TOOLBAR_ITEM )->EnableWindow( TRUE );
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|