|
I have create DBGrid controls at run time and want to catch event corresponding each instance but find no way.
so if someone know about it plz tell me
|
|
|
|
|
I tried to create a cobject derived class:
CObject*t=(CObject*)RUNTIME_CLASS(CHScrollTitle)->CreateObject();
and then i tried to free it with:
delete t; or CHScrollTitle::operator delete(t);
but the delete operator failes in debug-mode with an assert-notice. (something with pHead->nBlockUse==nblockuse)
does anybody know how to free a with CreateObject(or CArchive::ReadObject()) created object?
\
TIA B.Bruggeman
|
|
|
|
|
This problem isn't probably related to CRuntimeClass::CreateObject - seems that you've corrupted the heap somehow.
BTW: calling CRuntimeClass::CreateObject makes absolutely no sense when you know the exact type of object - in your case, it's CHScrollTitle. You can just write
t = new CHScrollTitle;
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I also thought it was a memoryleak/overwrite but i wrote a simple test program and than already it assert's about the debug-memory-tracing-variable m_nBockUse,
but when i use new/delete it doesn't assert..
i have different kind of classes in a list and i want to serialize them using Write/ReadObject, so i can't use an ordinary new/delete operator. but when i tested this it asserts in the (debug) operator delete, so i tested it with the lines i posted before, but it still asserted..
so do you have other suggestions?
btw in the file afxmem.cpp are many operator delete which (in debugmode) either call _free_dbg(p, _CLIENT_BLOCK); or _free_dbg(p, _NORMAL_BLOCK);, so probably the wrong deconstructor is called.. but how do I fix this?
TIA. B.Bruggeman
|
|
|
|
|
1) memory overwrites: the fastest way to detect/remove them is by using automatic diagnostic tools, like BoundsChecker (www.numega.com) or Purify (www.rational.com)
2) serializing different CObject-derived classes from list: just use operator << with pointers to objects. MFC is smart enough to write metadata containing type information to archive. You don't need to write type information yourself.
CBaseClass *p = list.GetHead();
ar << p;
CBaseClass *p;
ar >> p;
delete p;
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
hi there,
I'm writing a client to manage a remote ms-access database, how can i do that is it with SQLConfigDataSource
or something else ??
my problem is that my db is on my website ie:
www.mywebpage.com/database/mydb.mdb
a sample code will help me lot
thanks in advance ...
|
|
|
|
|
how can i add a version number to the CDocument class?
ZHANGYIFEI
|
|
|
|
|
1. Don't double post.
2. You really DON'T want to add _anything_ to the CDocument class.
The whole idea of MFC is that it encapsulates base functionality. To extend it for specific requirements, you inherit an MFC class and extend and customise to your hearts content.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Is my dll will be matched for another language (delphi, vb ect) if I created it in ATL COM APP Wizard and I use in class CDialog into this project ?
|
|
|
|
|
Delphi and VB will be able to call a COM dll generated by ATL/WTL Wizard. I don't tend to use MFC but rather ATL for my dialog classes. As long as you don't export any MFC/C++/C Datatypes then a COM dll should be able to be called from any lanugage that supports COM.
Michael
|
|
|
|
|
MSDN contains an article titled How to add MFC code to an ATL project. It explains all.
Thanks for the help,
Bill
|
|
|
|
|
You must have no problem with that, while in the pc you have the MFC runtimes.
I build ATL Com Objects from a lot of languajes, like delphi, VB, VBScript, VFP, etc....
Cheers
Carlos Antollini.
|
|
|
|
|
The question is why would you need to ? ATL is designed to be lean, why fatten it up with MFC ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hello,
I am trying to write an application in WTL with CListView.
But that CListView Can not implement Extended List-View Styles
:LVS_EX_FULLROWSELECT.
Could some one send me a link or code to create ListView that LVS_EX_FULLROWSELECT in WTL.
Thanks in Advance
dkwang
|
|
|
|
|
From my WTL code, m_listctrlData is a CListViewCtrl.
m_listctrlData.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
hope this helps,
Michael
|
|
|
|
|
|
Dear friends
Hi
Will u please any one help me how to select/access a particular text using drag-mouse movement.as an output display file i want to use this selected text.how it is possible.Please help me,i am new to VC++,so kindly help me in getting the solution.
Thanking you in advance.
Bye
Binay
|
|
|
|
|
Is there a standard way to add buttons to a menu bar like outlooks vertical one?
and if so could someone tell me where i can find more info on using this type of toolbar
|
|
|
|
|
I created dll by MFC AppWizard (dll).-> Dialog based
Now I want to provide it for another language.
I saw that I can adding class type : ATL Object to my project and the wizard adding for me all the support for ATL.
1. Is it can help me to match my dll to another language ?
2. If yes , How ? What I have to do in this ATL so that every developer(vb, delphi atc) will can implement with my dll my dialog ?
|
|
|
|
|
I don't believe adding ATL support will fix your problem, you're probably better off building an IDispatch implimenting ATL dll from scratch.
I could be wrong, it just seems to me that adding ATL support still means you need to impliment all the interfaces you want anyhow, so why not start again ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
because I dont success understand how to do it !!!!
What is IDispatch ?????
When I create by the wizard project ATL COM I dont know how to convert my code in mfc to the strange language( IDL ??) that ATL uses.
Please HELP ! It is very urgent !!!!!!!
|
|
|
|
|
Create an ATL object such as MyDialog with the Wizard.
Add a method to the interface such as ShowDialog
Inside the ShowDialog function, call your dialog
m_MyDialog.DoModal()
Declare an instance of m_MyDialog in the class definition.
hope this helps,
Michael
|
|
|
|
|
Sorry, but it's clear you don't know enough about COM in order to write a COM dll. Adding ATL support allows you to write ATL code, it does not link everything up magically for your dll to become a COM object.
IDispatch is an interface derived from IUnknown, which is the base interface for all COM objects. IDispatch is the interface for automation objects ( those visible to VB, etc ). IDL is the language use to define interfaces ( that's what the I stands for ), and you can't convert MFC to IDL, they are different beasts. Again, you're in real trouble if you need to achieve this in a hurry, you cleary do not have the skills you need.
I recommend you buy some books on ATL. I don't know that much about it myself, but you clearly are hoping for a magic bullet, and you aren't going to find it in the solution you're looking for, sorry.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
What you need in your dll are COM interfaces. These will allow you to access the controls methods and properties from other applications.
The best way to do this using MFC is to start with a different project type, MFC ActiveX control. Otherwise use Class Wizard to add automation interfaces. Go to the Automation tab. Choose Add Class, create your class and click the Automation radio button. This will add, not only a new class, but an interface. When you look in Class View, you will see CMyNewClass and IMyNewClass.
Thanks for the help,
Bill
|
|
|
|
|
Can someone tell me how to get CListCtrl::SetBkImage() to 'actually' work??? I've been messing with it for quite a few hours and just can't seem to get it to work. TIA
Kevin Power, Jr.
|
|
|
|