|
You need to have IDREADY #defined in resource.h (which you'll #include in your .cpp file).
I suspect you're just starting out with MFC. You'd be wise to read an introductory text on the subject and teach yourself the basics. It shouldn't take long and will save you a lot of frustration. I recommend any of these authors: David Kruglinski, Charles Petzold and Jeff Prosise. You can probably buy their books used on Amazon or EBay for next to nothing.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
After adding information,it shouldn't be recorded the same information again.
if it is wanted to record same records it should give a message?
how can I do this ?
emroz
|
|
|
|
|
Emre Zorlu wrote:
After adding information,it shouldn't be recorded the same information again.
Adding to what ?
~RaGE();
|
|
|
|
|
I'm using *.mdb table.(ODBC)
After I add recordset ,it should warn me if I try to add same recordset
emroz
|
|
|
|
|
I know there are some differences between the way XP and NT are handling threads, but I do not know hat exactely. Can somebody point me this out ?
My problem is following :
I have made a very simple MFC dialog application, with one single button. Pushing the button launches another dialog in a separate thread, with a progress bar being filled through a timer (the app does not make sense by itself, it is just for testing).
Under NT, I can debug it without any problem.
Under Xp, the debugger hangs after a few steps with F5.
I suppose it is linked with the way Xp and NT are handling threads and processes, therefore my previous question.
Thanks CPians.
~RaGE();
|
|
|
|
|
Does the whole system seem to run REALLY slow too until you manage to kill the debugger? If you are using VC6, this same thing happens to me. Sometimes two or three times in a row. I don't know how to fix it, but I can tell you it sure is a PITA.
Chris Richardson
|
|
|
|
|
I don't know if you already fixed the problem. (3 weeks ago you ask about it) but I had the same problem (hanging when debugging in other then the main thread)
And it has been driving me crazy. And today I search the web again about the problem expecting not to find anything about it.
But I did. On a forum on codeguru.
It seems like if you have enabled "advanced text services" on XP then a DLL is hooked in each process. This is causing VC to stop responding
Sound stupid. And I haven’t heard anything about it before.
But after turning it off. I can now debug without any problem.
To turn off "advanced text services".
1. Open Regional and Language Options in Control Panel.
2. On the Languages tab, under Text services and input languages, click Details.
3. On the Advanced tab of the Text services and input languages dialog box, select the Turn off advanced text services check box to turn text services off.
|
|
|
|
|
Stupid, stupid question.
Is there a way to completely flush cin of everything. A '/n' stays in the buffer if you ever use the stream extraction operators.
The end goal is to replace the VC6 functionality of 'press any button to continue.' which is written out to the console in debug mode. It needs to be using only STL (using cin / streambufs etc), and it only needs to detect enter being pressed. I know I can use _kbhit(), but I'm annoyed enough to want someone to tell me what I'm missing.
Bloody lecturers.
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
|
|
|
|
|
Try
cin.ignore(numeric_limits<int>::max());
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"
|
|
|
|
|
In the MFC Library is the following article:
HOWTO: Clear an istream Object During Extraction
ID: Q132422
INTP
|
|
|
|
|
Thanks, that was one of those questions where all the documentation seems to go round in circles, and you never find what you're looking for, but it's working now
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
|
|
|
|
|
Here is a function name:
void (* xyz(int, void (*)(int)))(int)
What meaning does it mean?
|
|
|
|
|
Try to read such expressions from inside to outside:
xyz is a function
its first parameter is of type int
its second parameter is of type
pointer to function
with one parameter of type int
returning void
returning
pointer to function
with one parameter of type int
returning void
|
|
|
|
|
Can you give us an example to illustrate it?
|
|
|
|
|
I place a ms serial communiction control (msComm)on a dialog,and make this dialog as a diaolgbar to us,But I cann't use the mscomm control to open any
serial port,seems the control isn't enabled to use on dialogbar.
I know other control such as button can add UpdateUI memeber function by hard to use enable it ,but how to enable the mscomm control to use?
Any one On the GuRu can help?
Thanks
|
|
|
|
|
Hi, all
I am writing a class that creates and maintains a window/control. The problem is that I can’t seem to give the class its own private callback function (the Window Procedure alias WndProc); the VC++ complier simply gives a type cast error when giving out the function pointer. I thought about why and I assume that the reason lies in the different structure between class functions and global functions. But is there a way to go round this, like force the compiler to construct the class function as a global function (assuming that’s the case)? If that’s not that the case, then why does the compiler give a type cast error? And is it possible to have callback function as a class member or at least give the class some sort of private callback function? And oh yes, I know I can use MFC but I simply prefer not, I want to know if can be done without its help.
Thanks in advance
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
I want to help you
but I know just a little about callback function
I ever solved a callback function as a private static member function on the base of other people in VC, which perhaps develops from MFC
It works well.
|
|
|
|
|
Thanks that worked (making the function static), but another problem came up. I get a link error saying “illegal reference to data member 'Class::X' in a static member function”, whenever the static function uses other class members (both variables and other functions). How can I solve this?
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
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.
|
|
|
|