|
Hi - thanks for your reply.
When I cast from BOOL to bool as suggested, the compiler gives the follwoing warning:
warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
I think I'll just have to redisgn, replacing the the function to take integers instead of booleans. I cannot redefine my member variable as a 'bool' - Class Wizard doesn't have this option.
This is bad design practice as my design does use true booleans, but I don't see how I can assign a true boolean to a member variable.
Thanks again
Paul
|
|
|
|
|
hi,
i have some validation on onok of the page. the validation is not satisfied means i don't want to close the dialog. what's the solution.
thanks in advance
|
|
|
|
|
in the overwritten function you should not call CPropertyPage::OnOK() if you are not satisfied with the Values.
the better way is to overwrite the Function OnApply() , because this is called when OK or when Apply is clicked.
Greets
Roland
|
|
|
|
|
I am trying to adjust the printed image size fit into
the paper size which is about A4.
I have tried to change those parameters for GetDeviceCaps functions. seemingly, I can't get the right size.
Does anyone have solution to this?
if( pInfo )
{
CClientDC dc( this );
pDC->SetMapMode(MM_ANISOTROPIC);
CSize sz( dc.GetDeviceCaps(LOGPIXELSX), dc.GetDeviceCaps(LOGPIXELSY) );
pDC->SetWindowExt( sz );
sz = CSize( pDC->GetDeviceCaps(LOGPIXELSX),pDC->GetDeviceCaps(LOGPIXELSY) );
pDC->SetViewportExt( sz );
}
shi
|
|
|
|
|
I have an application...when someone calls me(via a modem) I need to initialize the device on his side, so is it possible in some way to know that the call has been made to me....so that I can automate the process and without any manual interaction on my side I can acivate my friend's device.....actually I want that if the application is running and I am not there he should not face any problems
Maverick
|
|
|
|
|
|
Sorry for the confusion......
suppose you have a device and you are at a remote location, where you have a modem and a phone line with you.....and suppose that you want to connect to your PC at your home and so you send a request(your PC is on) so is it possible somehow,that by using the APIs provided in VC++ we can program our system(PC) in such a way that whenever it gets a request it automatically programs the device(which is presently at the remote location).
I guess I make sense now
regards
Harsh
|
|
|
|
|
I want to get this code:
// -->
class A
{
public:
A(int a) { m_a = a; }
public:
int m_a;
};
FILE *fp = fopen("C:\\test.txt", "wt");
A* obj = new (fp) A(10);
fclose(fp);
// <--
When this code run over, the C:\test.txt file will be written in 10. Just as A(10).
In other words, the operate new Function can save A(10) before A construct function implement.
I can't solve it!
My project have the same codes, but I have no sourcecode. I want to know how to do?
I need your help~~~~ Thanks a lot~~~
|
|
|
|
|
What is the intention of your program? If you want to write the integer 10 to a file, then your attempt is way off target. In the expression
A* obj = new (fp) A(10); you are (mistankely) using the so-called placement new, which has nothing to do with writing to a file.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I know i should overload this operater new, such as:
void* operater new(size_t n, FILE *fp)
{
// some code
}
Now I want to get this object A(10) in the operater new function, so i can save this object's value.
But as you know, the construct function always be implemented after operate new funtction, How do I now?
My English is poor, please never mind
|
|
|
|
|
OK, now I see what you are trying to do. I am afraid your idea is not realizable in C++. Overloads of new cannot have access to the object being constructed because construction takes place later. The sequence of operations performed by the compiler is- Call the operator
new (the default or a user-defined version) passing the size of the object to be constructed.
new allocates the memory as it sees fit and returns a void * .
- The compiler uses this pointer to lay out the object, calling then its constructor.
So, by the time your overloaded new is called, the object does not even exist. I don't think you can workaround this.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
anybody know how to get the input/output range programmatically by passing the device name ???
|
|
|
|
|
Hi Experts,
I want to make a mimic (graphic) editor in which images will be displayed dynamically on click of button, will be resized, moved and finally, they will be connected to database. For that purpose I want to use "Kodak image edit activex control" [WINNT,VC6.0]
basically,I’ve to make a graphics editor in which when i press a specified button a picture should be displayed on the dialog.that picture will be associated with a variable in a table of a database. when the value of that variable changes in the database another picture is pasted on the previous picture.i-e a picture of engine is normal when variable is 1...but when the value is 0 the color of engine changes to red.
note:
-pictures are moveable and resizable.
-there can be alot of pictures on the dialog at a time.
-value in the database changes automatically through another program.
i m using kodak Image Edit activeX control for this purpose..i add the control in the project and create it on runtime with the help of create function
Up till now I am able to create the control dynamically with the required image displayed on it which can also be flipped on click event with the help of EventSink_Map. I can send u attachment as well. I want to know how the dynamically created control be made able to move and resize.
any help how to do that? m i going in the right direction? bcz previously i was doing all this with the help of CBitmapButton.(information on how i did that available on demand if anyone interested)
i also came to know that exactly the same problem is encountered to "asimatta" who sent the message on EXPERTS EXCHANGE website under the topic Languages\C++\ on 08/27/2003 with the title "ImageEdit activex control??" but i coudn't contact bcoz i m unable to buy points to send a message on Experts-Exchange.com
i m really grateful to Codeproject.com for providing such a great service free!!
plz help me !! Thanking u in anticipation
Regards,
nsaadyah
Saadyah Nisar
|
|
|
|
|
im no expert but you might try adding a regular frame around it and then capture rightclicks and hold on the frame and test if its at the edge where someone would do the dragging and then calculate the change in distance when the person releases the mouse and resize your control accordingly also make sure the frame is also resized also. with a frame you can add things like a sunken or modal border wich also makes it nice to use so you could represent the border with something like a modal border to give the user a visual cue that the control is resizable this idea is probably the most basic and there could be other ways you could do this but thats my suggestion
|
|
|
|
|
first of all thanx a lot for a nice cooperation secondly, let me tell u that i m very new in vc++ i m getting ur point but i dont know how to implement!
actually i have down loaded a resizing code for button, listbox and edit box from codeguru but the ques. is how to implement on dynamically created "kodak image edit" ??
regards.
Saadyah Nisar
|
|
|
|
|
well first off when dynamicly creating the kodak thing just do this
frame->GetWindowRect(&rect); kodak->MoveWindow(&rect); that way you ensure the kodak is the the same size as the frame on creation you may want to adjust the size slightly its up to you
you could either inherate the frame class and overload its OnLButtonClk message or just use your windows message and use GetCursorPos and just test if its within the frame window and around the permiter then on the OnMouseMove do some work while the user is trying to resize thier thing and then finaly do your resizing in OnLButtonUp
also you can do this without the frame and just use the kodak thing where you would use the frame although i think the frame gives your control something easier to stick to
also if you didnt know you can get your kodak control in functions were its not in scope by doing GetDlgItem(ID_KODAK) same with the frame control
|
|
|
|
|
hi im a little confused i have drag and drop code for a tree view in debug mode it works perfectly it drops the item where its supposed to be dropped however when the code is used in release mode the tree just drops it in the root node of the tree i know im being vague here but i really have no clue where the bug could be since you can't debug while in release mode :P does anyone have any clue how i could track down this iregularity ? any help or any suggestions would be very helpfull thanks
Marissa
|
|
|
|
|
Maybe you should check your project's release settings?
|
|
|
|
|
i have not altered the release or debug settings at all and anyways i dont understand how changing release settings would affect the execution of code the has proven it works in debug also there are no #ifdef _DEBUG or whatever in any of the drag/drop code for the tree view
|
|
|
|
|
perhaps you're release application is linking to different dll's than your debug application?
Er zit een korstje op mijn aars.
|
|
|
|
|
im not using any dlls other than the mfc dll that gets built into the app
|
|
|
|
|
There are a number of ways that debug and release code could be different. Debug usual does not have any optimization performed on it, where release code does to to specify an optimization by default.
Debug code also is more forgiving about un-initaliazed variables. This is the first thing I'd check for. Secondly I'd enable debugging on the release build so that you can step through the code and see if you can spot a problem.
Michael
'Curiosity's always been my downfall' - The Doctor: The Caves of Androzani
|
|
|
|
|
i tried to enable debuging for relase but im not sure i did it right i went in and clicked the enable debugging checkbox in the settings but when i went to debug it said disabling breakpoints program will break at the beggings of execution i guess i must have missed something when trying to turn on debugging
|
|
|
|
|
1. variable initial
2. windows own-message
|
|
|
|
|
hi,
how to remove help button in cpropertysheet.
thanks in advance.
|
|
|
|