|
|
I'm including #import <mshtml.tlb> in my VC 6.0/SP5 project. When I remove this line, compilation fails, but building of the "browse info" (bscmake) will complete sucessfully.
But when I include this line in the source, bscmake will crash with unhandled exception.
How to solve this ? I've tried this command line switch for bscmake: /Ei (mshtml.tli mshtml.tlh)
It worked when I've executed bscmake from command line, but it's not working when I include it in the GUI's project settings.
Is there some preprocessor directive or variable defined when bscmake is parsing the sources ? I'd try to force bscmake to skip #import line in some way.
Thank you!
rrrado
|
|
|
|
|
nevermind i've found solution
rrrado
|
|
|
|
|
HI all..
i want to know of any function to disable/remove the close Button on a dialog(CROSS button on top right corner).
It can be done by setting the property of the dialog but that is not what i want.
Thanks
|
|
|
|
|
Try this: GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE, FALSE);
|
|
|
|
|
Stlan wrote:
Try this: GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE, FALSE);
HI Stlan, Hows life going long time no see, no mail
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Fine, Thanks! I had not too much time to wander on CP in the last days! (heavy work load this last days ) The week-end was fine however. And you ? How is your new job ? Are your new colleagues nice ?
By the way, I see at the TV there is a lot of troubles in India because of floods due the rain season. I hope everything is OK for you and your family.
|
|
|
|
|
I want resize a bitmap and save it again
how can do it?
|
|
|
|
|
If u mean at run time you have to use OnSize();
/\|-||\/|/\|)
|
|
|
|
|
Try to load the BMP into a CBitmap/CImage object, attach it to a CDC
and then you can use CDC.StrechBlt, now come back to the CImage and save it!
Let me know. Bye bye
|
|
|
|
|
Hello,
I'm experiancing some trouble with an MMF. I've created a class that manages one MMF and one view of that file. I've also created another class that manages some cache using the MMF class.
The MMF class has no problems of its own that I'm aware of, but the caching class has a problem when a new view has to be created. After I cross the view boundraries (and map a new view), one pointer in the heap becomes invalid. The data it holds is still the same, but operator delete[] asserts with an invalid heap pointer exception.
I must also note that the base address of the view is almost the same as the variable. The base address = 0x01b40000. The address of the variable is: 0x01c0e988 and the size is 72 bytes. To me it seems that the variable is not in the view, but I don't know why my pointer is corrupted.
After the initial write I perform some validation checks: IsBadReadPointer() to be precise and it succeeds.
Did anybody experiance something like this before? Anybody has any idea what might be the problem?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Well, I solved the problem. The problem was not in unmapping the view, not in mapping the view, it was in the function which calculated the offset of the data in the view. The offset was reset when a new MMF was created, but not when a new view of a MMF was created. This lead to writing outside the view, which in turn corrupted the heap.
I guess that a complete heap check is done after each allocation and deallocation.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Respected all
Regards!
how i can read data from a data file which has extenstion is *.Dat which is in the follwing format
---------------------------
filename.dat
data file
genertaed from the processing of the control system
XLOC YLOC INDIX
45 56 2344
56 67 1245
50 90 4562
45 87 9337
-----------------------------
and in the given data file i have to read only the data of columns under XLOC,YLOC,INDIX and the file always is in this format.
So please guide me.
waiting for + response.
david
|
|
|
|
|
Use an ifstream. Once you get past the first lines, declaring an int and using >> will work fine, so long as you have some error handling code if the file is corrupted.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There are many ways to approach this. One, although not the most efficient, looks something like:
FILE *pFile;
int XLOC, YLOC, INDIX;
char szLine[128];
pFile = fopen("filename.dat", "rt");
fgets(szLine, sizeof(szLine), pFile);
fgets(szLine, sizeof(szLine), pFile);
fgets(szLine, sizeof(szLine), pFile);
fgets(szLine, sizeof(szLine), pFile);
fgets(szLine, sizeof(szLine), pFile);
fgets(szLine, sizeof(szLine), pFile);
while (! feof(pFile))
fscanf(pFile, "%d %d %d", &XLOC, &YLOC, &INDIX);
fclose(pFile); A similar MFC solution exists.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hello David
If you think that you've got only half the answer you need... you are not the only one! Often I get very well intentioned replies but full with the assumption that we are all engineers... Anyway, here's what I use to read realtively small files. If reading the file takes more than a few minutes, the decision to use this method or any other depends on how many times during the execution of the program you have to read the file. If you only read it once, go check the scores of the latest soccer games while the computer works. If you need to read the file many times, then it is better to transform your data file into a binary file (if you need it I can also send you code for that). You'll have to wait once while the file is converted but once your data is in binary, reading it from your program is lightning fast. OK, here's the code to read a text file regardless of the file extension. Note that I made the code general so that the first header lines can be one or more. You can choose to change the cin inputs if you know in advance what the will always be (i.e. one header line). Also, please note that the data being read by this program is comma separated. If you don't have commas, use the next commented line. If your data files have a variable amount of lines (e.g. you don't always have the same amount of rows) use a vector container to store your data. Don't hesitate to ask if you have more questions.
#include <fstream>
#include <iostream>
using namespace std;
int main()<br />
{<br />
char stuff[100];<br />
int period, stufflines;<br />
double dat1, dat2, dat3, dat4, integ, fraction;<br />
char separator;<br />
int counter;<br />
<br />
cout << " " << endl;<br />
cout << "how many lines with stuff at the beginning?" << endl;<br />
cin >> stufflines;<br />
cout << " " << endl;<br />
<br />
ifstream FileIn("C:\\SampleData\\divedata.dat");<br />
if(!FileIn.is_open())<br />
cout << "Could not open the file! Check directory..." << endl;<br />
else<br />
cout << "You're good, input file opened!" << endl;<br />
<br />
counter = 1;<br />
while(!FileIn.eof())<br />
{<br />
if(counter <= stufflines)<br />
FileIn.getline (stuff, 100);<br />
else<br />
{<br />
FileIn >> dat1 >> separator >> dat2 >> separator >> dat3 >><br />
separator >> dat4;<br />
}<br />
counter++;<br />
}<br />
return 0;<br />
}<br />
Good luck
Carlos
|
|
|
|
|
|
hi all..I want to make a dialog that can be resize with HScroll and VScroll. But when I tried the program, the dialog window can be resized, but the scroll doesn't work(I added the scroll using class wizard by right-clicking the dialog window, go to properties, and checked horizontal scroll and vertical scroll). Pls help...
thx.
|
|
|
|
|
Scroll doesn't work by itself, you need to catch the scroll events, and make sure your code adjusts it's display accordingly. You also need to set the range of the scroll bars.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how to implement it? Can u give some tutorials,articles,or some link that can be helpful..pls
thx
|
|
|
|
|
What version of VC are you using ? Whatever it is, you can set an event handler for each of the two scroll events ( but if I know which one, I can tell you exactly where ), and then you force a redraw with Invalidate(), and your drawing code takes the scroll position into account. I don't know of any tutorials, off hand, sorry. I'd be surprised if this site didn't have any.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm using VC 6.0. I already make the event handler. On where I should write my drawing code? Btw...what is the keyword for finding thw tutorials(I try "repainting window" keyword, but I didn't find any suitable articles)
thx...
|
|
|
|
|
firebolt77 wrote:
On where I should write my drawing code
Drawing code is ALWAYS in OnPaint. Invalidate(); is all the code you need to put in a scroll event to force a repaint.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thx...but I'm still confuse on the drawing code
I'm still new in MFC so I'm still lack of knowledge in MFC
thx anyway..
|
|
|
|
|
Well, what are you drawing ? How do you draw it now ?
Christian Graus - Microsoft MVP - C++
|
|
|
|