|
Hi
I tried using Eran Yariv's 2-pass scaling filter (http://www.codeproject.com/bitmap/2_pass_scaling.asp) in my program (Visual C++ 6.0 on Win2k). The program works fine in debug mode, however, when I execute the release version, the scaling's result is not satisfactory, as the scaled images often have many unwanted horizontal green lines on them.
If I changed the preprocessor definition in the project settings to _DEBUG instead of NDEBUG and compile the release version, it works fine, although not the linker gives a warning about msvcrt.dll conflicting with other libraries. Further investigation reveals that the linker now uses msvcrtd.dll instead of msvcrt.dll.
I am curious to know why the program acts so strangely on the release version. Could someone point to me some possible causes for this? Thanks!
|
|
|
|
|
|
Hey guys,
I 'm having problem reading data from a text file.
Sample.dat contains
M
Bob
Dude
56
F
Carmen
Sandiago
33
VP
my code is suppose to read the .DAT file using ios::binary
and feed the information into a class.
example class...
class personInfo
{
char firstname[20];
char lastname[20];
int age;
char gender;
}
class femleInfo : public personInfo
{
char title[5];
}
acutally I have a polymorphic function that reads male info into a maleInfo Class and femaleInfo into a femaleInfo class.
The problem is,how do I read both male and female info seperately and load the appropriate class? (they both have differnt number of data members)....
I tried using seekg function and to move the pointer but I didnt really understand it,
Can someone pls help.
|
|
|
|
|
Create an iostream inserter/extracter for personInfo, have it return the appropriate type of object, based on the first data item read ( the sex ).
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
yes that is what Im doing,
the problem Im having is, how to read the the data into my class ???
I tried myDataFile.read(reinterpret_cast<char*> (&fObject),fObjSize);
and I thought this would copy each data item from the text file into the class varibales???
that doenst seem to be happening, am I missing something?
|
|
|
|
|
Yes, what you need to do is to stream in the variables one at a time. For starters, you've already read the first value out of the file, secondly, you're not allowing for whitespace, which also takes up room in the file. Oh, then you've got byte ordering of any number variable larger than a char, and the fact that that any number is stored not as a number value, but a line of chars.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
confused .......pls explain a little more.
are you saying that I have to read each varible line by line from the text file and load it onto my class? what function do I use? do I still use
inDataFile.read(reinterpret_cast<char*> ???
what would be the exact lines to use the above ?
thnks for ur help
|
|
|
|
|
Going back to where I started, you need to create an iostream inserter/extracter for the class, like this[^]. Then you'd need to do something like
personStruct a; // whatever your variable type was, it should really be a struct, in any case.
myStream >> a;
// Now check the data member that telss you if it's a female, and treat it accordingly. I'd be incline to use just one struct, and just null the data that is not appropriate, instead of the way you are doing things now.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
okey got it.
thanks a lot.
|
|
|
|
|
Just curious does anyone have a tutorial on how to make a macro in visual c++. I have this program called total recorder that records streaming audio and i have a radio show that comes on early in the morning. I'm usually not away so i wanted to write a c++ program that would launch total recorder say with shellexecute that part is easy. I just can't figure out how to make it click the mouse like a macro. Thanks for your help.
Talk to me like a baby cause when it comes to programming i still wear a training pants
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
You need to look into SendMessage, perhaps. It sounds messy to me though.
I thought you wanted to create a macro in C++, as in #define, I was ready to read you the riot act
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I think I can help U in it. But definately it needs detailed discussion. Time being. Every Microsoft windows has a class name and window text. and at any given instance Desktop will be parent of all windows. U can find these using Spy++ in windows. So just iterate from desktop as root windows using treeView to Ur target message. Using SendMessage or Postmessage pass WM_BCLICK or WM_LBUTTONDOWN or what ever.
hope it helps
|
|
|
|
|
I looked up SendMessage and post message but wasn't too clear on it.
How do i tell it which window to send it to?
I opened up spy++ and i found my message. I'm assuming i need to the window handle say 004f3c or whatever.
so would i put PostMessage(WM_LBUTTONDOWN,004f3c,NULL);
Sorry but confused i kinda understand what your saying but its new to me so i'm kinda lost.
thanks for the help by the way.
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
U can't depend upon handle as they R dynmaic. So derive Windows handle from FindWindow(class name, WinText) kind of API. Use this handle in Ur SendMessage.
Now U must be Pretty clear I think. Mind U there is no standard method of doing this. I derived this method after 2 months of shuffling with Charles Perzolt book. Highly recommended.
One more just read the query posted by codeCharmer "Enumerating Dialog Controls". U have to adopt almost similar Algo.
cheers
Siddharth
|
|
|
|
|
please tell me how can i initialize ITBasicCallControl
interface of tapi3lib.dll in VC.net
thanx....
babur
|
|
|
|
|
The ITAddress::CreateCall method creates the ITBasicCallControl interface.
HRESULT CreateCall(
BSTR pDestAddress,
long lAddressType,
long lMediaTypes,
ITBasicCallControl** ppCall
);
|
|
|
|
|
Using the Windows CColorDialog class, is it possible to select any of the custom colors that one saves? I am populating the custom colors before calling the DoModal class and the colors appear correctly. However, calling SetColor only seems to select the square that is in the basic color boxes. Is selecting a custom color programmatically possible?
|
|
|
|
|
Under MS-DOS, you used get_vect() and set_vect() to install an ISR to handle interrupts; for instance, if you used IRQ 10 for the PC-104 bus.
How do you do the same thing in WIN32? How do you get a hardware interrupt to call a function that you supply?
|
|
|
|
|
Hardware and interrupt handling under Win32 (specifically, Windows NT/2000/XP) is vastly different from MS-DOS and even Windows 3.x/9x.
User applications do not handle interrupts. Period. The best you can do is have a driver signal an event, and have a thread in a user application wait on that event. At that, the user application can't manipulate hardware directly (I/O instructions are prohibited to user applications).
You need to get a copy of the Windows Driver Development Kit (DDK). If you are using off-the-shelf hardware, contact the manufacturer for application programming information. Usually, if it's something special (data acquisition H/W, for example), they will provide the appropriate driver and an object library or interface DLL to talk to the hardware. If this is hardware you (or your company) are building yourself, you will need to learn driver development, which is distinctly non-trivial.
Software Zen: delete this;
|
|
|
|
|
Aahhh, interrupts. I remember them (nostalgic look on face).
Its surprising how coding in the windows environment can completely change your concepts of programming.
I Dream of Absolute Zero
|
|
|
|
|
Hi gurus,
I'm working on a ATL plug-in for MS Outlook, but I would like to make it work on Outlook Express as well. I understand that it's not possilble via COM technology (as OE does not expose any COM interfaces ), but something with hooks? Any documentation on the subject?
Any help / hint would be much appreciated.
Thanks in advance,
Doru K.
|
|
|
|
|
On http://www.elitesecurity.org/tema/8207/0#61676 you can find attached file "Office2000-add-in.tgz - 20.71k" on bottom of some message with useful information to you. I realy did not work with Outlook but I realize from message its right thing what you asked.
Regards,
|
|
|
|
|
Thank you for your answer, but unfortunatelly, I couldn't find what you directed me to, because of language impediments. Thank you anyway.
Best regards,
Doru K
|
|
|
|
|
I was suggest attached file has written on english language which was on http://www.planet-source-code.com but it is not there now and not to read messages.
|
|
|
|
|
Hi,
following situation:
Class A owns an array of Class B variables.
Class B owns a variable of Class C.
Class C runs as a thread which is started by Class B.
What I want to do: when thread C ends, I want Class A to remove B from the array.
What I tried: B knows whom it is owned (knows the A) and C knows the B. So when C ends, it can call a function in A to tell it to remove B.
However this is a quite bad solution. Because the function can't really complete (it can't jump back into C because it has then been destroyes). It just not seems to work.
How can I code this clean?
Thanks a lot!
Chris
|
|
|
|