|
This wont work for buttons anymore...
Nish
One Nish is trouble enough.
Imagine 16 of me, dancing wild...
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
|
|
|
|
|
Yes - I goofed - need to have an owner draw button...
|
|
|
|
|
You can use a CBitmapButton
Nish
One Nish is trouble enough.
Imagine 16 of me, dancing wild...
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
|
|
|
|
|
|
hi,
I want to execute different functions depending on the condition set.I know it can be done with function pointers but I want to do it with preprocessors.
How to get about with it.
Cheers.
|
|
|
|
|
The standard approach is like this:
#ifdef SCENARIO1
f1(...);
#elif SCENARIO2
f2(...);
...
#else /* SCENARION */
fn(...);
#endif Then in Project->Settings->C/C++->Preprocessor definitons set the appropriate macro depending on the scenario/configuration you wish to select.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hi,
ok but how to eneble those?
Gerrard
|
|
|
|
|
hi
i would like to add a default value of '1' in one of my edit box's when the program is executed.
Help on the code and where to place the code in the main would be good thanks
|
|
|
|
|
If your edit box is in a dialog OnInitDialog()
editbox.SetWindowText("1");
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
i assume i change 'editbox' to then name of my edit box 'IDC_KEY'
if so it gives me an error of
.cpp(123):error C2228:left of '.SetWindowTextA' must have class/struct/union type
|
|
|
|
|
nabila hussain wrote:
assume i change 'editbox' to then name of my edit box 'IDC_KEY'
No,you have to define controller for it,tell me if you use VC6 or VC7 to tell you how to this task.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
|
Go to class wizard(prees ctrl+w)
Go to "Member Variables" tab.
In the Class name box, choose your dialog class.
In the Control IDs box, click IDC_YOURTEXTBOX.
Click "Add Variable". The "Add Member Variable" dialog box appears.
Change the Category box from "Variable" to the other one.(I can't remember the exact name now)
In the Member variable name box, type the name you want,and its the name of your control,you should use this for SetWindowText()
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Use :-
GetDlgItem(IDC_KEY)->SetWindowText("1");
Nish
One Nish is trouble enough.
Imagine 16 of me, dancing wild...
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
|
|
|
|
|
nope that didnt work, it caused my program to totally crash
|
|
|
|
|
nabila hussain wrote:
nope that didnt work, it caused my program to totally crash
Where exactly did you use it?
Nish
One Nish is trouble enough.
Imagine 16 of me, dancing wild...
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
|
|
|
|
|
hi,
I created a CView derived type window in a dialog by passing the dialog as the parent window and its client area as the size.
Now-I get the display,also any drawings made or things add etc but I get some kind of debug error while closing the application and also I can't click on the view.Again error .
My question is
Whaaaaaaaaaaaaaay.
puhuleeeeeeees help.
Judi McDermott.
|
|
|
|
|
Is the CView object declared as a member of the dialog class.
If so try creating a heap object. Means instead of a CView member, use a CView* member. The CView classes call a delete this in the destructor or just before the destructor [dont remember exactly] and this often causes problems for stack objects [even member objects of other objects]
Nish
One Nish is trouble enough.
Imagine 16 of me, dancing wild...
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
|
|
|
|
|
hi,
CView is not declared as pointer.will try.
thanx anyway
|
|
|
|
|
judi wrote:
CView is not declared as pointer.will try.
Fine. Please let me know how it turned out...
Nish
One Nish is trouble enough.
Imagine 16 of me, dancing wild...
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
|
|
|
|
|
You shouldn't create a CView derived object as a child of a CDialog . Views typically reside in frames. if you want to reuse a set of controls, encapsulate them in a modeless dialog. You can then reuse the modeless dialog in a view or a dialog.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
hi,
thanx to every one who answered.
The situation is like this,
In my dialog class I have declared CGView(and later CGView*) type variable.(CGView : public CView)
In the OnInitDialog I got the client rect and created the view with that rect.
In mainframe OnCreate I made the dialog modeless.
Everything is fine untill I click on it.I will have to debug and it takes me to Viewcore's mousemessagefilter(something) function's line asserting the view to be pDesktopWindow.This is irrespective of it being pointer or not.
Then with nonpointer variable I had another error while terminating the application.
Why can't we create CView types in a dialog box?That would be simpler than all those methods described in this site.
And Nish,it still didnot work.
cheers
|
|
|
|
|
I'm using an OCX control in a small util, and one of the params requires a Boolean value. Since an OCX uses all Variant types, I defined a VARIANT_BOOL and assigned it to a C++ BOOL, then later a 'bool', but neither works.
I read up on the control and VB booleans, and the documentation indicates this is a 2-byte boolean "True/False" field. No matter what I try, the control tells me the param is invalid and should be either True/False.
I've tried: CString, BOOL, bool, BYTE, short, int, long, VARIANT_BOOL and castings of these data-types in various forms, but none of them worked!
Can someone please point me in the right direction, I just can't imagine it should be so difficult.
Thank you
D.
|
|
|
|
|
HA! Answered my own question, but I'll post the solution incase anyone else has this same problem (if there's a better way, PLEASE let me know).
// Set Init Variant Type as follows
COleVariant myVar(VARIANT_BOOL(TRUE));
// change to 2-byte bool type
myVar.ChangeType( VT_BOOL, NULL );
// call OCX
TheOcxCtrl->Save( myVar );
This works just fine!
D.
|
|
|
|
|
Could you help me how to do this ? : I need simple code to put a string(data) into WebControl(IE) without saveing it as file ? Or could you suggest some(-simple)link ?
Thanks you.
Libor Bares
Czech Republic,Central Europe
|
|
|
|