|
Hello Friends,
I got a problem.
I had splitted the actual view into 4 parts. every view is been derived from different view's class.
The main problem is the one splitter window which has been derived from the FormView has got 2 edit boxes which will resizing itself based upon the size of the window. and when I click in someother view some message has to be displayed in these edit boxes. for example when I click in View1 then some message which I pass from View1 has to be displayed in the edit boxes present in the View2.
I am trying but its always giving me assertion failed and when I debug it its giving the asserting failed in the SetWindowText message. I had created 2 different variables of type CEdit.
Neelesh K J Jain.
|
|
|
|
|
Neelesh K J Jain wrote:
I am trying but its always giving me assertion failed and when I debug it its giving the asserting failed in the SetWindowText message.
Is it line 44 of afxwin2.inl ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello all,
I've been programming in VB for a few years and I'm trying to learn Visual C++. I'm doing pretty good figuring everything out, in part thanks to this websit, but I'm have a problem using a combobox control. I have a form I created in the resource designer of VC++ 6.0 with two comboboxes. I have entered the data for the list of each box in the properties page but when I run the app and try to display the list all I get is a blank list. Is there something I'm doing/not doing? Do I have to call some sort of load list function even though I created the box in the designer?
Thanks for any help,
JJ
|
|
|
|
|
You need to resize the control itself to be a little bit taller. For more on this, read here.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I tried that before I posted my original message. That's how I got the list portion of the box to show up at all. But it's still empty instead of populated with the data I entered.
Thanks,
JJ
|
|
|
|
|
What else are you doing in the dialog's OnInitDialog() method? Any calls to UpdateData() ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
There is nothing in the dialog's OnInitDialog.
No call the UpdateData but I do call UpdateWindow for the parent window of the dialog.
|
|
|
|
|
So what you are saying is that you created a combo box on your dialog app and then right click on it and chose properties? Then under the data tab you entered in your data that you want listed?
So I just did this in VS 6.0. After each entry are you holding down the control key and hitting enter to go to the next line and entering in the next data?
And it's still not showing up?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Yes, exactly. I entered info in the "data" tab of the properties and held ctrl+enter to put in additional lines and still nothing appears when the app is run. Any ideas?
|
|
|
|
|
What happens if you enter items in the control at run-time (i.e., AddString() )?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I'm not using MFC, so I don't know if AddString() will help. Is there a way to do the same thing under Win32 app type? I would prefer not to use MFC if I can do that.
|
|
|
|
|
Yes, send it a CB_ADDSTRING message.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Since the combobox is part of a designed form and I didn't have a handle for it I used:
char comPort2[12] = "COM3";
SendMessage(GetDlgItem(hDlg, IDC_COMBO_Ports), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)comPort2);
This didn't work but I did cause a change. Now instead of a long blank list I get a blank list with only room for one list item. Could it be that the font color is white or something? Also, did I use the above code correctly?
Thanks
|
|
|
|
|
wolfjj wrote:
Now instead of a long blank list I get a blank list with only room for one list item. Could it be that the font color is white or something?
It still sounds like the control is not tall enough. Looking in the project's .rc file, what are the dimensions of the control (i.e., x, y, cx, cy)?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
This is what's in the resource file:
COMBOBOX IDC_COMBO_Ports,75,7,98,35,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
I believe 98 is the width and 35 is the height. Like I said, when I use the Test feature of the dialog editor, it works fine.
|
|
|
|
|
wolfjj wrote:
I believe 98 is the width and 35 is the height.
Correct. I like to use a height of no less than 60. This ensures that I can see at least five items in the combobox.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I tried setting the height to 60 in the .rc file with notepad; didn't work. The combobox still shows a blank list that would have shown about 5 items.
|
|
|
|
|
By chance does the control have either the CBS_OWNERDRAWFIXED or CBS_OWNERDRAWVARIABLE style in use?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
No, but I did try that earlier on the offchance it was the problem; didn't work either.
|
|
|
|
|
The code that I tried in my previous reply seems to be working now. I don't know why now but I know that it didn't work until I clicked "Layout/Test" in the Dialog Editor for that form, where the form worked just fine. I wish I knew what the problem was. If you can help me find out why it's doing that, I'd be thankful, but if not then I can use what I just got working.
Thanks David
|
|
|
|
|
Hi,
I have working on a monitoring application which has to spawn another application and monitor it to if the application crashes or hangs or sleeps during its life time, restart the application again, it should monitor the application for 72 hours, I was looking to almost all articles and some like createProcessEx was good but I don't know why it doesn't work for me, my application gets sleepy after a while and doesn't come back to the parent process, how can I find out that?
I have WaitforSingleObject and getExitCode but it doesn't come back to parent process, it just sleep somewhere
Is there anyone who can help me in that matter? I will appreciate that
Coral
|
|
|
|
|
So you have application A that will start application B using CreateProcessEx() . Application A will wait on application B to finish using WaitForSingleObject() . Is that correct so far? When application B finishes (both normally and abnormally), what, if anything, does application A do?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
When I bring upp my open file dialog I get int 3 error,
At the same time I have a timer that make some things with a interval of 1 sec. If I kill the timer I can bring up the open file dialog but when a open the file I get the same error int 3. What Im I doing wrong?
Way do I get that error?
Please help me.
|
|
|
|
|
Hi,
I've to enter characters in 1 edit box.
I need to get character by character for each click of the control button in another edit box.
How is it possible?
Pls help.
Mithuna
|
|
|
|
|
char text[1024],set[1024];
GetDlgItemText(hdlg,IDC_EDIT1,text,sizeof(text));
strcpy(set,text[1]);
for (int i=1; i
|
|
|
|