|
Sorry for not replaying sooner, I've been really busy.
So will it work properly if I don't override GetCheck ?
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
It doesn't really matter if GetCheck is overriden or not - it's non-virtual and only programs dealing explicitly with CYourBtn will be able to call your method.
CButton::GetCheck is a very simple wrapper over BM_GETCHECK; if you want to play tricks with button state (and override default Windows behavior), you'll have to handle this message. This will solve the DDX_Radio/DDX_Check problem as well - they send BM_GETCHECK to your button when bSaveAndValidate is TRUE.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
So presumably the same applies for BM_SETCHECK when bSaveAndValidate is FALSE ?
Thanks for your help on this one. Look out for the article
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
Dears,
I want to build a printer driver. Any one have any idea?
Regards
Tarek Eslim
|
|
|
|
|
Hello,
I have to determine the version of the currently installed Internet Explorer via the COM interfaces of IE using Visual C++ 6.0. Is there any way?
ThanX in advance...
Greetz, HendriK
|
|
|
|
|
Hi there,
I am trying to create my own version CStringArray and I am testing this in my own little Win32 Application.
My header is something like this:
#include <tchar.h>
#include <afxcoll.h>
class CSuperStringArray : public CStringArray
{
public:
CSuperStringArray(int = 10);
CSuperStringArray(const CSuperStringArray &);
~CSuperStringArray();
const CSuperStringArray &operator=(const CSuperStringArray &); // assign arrays
};
My cpp is like this:
#include "CStringArrayOperator.h"
CSuperStringArray::CSuperStringArray(int nLength)
{
}
CSuperStringArray::CSuperStringArray(const CSuperStringArray &)
{
}
CSuperStringArray::~CSuperStringArray()
{
}
const CSuperStringArray & CSuperStringArray::operator =(const CSuperStringArray &)
{
return *this;
}
and then I got a winmain that tries to use this a little bit...
When compiling with "Not Using MFC" option, I get the following errors:
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/CStringArrayOperator.exe : fatal error LNK1120: 2 unresolved externals
But when I compile statically or dynamically, it all works out.
Is there anyway that I can compile this code without the MFC DLLs?
|
|
|
|
|
You're deriving your class from CStringArray. This is one of the MFC classes, you need to link with MFC.
BTW: you should return non-const reference to CSuperStringArray in operator=.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have recently installed both SP5 and the Processor Pack to visual C++ 6 and I am having the following problem. When an exception occurs inside a try catch block inside a function that calls ado methods the function crashes (in the debug build) on return. The following code runs fine when compiled with an earlier service pack and no processor pack, but with SP5 + Processor Pack it crashes during the return from the test function. Also if I compile it on a pc with an eariler sp, it will debug and run fine on a machine with the latest sp (as long as you don't try to compile!).
The following code has been reduced to the smallest part that I could get it to crash. I compiled it as a Win32 console application and did not change any of the default values. In SP5 + processor pack an access violation occurs when test() returns. This was tested on win2k. I compiled and tested it in debug build only.
#include "stdafx.h"
// You must change this to match your path
#import "D:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )
void test()
{
_RecordsetPtr pRst = NULL;
try
{
throw "a";
pRst->Open(_variant_t(), _variant_t(),adOpenStatic ,
adLockReadOnly, adCmdText);
}
catch (...)
{
}
}
int main(int argc, char* argv[])
{
test();
return 0;
}
My question is 1) Has anyone seen this problem? 2) am I doing something wrong?
|
|
|
|
|
Anybody know how to process an image same as Microsoft Word. Please help me
Ngo Khai Hoa
|
|
|
|
|
Do you mean how to access the specific COM object that handles the drawing, or how to write a vector based drawing package ?
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Yes, write a vector based drawing package.
My mean that we can compile between Bightness and Contrast each other.
I have a class called CDib, I can get DibBits and I process an Image (Contrast, Brightness) on that DibBits separately. I don't know how to compile between Bightness and Contrast to get a perfect result looks like what Word processes.
Tran Hoang Chuong
|
|
|
|
|
Ah - so you don't want the vector based stuff, you want Brightness/Contrast ? Probably you need to look at your brightness/contrast algorithms, and typically apply brightness before contrast.
There is also a COM interface for image processing, I've never used it, but I'm sure it would do brightness/contrast the same as Word does.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
I am looking for information on using a USB port as a substitute for the RS232 comm port. Do Win98 and Win2000 already support that or will a device driver have to written? If so where is a good place to get info?
Happy programming!!
|
|
|
|
|
I've never programmed for NT/2000 before, and I kinda don't have an NT/2000 box at my immediate disposal. Can someone tell me if FindWindow works the same on both 98 and NT/2000? My app is giving me grief when i try to run on win2k.
Thanx,
Stephen Caldwell
|
|
|
|
|
Sorry, I'm not a native English speaker; what do you mean by "giving grief"?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
It means that it's really getting on my nerves.
Stephen Caldwell
|
|
|
|
|
|
Stephen Caldwell,
don't you mean that it is 'upsetting you' ?
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
As I remember the only difference is that Win98 version uses ASCII and WinNT version uses Unicode.
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
In fact, NT has two versions of FindWindow (as well as other API functions). FindWindowW uses Unicode, FindWindowA uses ASCII.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I've been having a problem recently that has really been bugging me; for some reason, when I use printf or cout, the output will not appear on the console - I assume this is because stdout is not being flushed. Any idea why this is? I don't want to have to call fflush(stdout) after every printf!
|
|
|
|
|
Stdout is normally line-buffered, so end your printfs with \n. When printing to cout, add a "cout << endl" to get a newline.
--Mike--
http://home.inreach.com/mdunn/
A recent survey reports that 1/4 of all internet users in England surf for porn.
The other 3/4 just didn't want to admit it.
|
|
|
|
|
I was already doing this - it's not working.
|
|
|
|
|
I am using CListBox::SetTopIndex() to make sure I can view the last entry in a list box. I would like the view to adjust so the last entry is shown about half way between the top of the bottom of the list box control. I created a quick formula to do this, however, I found that using SetTopIndex() will make the last entry visible, but no matter what I put as the index for SetTopIndex(), it always puts the last entry at the bottom of the list box control. Visible yes, what I want, no.
Any ideas?
Thanks
John
|
|
|
|
|
Do I understand correctly, you want the last item entered into a list box to be displayed centered vertically? There are no other entries in the list box below this one?
If this is what I understand then you can't. What you may have to do is add empty strings to pad the listbox and move the item up.
|
|
|
|