|
That was just a remark. I asked a question first which is more important: why are you using your list control this way ? Why not simply associate a member variable with the list control through the resource editor ?
|
|
|
|
|
Well I have added member variable by right clicking on the CList control. Wizard just added control variable in .h file:
public:
CView list;
And added DDX Control code in .cpp file:
DDX_Control(pDX, LISTVIEW, list);
But I got these errors during compile:
1. error C2259: 'CView' : cannot instantiate abstract class <br />
2. error C2248: 'CView::CView' : cannot access protected member declared in class 'CView'<br />
3. error C2259: 'CView' : cannot instantiate abstract class
Well I changed the CView type to CListCtrl. The application compiled successfully but when I tried to add an item it gives me this error:
Unhandled exception at 0x275b9098 in dot.exe: 0xC0000005: Access violation reading location 0x00000050.
and shows file afxcrit.h at line:
LeaveCriticalSection(&_afxResourceLock[nLockType]);
I guess the previous problem still remains...
One more thing application also crashes at the same point when I click column header (it does not contain any data)
modified on Wednesday, September 3, 2008 6:54 AM
|
|
|
|
|
I think you are doing a big mess with your code . If MFC associated a CView object, then it means you did something completely wrong.
Ok, start everything over: put a list control where you want with the resource editor (and remove what you did earlier). Then right click on it and select 'Add Variable'. Then in the dialog that appear, leave the 'Control variable' check marked and insert the name in 'Variable name'. Finally click ok. This should add a CListCtrl variable in your class that you can then use.
|
|
|
|
|
Yeap you are right. I found the problem. I added MS ListView version 6.0 activeX control and did not add any related lib. So I removed that control and added another version of listView now it is working.
Thank you very much for your replies.
Now I need to solve other problems... Learning Visual C++ seems like never ends
|
|
|
|
|
dehseth wrote: Learning Visual C++ seems like never ends
I suggest to buy a good book. You will see that it is far more efficient to do so rather than trying to work everything by yourself. It will save you hours of frustration.
|
|
|
|
|
Hi All
I have two dialog A and B. A dailog is running first and B is running after click button on dialog A. Now problem is that when dialog B is running and again click on button A,then one more dialog B is open.
Also i want to set option if Dialog B is Open Then A Dialog cann't be close.SO How can i set these option...
Plz help me
|
|
|
|
|
Use modal dialogs, from your query it appears that you are using modeless dialogs. Also you can use a flag variable to check if some other dialog is open. if that flag is true don't call the close for dialog A
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
you have to create B telling it that A is its parent (pointer parameter to the constructor) and open it using DoModal()
|
|
|
|
|
make one member variable that store the pointer of cerated dialog B
which is initialy NULL and create the dialog when its null if its not null than dont go for create it put same check in OnClose
|
|
|
|
|
I want to install files programatically that are installed by the word (or any office component) when we clck on toll speech menu it ask for install
files or not if we click yes it will install some file which i dont know
CAn i do it programatically.
|
|
|
|
|
Installer is basically an executable and you can certainly call it from your program by using any of these APIs like ShellExecute/winExec.
Regards,
Rane
|
|
|
|
|
i knnow its done by msiexec but what to call
from command prompt to install remaining speech recognization files.
|
|
|
|
|
microsoft should have a speechredist executable for you to use.
|
|
|
|
|
Hi All
Can i add two exe?Both exe of VC++2005.One is Dailog base and other is MDI. Can i add it?If yes then how?Plz help me
singh
|
|
|
|
|
What do you mean by adding two exe ?
You mean use the second one in the first one ? Spawning it a new process is not enough ?
|
|
|
|
|
Ok
So there is any new options?
singh
|
|
|
|
|
you can't simply add two exe's or I am not getting what do you mean by adding? If you want to use the functionality from one exe in another one, you can include the relevant code/header/source files and then proceed.
polopo wrote: So there is any new options?
AFAIK, it wasn't there earlier.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
can you give me more details..Plz how can i do that..
First code is in Dialog based and second one is MDI..
Plz help me
singh
|
|
|
|
|
I guess you want to display your dialog from within your MDI app ? Can't you simply start it as a new program ? Or do you really need it to be integrated in your app ?
If that's the case, then as the previous poster said, you will have to include the source files from your second app into your first app and add some code to create and use the dialog.
|
|
|
|
|
ok i try to do that.
Thx's for help
singh
|
|
|
|
|
Still your question is not clear . Do you mean you need to call MDI appln from the Dialog based application?
Regards,
Rane
|
|
|
|
|
yes you are 100% right..So can you give me small example
singh
|
|
|
|
|
You may use the API WinExec in your Dialog based application code. Say if you want to call the MDI application on the click of a button in your dialog based appln, then add it to the OnButtonClick() method the below piece of code.
WinExec("c:\\Polopo_MDI.exe",SW_SHOWNORMAL);
Regards,
Rane
modified on Wednesday, September 3, 2008 3:43 AM
|
|
|
|
|
Rane wrote: You may use the API WinExec
This function is provided only for compatibility with 16-bit Windows. New applications should use the CreateProcess function or ShellExecute.
|
|
|
|
|