|
the list is a list (CListCtrl), and the edit stays an edit (CEdit).
what you have to do is :
1. read the edit
2. add to the list
CString strCaption;
m_Edit.GetWindowText(strCaption);
m_List.AddString(strCaption);
do you understand it better now ?
|
|
|
|
|
can u plz tell how to remove the item using the remove button and reset the list
|
|
|
|
|
|
read this carefully
http://codeproject.com/combobox/listbox_tut.asp
|
|
|
|
|
parichaybp wrote: there i declared m_LIST of type CString.
Delete the variable and recreate it as a CListBox instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
parichaybp,
AddString is function in CListBox not CString
you should declare a variable ListBox:
you eneter ListBox Control in your form
and then right click in control(ListBox) and declare a variable for this control
Now you can use this this function or functions
You can use this code
CString Str;
Str="This is test";
m_List.AddString(Str);
or other functions
|
|
|
|
|
WhiteSky, i have one question for you :
1. do you read the other answers when replying to a post ?
2. (implisit one) Why do you repeat my answers ?
|
|
|
|
|
whats happen?
1-yes i see all answers, but sender reply to my answer
well I should reply to question(parichaybp )
2-you're good programer,and if my answer and your answer is equal because question is same
( is good )
And have a nice day
|
|
|
|
|
Thanks its working. items are getting added.
|
|
|
|
|
one more thing how to remove the selected the item from list box using the remove button.
|
|
|
|
|
hi!!
1.how can i execute my program in PC which is not installed VC++ 6.0. An error appear that MFC32.DLL was missing (i dont remember the exact error).
HelpMe
|
|
|
|
|
when providing your program, you have to either statically link the MFC dll (i don't recommend because it will considerabily increase the size of your exe), or provide the 2 or 3 dlls required.
they are mainly MFC32.DLL and MSVCRT.DLL
to know exactly which DLLs your program is linking to, you could use Dependency Walker[^] tool (which is provided with VS6 - look in the start menu | Programs | Visual Studio 6 | Tools)
|
|
|
|
|
v2.0 wrote: to know exactly which DLLs your program is linking to, you could use Dependency Walker[^] tool
Correction. To know exactly which DLLs your program is implicitly linking to, you could use the Dependency Walker tool. Those that are explicitly linked will not show up in the Dependency Walker tool.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
sure, but he his case, it might solve his needs...
moreover, even if he links some dlls dynalically, i hope he knows about them...
but good intervention David
|
|
|
|
|
1. Open your project in MS VC++ compiler.
2. Go to Project and then Settings
3. Select Genral tab, Under Microsoft Foundation Class, select
Use MFC in a Static Library
4. Recompile your project.
Good luck
We Believe in Excellence
www.aqueelmirza.cjb.net
-- modified at 6:50 Thursday 6th April, 2006
|
|
|
|
|
Hi,
Iam actually trying to use record set with just a simple in dialogbased application.I have a form with two edit boxes m_name1 and m_grade1 and I've used a button called display pressing on which I should retrieve the results from the database.So,now my problem I constantly get errors saying m_name1 :Undeclared identifier and when I try to declare a recordset var say *m_prs I get an error .So,how do I actually retireve records.Where should I actually write the code regarding that?In the form or in the derived dialog class.
pls help
swapna_signsin
|
|
|
|
|
Without the code giving debugging advice is difficult. Some suggestions:
- Did you declare the member variables?
- Did you include all required header files?
- Did you spell the class names for the edt boxed correct?
- Dit you include semicolons after each declaration?
- Did you use the correct numer of braces?
- Did you close your function with a curly brace? This can be very nasty to find out.
Sometimes you get strange error messages if you forget a token. The error also may occur at upexpected places.
|
|
|
|
|
Hi swapna
did u got my mail
I hv posted u sample application
|
|
|
|
|
swapna_signsin wrote: ...when I try to declare a recordset var say *m_prs I get an error .
Did you use ClassWizard to derive a class from CRecordset ? In the dialog's .h file, add a member variable (not a pointer) of this new class. In the dialog's OnInitDialog() method, call the recordset's Open() method.
When you get all of this done correctly, post back and we can give you the rest of what is required.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
How to make an owner drwan Picture Box in ATL ( not using MFC support)
I need the picture transparent in the dialog.
I am using ATL composite control dialog
Any suggestion , code are welcome
Thanks
Anil
|
|
|
|
|
use the CreateCompatibleDC win GDI function, then when u have the dc, just bitblt the bitmap in it.
to make it transparent use the alpha blend there are many samples of transparent bitmaps in codeproject...
hope this helps
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
But there Picture Control, there is no Owner draw property listed in Property Window. I manuall modified rc file and add SS_OWNERDRAW, But i am not gettiing the WM_DRAWITEM message....
So i cant do any drawing for this picture box
|
|
|
|
|
oh now i see the problem....
as far as i know, you can not do a picture control owner draw, the idea of a picture control is to load a picture stored in the resources....
do it an a different way, one would be to get the window/dialog DC and then continue as suggested above, without using the picture control...
hope it helps
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi all,
I am trying to use WMI (just learning) in VC++. However, there seems
to be a problem when it comes to connecting to a Remote Host . Which
works very well on the local computer. The machine I am trying to
connect has Win2K on it and I have WinXP installed on my machine. Now,
when I try to execute the following code snippet, it gives me an Access
Denied error. Also when I try to query the same through WBEMTEST.exe,
everything work fine. Here is the code snippet : -
// Initialize Security
hrRetVal = CoInitializeSecurity(NULL,
-1,
NULL,
NULL,
RPC_C_AUTHN_LEVEL_CALL,
RPC_C_IMP_LEVEL_IMPERSONATE,
NULL,
EOAC_NONE,
0);
// CreateInstance
hrRetVal = CoCreateInstance(CLSID_WbemLocator,
NULL,
CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
IID_IWbemLocator,
(void **) &pWbemLocator);
BSTR bsNameSpace = SysAllocString(L"//RemoteComputer/root/cimv2");
BSTR bsUserName = SysAllocString(L"abc");
BSTR bsPassword = SysAllocString(L"123");
// Connect to the Server
hrRetVal = pWbemLocator->ConnectServer(bsNameSpace,
bsUserName,
bsPassword,
0,
NULL,
NULL,
0,
&pWbemServices);
// Query the Proxy Blanket for Authorization Level
hrRetVal = CoQueryProxyBlanket(pWbemServices,
NULL,
NULL,
NULL,
&dwAuthLevel,
NULL,
NULL,
NULL);
// Set the Proxy Blanket to the Authorization Level
hrRetVal = CoSetProxyBlanket(pWbemServices,
RPC_C_AUTHN_WINNT,
RPC_C_AUTHZ_NAME,
NULL,
dwAuthLevel,
RPC_C_IMP_LEVEL_IMPERSONATE,
NULL,
EOAC_NONE);
// Execute Query --> Access Denied
hrRetVal = pWbemServices->ExecQuery(L"WQL",
L"Select * from Win32_Service",
WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumObject);
It is here that I receive an Access Denied error. I don't seem to know
what is th problem.
Any help would be appreciated.
Thanks
TobeyMag
|
|
|
|
|
Hello,
Isn't there anyone who could help me.
Thanks
-TobeyMag
|
|
|
|