|
If your using CreateWindow(Ex) you have to set the hight to the hight you want your dropdown window to go because a ComboBox has it's integral hight so setting the hight just afects the dropdown not the ComboBox.
ex:
hComboBox=CreateWindow("ComboBox",NULL,dwStyle,0,0,400,200,hWnd,(HMENU)iIdCB,hInst,0);
else
if it is on a dialogbox just drag the middel point as far as you want the dropdown to go
i hope this helped
G_S
|
|
|
|
|
How do you use combobox did you create this control in your program
|
|
|
|
|
I created the box in the resource editor on a Dialog form.
u6ik
|
|
|
|
|
If it's a size problem, either increase the size of the drop-down portion in the resource editor, or see here.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks for your replies. All is working peachy
u6ik
|
|
|
|
|
Hi all,
when some one enters a hex value in a edit box ,say for example 0xffff
,then is there any way by which the value can be retreived as integer itself (not as text)??
when i retreive the data as text and try to convert it using atoi or atof routines the output is always 0.It'd be great if someone through some light on this ......
Thanks in advance
rajeev
|
|
|
|
|
You can use strtol[^] to convert your hexa string into a long. With this function, you can supply the base (which is 16 in your case).
|
|
|
|
|
strtol[] did the job...Thanks for ur help
|
|
|
|
|
Hello everyone,
Thank you for your suggestions in my previous message.It's working.As next step, i want to send my uint8 values here to serial port.For that i added two lines into my code (bold) but i receive this error,
[Linker Error] Unresolved external '_outportb' referenced from H:\INTERFACE\INTERFACE.OBJ
(Interface is the name of my file in which i saved my code and files)
I didnt get the cause of problem,what's wrong?. If anyone has an idea, would be pleased!
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h> // system()
int transmit (double x);
int i;
system();
outportb(int port, unsigned int);
int transmit (double x)
{ union ifas
{
double d;
unsigned char u8value[8];
};
union ifas member;
member.d = x;
printf("\nmember.d=%d\n",member.d);
for ( i=0 ; i<8 ; i++)
{
printf("\nmember.u8value[%d]=%f\n",i,member.u8value[i]);
outportb(port,member.u8value[i]);
}
return 0;
}
int main(int argc, char* argv[]) //Console
{
double var;
scanf("%lf",&var);
transmit(var);
system("pause");
return 0;
}
Regards,
Cahit
-- modified at 11:37 Thursday 17th August, 2006
|
|
|
|
|
%d format specifier is signed decimal integer. For your double, use %f. For your unsigned ints, use %u
-- modified at 8:35 Thursday 17th August, 2006
Well, actually, since you have chars in your union you should use %c instead of %u.
Cheers
Steen.
"Are you gonna check your makeup when you're done whining?" John Simmons, 05/31/2006
|
|
|
|
|
cahit23 wrote: union ifas
{
double d;
char u8value[8]; //??????????????
};
Use unsigned char for u8value
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I don't know how many C++ guys search for articles.
this is my last article - hope you like the toolbar and give me some suggestions.
See The toolBar [^]
|
|
|
|
|
Hello,
I am not able to find any function which will get me the line no. on which the cursor is present in RichEdit Control in MFC? How to get it? Is there any function to get it? If yes, then what is it?
Thanks,
Software Developer
Sanjay Khapre
|
|
|
|
|
SanjaySMK wrote: line no. on which the cursor is present in RichEdit Control in MFC
Hmm - never needed that.
But does GetSel() followed by LineFromChar() work?
-- modified at 7:58 Thursday 17th August, 2006
Just found it in the Doku for LineFromChar() :
"If [the Parameter] nIndex is –1, it specifies the current line, that is, the line that contains the caret."
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Thanks a lot jhwurmbach, I was trying so many things, but finally found your reply apt and exact. LineFromChar worked perfectly.
Thanks a ton.
Regards,
Software Developer
Sanjay Khapre
|
|
|
|
|
What the function can support this issue?
|
|
|
|
|
|
Max++ wrote: What the function can support this issue?
EDITBOXOBJECT::SetFont
"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
Support CRY- Child Relief and You
|
|
|
|
|
CFont::CreateFont(...) and then CEdit::SetFont(...)
|
|
|
|
|
For example:
CPoint*pc=new CPoint;
//delete it in an array way:
delete []pc;
is the delete harmful?
if it is harmful, I have to add a flag in collection to record which pointer is for single object as example above or for array.
|
|
|
|
|
Yes, this can lead to troubles because allocating an array is not the same as allocating a single instance. For the array, there is first the number of instances that is saved just in front of the allocated memory. So, using delete[] it will try to read the number of instances first.
But why use a flag ? In your case you know if you use new or new[] (and normally you always now that).
If you do this:
CPoint* pc = new CPoint[1];
This is the same as allocating an array thus, delete[] will be ok.
|
|
|
|
|
Cedric Moonen wrote: CPoint* pc = new CPoint[1];
good idea
|
|
|
|
|
includeh10 wrote: CPoint*pc=new CPoint;
//delete it in an array way:
delete []pc;
wrong way! you have to create that the array way before deleting!
"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
Support CRY- Child Relief and You
|
|
|
|
|
i have 2 CEdit (CDialog) i want to search if the text from CEdit (1) matches with 1 record (in my database )( my database visualfoxpro - CRecordset - snapshot ) and the matches must fill in the second CEdit ! how ?
thanks !
Bravoone
|
|
|
|
|
I find the easiest way is with a parameterized recordset. Please do not ask what that is without searching for it yourself first. You can either use Google, or peruse the CP articles. Hint: one of my articles has an example.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|