|
hi i need help in the case of Tree View Control with Check Box.
my problem is whenever i select a check box and click close/cancel(within the dialog box) and come back to check box selection i need the previous tree state
to be retained,ie if i selected "parent1" and closed it when i come back again to the dialog box i will get the new dialog where previous state is lost.
status should be retain till the end of the close of main window.
here is the code with which i am trying . but it dint work
/*if(PreviousCheckStatus)
{
TVITEM item;
item.mask = TVIF_HANDLE | TVIF_STATE;
item.hItem = hParent1;
item.stateMask = TVIS_STATEIMAGEMASK;
item.state = TVIS_SELECTED ;
SendDlgItemMessage(hWnd,IDC_TREE1,TVM_INSERTITEM, 0, (LPARAM)(&item));
}
*/
i will send the complete program, if any body have the solution for the problem.
please mail me to rameshsms@rediffmail.com
sramesh21@gmail.com
regards,
ramesh s
ramesh s
|
|
|
|
|
if I understood you lost your data because you dont save them.
And also use of
pre when you write a code you can click preview button before post a message
|
|
|
|
|
hi,
actually i am saving the state of each check box in a global variable ( in the piece of code var..if(PreviousCheckStatus)...
PreviousCheckStatus variable holds the state.
but when i return back to the dialog box, previous state is not appearing...
if u can get me ur mail id, i ll send the program for ur reference.
regards,
ramesh s
|
|
|
|
|
ramesh_s21 wrote: but when i return back to the dialog box, previous state is not appearing...
What does this line mean? Whether the global variable is not showing the prev status or the control on the dialog?
If 'the control' is ur answer then ... are u setting the control according to the value of your global variable in the dialog's OnInitDialog()?
KIRAN PINJARLA
|
|
|
|
|
i am checkin the global variable in WM_INITDIALOG.just for the sake of testing one global variable is being maintained for each checkbox.if the variable has true value, then trying to set the corresponding checkbox as selected.
when i run the app for the first time, obviously the global variable will have value 0.
consider i select a check box(corresponding global variable is True now).i ll close the dialog n open it again.here that peice of code i given above is not working.
could u get me ur mail id so that i can send u the complete program ??
regards,
ramesh s
|
|
|
|
|
hai,
Iam gettind this linker error when i compile my code.
corelibc.lib(pegwmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function WinMainCRTStartup
For this if i change my setting options in link as wWinMainCRTStartup iam getting this error.
Linking...
uafxwce.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in coredll.lib(COREDLL.dll)
uafxwce.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in coredll.lib(COREDLL.dll)
uafxwce.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in coredll.lib(COREDLL.dll); second definition ignored
uafxwce.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in coredll.lib(COREDLL.dll); second definition ignored
Can Anyone please suggest me what i should change in my settings.
Thanks & Regards,
Harshadha.
|
|
|
|
|
|
My error got rectified.Thanks a lot..
Harshadha
|
|
|
|
|
Dear All,
I have done a product. I need to write a documentation for that. I dont know about writing documentation.
Can any one show me an example of writing product documentation
Thanks.
Nice things do nice works
|
|
|
|
|
Hi All,
I have one MFC application suppose abc.exe , and i am invoking another appliction X.exe(which may or may not a MFC application).My problem is how can i minimize,maximize and hide the application X.exe thru my parent application abc.exe.
Thanx in advance
birajendu
CyberG India
Delhi
India
|
|
|
|
|
birajendu wrote: how can i minimize,maximize and hide the application X.exe
Use ShowWindow() for that purpose.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Can you get handle of window in question ? Use FindWindow for that. And use ShowWindow for completing your tasks.
|
|
|
|
|
Thanx a lot...
birajendu
CyberG India
Delhi
India
|
|
|
|
|
You can use of ShowWindow and you need to a handle to another program for again show it
|
|
|
|
|
thanx..
birajendu
CyberG India
Delhi
India
|
|
|
|
|
Hi,
I'm facing a problem with the COM Dll that is also written by us.
I have a COM Dll, which uses another two dlls. And for UI I have another application which uses the COM Dll(The application is a Win32 application without MFC Support).
When the COM Dll is built in the release mode, CoCreateInstance method causes the message box "User breakpoint called" to be popped up.
In fact the CoCreateInstance does so many other things like initializing the communication, initializing the drive..etc.
When the Dll is built in the release mode, it causes no problem.
The problem I've identified is in the statement where delete <someobject> was being called.
The interesting fact is that the problem does not araises with the applications with MFC Support. My one perticular application is without MFC Support. The COM Dll is built with Static MFC support.
Another thing is that, to make tha applicaion up the COM Dll should be built with the Shared MFC Dll support. But when I make COM Dll with shared MFC, other applications(those were built with MFC support earlier) does not work.
I'm confused how the MFC support for the COM Dll affect the behaviur of the applications. Please provede me with a solution.
Thanks and regards,
Raja Pratap Reddy
|
|
|
|
|
Hello Friends.
When I click on the Item in the listCtrl, next Item should also be selected.
I did it by using SetItemState() method.
When I select item it works fine i.e next item is also selected but when
I click on that selected item,ideally,the item next to it shld be selected.
But it only flashes...I mean it is selected and next moment it gets deselected by itself.
Here is my code ..
Its written in the function of NM_CLICK Message.
CODE :
BOOL l_bRet = 0;
POSITION pos = m_SelList.GetFirstSelectedItemPosition();
int index = (int)pos;
for(int j=(index-1); j
|
|
|
|
|
Hi All,
I have a snap-in application which was wriiten for MMC 2.0 using MMC
2.0 SDK. On porting the sample application on Longhorn which has MMC
3.0 by default, I get the snap-in error asking whether I need to
shutdown mmc application.(" MMC has detected an error in snapin.....").
I was not able to find any C++ samples along with MMC 3.0 SDK. Are
there any additional callbacks that I need tp include to provide
support for MMC 3.0? If yes, where from I can get them? Any pointers to
the C++ samples for MMC 3.0? Any help on this would be appreciated.
Regards
Uthra
Uthra ragavan
|
|
|
|
|
Hi,
I have implemented in the code for wmi.
It works just fine for cimv2 workspace and Win32_OperatingSystem class.
It is not working for any other class (i need Win32_CDROMDrive) in cimv2 namespace. Not even working for root/wmi namespace.
part of my code is :
IWbemClassObject *pclsObj = NULL;
ULONG uReturn = 0;
while (pEnumerator)
{
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,
&pclsObj, &uReturn);
if (FAILED(hr)){
AfxMessageBox("Failed");
}
if(0 == uReturn)
{
break;
}
}
It successfully connects to the namespace but later, it gets uReturn as zero always and breaks.
I tried BeginEnumeration as well before executing 'next'.
(For wmi namespace, 'hr' fails after connecting to the namespace.)
Is there anything else that I need to do?
Please help.
Thanks ,
Manasi
|
|
|
|
|
Here[^] is an example of Win32_CDROMDrive of course in C# (I think you can understand it)
only see (foreach(datatype variablename in Arrayname) )
(1)datatype is type like char/int,...
(2) variable name for detect elemets in array
(3) arrayname name of Array
|
|
|
|
|
|
I hope it solved your problem
|
|
|
|
|
I am doing a windows form application in ms VC++ . I am using MS Visual C++ Express Edition 2005 IDE. I am not able to get a standalone application when I compile the code.The compiled code only works on comps which have the IDE installed. Cant i get a standalone application that requires .NET Frame work only to be installed and not on the IDE?
SBK
|
|
|
|
|
You need to ship dependent dlls, to work your application.
|
|
|
|
|
Your app will create a manifest file, or embedd one. This tells windows what else your program needs. There's a VC++ redistributable that sets up all the WinSXS stuff you may need, that will probably solve the problem.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|