|
renegade the immortal wrote:
Basically, I can't find a WM that fires right after the dialog is shown on screen.
In your WM_INITDIALOG handler, call ShowWindow() to make the dialog visible.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
separate threads. That somehow seems too complicated.
No, you should use threads for your problem. Because you just need a worker thread, so you can use AfxBeginThread .
Ex:
Declare: static UINT SaveThread(LPVOID lParam)
Implement:
UINT SaveThread(LPVOID lParam)
Calling:
AfxBeginThread(SaveThread,yourParam);
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
i worked in a company before. many apps shared to use a public database, the db (not SQL one) consisted lots of arrays, which hold pointers to some type of objects.
unfortunately, some apps saved bad pointers (pointed to nothing but not null) to the db.
once other apps accessed to those bad pointers, the apps crashed.
do u know how to access to bad pointers with no crash (i.e. find they are bad then skip them)?
thx
includeh10
|
|
|
|
|
Can you provide more detail on the file structure and details of what the crashes are.
In the good old days of DOS, I used to have to manually fix bad pointers in files with a hex editor.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
similar to this, i think:
//the database is called "Object Store"
//did by some one else
MyClass p=new MyClass;
delete p;
ary.Add(p); //ary is an Array
db.Save(); //Save to database
//i do
db.Open(file_name);
int i,iNum=ary.GetSize();
for(i=0;i < iNum;i++)
{
int iSomeValue=ary.GetAt(i)->iSomeValue;
}
note: one of ary.GetAt(i) above gets bad pointer.
thx
includeh10
|
|
|
|
|
Maybe you should derive all your classes from CObject and use IsKindOf?
nobody is perfect
|
|
|
|
|
That's your mistake. You should check your code before running
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
You can check some bap pointers with a function like IsBadReadPtr and similar functions but it will not detect all bad pointers (and maybe none with our sample).
You can also uses exception handling to catch access violation and do so other validation to ensure that the pointer do point to valid data.
So any solution are a patch but when we want to handle corrupted files, we often have no choice than to fully validate the data and skip any data that does not appears to be good!
Or if you can fix the data itself, simply correct existing files and create new files without corrupted data (you may in that case want to add some means to detect that you have a new file and skip validation in that case).
Philippe Mori
|
|
|
|
|
You can try to use AfxIsValidAddress , look up in MSDN on its parameters and explaination
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
I mean through an example..
|
|
|
|
|
Can it help you?
system(<br />
<br />
"rundll32 shell32.dll,SHExitWindows VALUE");<br />
<br />
Here are the different VALUES you can put in:<br />
<br />
0 Logoff User<br />
<br />
1 Shutdown Windows<br />
<br />
2 Restart Windows<br />
<br />
4 Force Applications to be killed<br />
<br />
8 Poweroff (if supported by your PC)<br />
<br />
-1 restart the GUI without a shutdown
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
I want the first column of my list view to be right aligned but it wont let me align it. I can align any of the other colums to the center or right but the first column is always left align. Is there a way to get the first column right aligned?
|
|
|
|
|
From MSDN
If a column is added to a list-view control with index 0 (the leftmost column) and with LVCFMT_RIGHT or LVCFMT_CENTER specified, the text is not right-aligned or centered. The text in the index 0 column is left-aligned. Therefore if you keep inserting columns with index 0, the text in all columns are left-aligned. If you want the first column to be right-aligned or centered you can make a dummy column, then insert one or more columns with index 1 or higher and specify the alignment you require. Finally delete the dummy column.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
Wow, it's cool !!!!!
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
Thanks, that should do the trick.
|
|
|
|
|
Unfortunatelyfor this subproject have to use VB. Besides a 2d array what options do I have to store data (VB STL?).
Another thing is it seems you have to declare the sizes so they arent dynamic. I tried
dim arr(100, 5) as string
and later tried
redim preserve arr(100, KnownCount).
The compiler wasnt happpy
|
|
|
|
|
I believe VB has a Collection object. Check out the reference on MSDN.
You might want to ask this question in the VB forum as you are more likely to get somebody who knows/gives a damn about VB
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
i want to make my own simple browser but i dun know where to start. if anybody implemented a simple web browser plz do share code or atleast provide hints for that. or is there any sample here on code project.
|
|
|
|
|
Make an MFC Appwizard SDI application, in the final stage, derive ur view from CHTMLView, and that's it!
In order to develop further ur application just read about CHTMLView in the MSDN!
Good luck
Bébé Harhour
|
|
|
|
|
Alternatively you could use the the WebBrowser ActiveX control in your application, that would give you access to all the IE favourites and settings. For that you have to use the ShDocVw.dll and the MsHtml.dll files and create a wrapper class for the activeX control which you can then add to your applciation.
There is an excellent tutorial here on CP but it's written in C#, you shouldn't have any problem doing the same in VC++.
But if you are looking to write your own rendering engine or something like that then i think you'll have to use CHtmlView although i am not too sure.
|
|
|
|
|
I have stumbled across this function "conjg" in the complex class template. But I don't seems to be able to access it. Any kind soul can tell me how to access this function?
Thanks in advance!
|
|
|
|
|
#include <complex>
void foo()
{
using namespace std;
complex<double> cX(1.0, 1.0);
complex double cY = cX.conjg();
_ASSERTE(cX.imag() == -cY.imag());
}
You don't need to sleep to see a nightmare Anne Clark [sighist]
|
|
|
|
|
Thanks for the reply. I can't seems to get it compile under VC++ 6.0
Here's what I have attempted to do.
#include <iostream>
#include <complex>
using namespace std;
void main()
{
complex<double> abc;
double myvar = abc.conjg();
cout << myvar;
}
When I tried complied it... the error is as follows..
error C2039: 'conjg' : is not a member of 'complex<double>'
What's wrong here? It's seems that conjg is not visible in the class?
|
|
|
|
|
From MSDN
#include <complex>
#include <iostream>
int main( )
{
using namespace std;
complex <double> c1 ( 4.0 , 3.0 );
cout << "The complex number c1 = " << c1 << endl;
double dr1 = real ( c1 );
cout << "The real part of c1 is real ( c1 ) = "
<< dr1 << "." << endl;
double di1 = imag ( c1 );
cout << "The imaginary part of c1 is imag ( c1 ) = "
<< di1 << "." << endl;
complex <double> c2 = conj ( c1 );
cout << "The complex conjugate of c1 is c2 = conj ( c1 )= "
<< c2 << endl;
double dr2 = real ( c2 );
cout << "The real part of c2 is real ( c2 ) = "
<< dr2 << "." << endl;
double di2 = imag ( c2 );
cout << "The imaginary part of c2 is imag ( c2 ) = "
<< di2 << "." << endl;
complex <double> c3 = c1 * c2;
cout << "The norm of (c1 * conj (c1) ) is c1 * c2 = "
<< real( c3 ) << endl;
}
Output
The complex number c1 = (4,3)
The real part of c1 is real ( c1 ) = 4.
The imaginary part of c1 is imag ( c1 ) = 3.
The complex conjugate of c1 is c2 = conj ( c1 )= (4,-3)
The real part of c2 is real ( c2 ) = 4.
The imaginary part of c2 is imag ( c2 ) = -3.
The norm of (c1 * conj (c1) ) is c1 * c2 = 25
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Is there an API which will tell me when a machine enters/leaves the network (at startup/shutdown)?
If not, can anybody point me in the right direction on how to detect these events?
|
|
|
|