|
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.
|
|
|
|
|
Dumb question.. If I have a dialog type application called "A".. and I create dialog box "B" within the same app. I then create a member variable for "B" in "A"s Class how can I update a control on "A" from "B".. for example lets say I have a listbox on dialog "A" and I input a string into an edit box on dialog "B" from "B" I want to add the item to the listbox on "A" with out actually pulling the string from "A" and inserting it.. can this done or do I have to update the variable and add it while in "A"?
Any help would be greatly appreciated.
Rob Jones
|
|
|
|
|
You could do that with ::SetDlgItemText(..)
Or eaven send a window message to a control
|
|
|
|
|
Hi,
I currently have a bitmap that is being held in a CDC and I would like to get a peice of that bitmap and save it to another bitmap. For instance, let's say that I have a bitmap that is 100 x 100 pixels. I want to select region 25, 25, 50, 50 copy it to another DC I guess? and then save it out to another .bmp file.
Does anyone know how to do this? I have the coordinates of what I want to copy to the new bitmap but don't know how to do it.
Thanks for any help you can provide,
Craig
|
|
|
|
|
Create a new CBitmap of the size you want, a new CDC to hold the CBitmap, and then use BitBlt to copy across the section you want.
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.
|
|
|
|
|
Hi Christian,
Here is what I've got so far:
CDC dcMemory;
dcMemory.CreateCompatibleDC(&dc);
COXDIB imagePiece;
imagePiece.CreateEmptyDIB(1, 55, 50);
CBitmap* pOldBitmap = imagePiece.MakeBitmap(&imagePiece, &dcMemory, CSize(55, 50));
dc.BitBlt(0, 0, 55, 50, &dcMemory, x, y, SRCCOPY);
CFile imageFile("c:\\temp\\imageManip\\testResult.bmp", CFile::modeCreate|CFile::modeWrite);
imagePiece.Write(&imageFile);
dcMemory.SelectObject(pOldBitmap);
When I look at the image that I created it is just all black, nothing else.
Am I on the right track?
Thanks,
Craig
|
|
|
|
|
What is a C0XDIB ? I assume a DIBSection wrapper ? x and y are valid values ? I can't comment on what you're doing wrong, but as therest looks fine I'd assume it's in the section:
COXDIB imagePiece;
imagePiece.CreateEmptyDIB(1, 55, 50);
CBitmap* pOldBitmap = imagePiece.MakeBitmap(&imagePiece, &dcMemory, CSize(55, 50));
if x and y are good values, because I have no idea what the syntax for this class you're using is. I'd bet on the last line if I had to make a guess, but only because CreateEmtyDIB is obviously working ;0
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.
|
|
|
|