|
i want to get info from file manage, i.e. files, directories etc. i mean, directly, not by findfile functions.
but i have no idea how to accass to file manage, is it private property of microsoft, so we can't use it directly?
thx
includeh10
|
|
|
|
|
You mean accessing NTFS data structures directly? Sure, anyone can do that. You just have to hand over a small amount of cash and you can buy your way into the world of NTFS drivers.
If your bankaccount is below 6 numbers in US$ better forget it.
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
i am in the middle of an app, the app is a large one, so far, pure h/cpp code is over 4M.
a terrible problem happens now:
in release version, if open more than 5 documents at same time (by OpenDocumentFile() function), the app crashes.
in debug version, i even can't open any.
debug says:
BOOL CObject::IsKindOf(const CRuntimeClass* pClass) const
{
ASSERT(this != NULL); //problem at the line
// it better be in valid memory, at least for CObject size
ASSERT(AfxIsValidAddress(this, sizeof(CObject)));
// simple SI case
CRuntimeClass* pClassThis = GetRuntimeClass();
return pClassThis->IsDerivedFrom(pClass);
}
do you know why and how to fix it?
thanks for any idea.
includeh10
|
|
|
|
|
includeh10 wrote:
ASSERT(this != NULL); //problem at the line
If this assert fires (in DEBUG mode), obviously this must be NULL.
Maybe the call came from a static function(not having associatied object) or from a global function.
Finding that call and guarding against this error should be possible if you use the call stack.
Maybe we can help you again when you show the context of this call.
|
|
|
|
|
I want to create COM dll that will fire events and transfer data to its clients. Is it possible to create such dll without being an ActiveX control
|
|
|
|
|
Of course, it's just a normal COM without implementing the interfaces needed by ActiveX.
|
|
|
|
|
That's not a matter of ActiveX.
Your COM component must implement the IConnectionPointContainer interface, and provide one or more IConnectionPoint which are event sources.
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
Can you make a secure download with CHttpSession? One that accepts certificates or allows you to accept it? I tried setting the secure flag but it times out. I assume waiting for a certificate to be accepted. Any thoughts?
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
In VS.net, when we open a cpp file, header file, resources, even the help pages, they are showing in the same tabpage-like pane. How can I create something similar ?
Any open source controls like it ?
Should I create different multiple document templates for each types of documents ?
|
|
|
|
|
Hi,
In a dialog based application, I need call a function which is located in another class. In order to call this function, i need the handle of the main dialog.
My problem is how to get the handle of the main dialog and transfer it into the function call? (Some lines of example code ?)
By the way, what is the handle of a menu item and how to get/use it?
Thanks in advance!
chen
|
|
|
|
|
AfxGetMainWnd() from memory. It will need to be cast to an instance of your dialog.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
One solution to updating a parent windows with data from a dialog box is via messaging. Send the parent windows a message. You could send a pointer to the data. A better solution is just to notice the parent window and have it call a function in the dialog box.
Kuphryn
|
|
|
|
|
Thanks for thr reply!
In fact, my problem is:
I need call the function
void CAspi32Scsi::WriteCD2ImgFile(HWND Handle, CString fileName, int hid, int tid, int lun)
{
.....
}
in the maindlg implementation loop.
so I have
CAspi32Scsi m_scsi; // this is defined in the CMainDlg class.
CMainDlg::OnWriteImgFile()
{
CMainDlg maindlg;
m_scsi.WriteCD2ImgFile(maindlg.m_hWnd, m_fileName, m_cHost, m_cID, m_cLun);
}
where maindlg.m_hWnd is correct or not?
Thanks in advance!
chen
|
|
|
|
|
in OnWriteImgFile() ur creating another CMainDlg and accessing its handle, its like from within ur dialog, ur creating another one and getting its handle, i dont think that's what u want!
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Yes, you possibley right.
But my problem is how to get
the handle or the Cmaindlg or the application?
chen
|
|
|
|
|
CWnd* pCWnd = AfxGetMainWnd( );
pCWnd.m_hWnd is ur handle
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Forgot to cast it
CMainDlg* pCWnd = (CMainDlg*) AfxGetMainWnd( );
pCWnd.m_hWnd is still ur handle!
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
CMainDlg::OnWriteImgFile()
{
m_scsi.WriteCD2ImgFile(GetSafeHwnd(), m_fileName, m_cHost, m_cID, m_cLun);
}
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Hi,
Thanks for you all!
It finally worked. The best choice may be:
AfxGetMainWnd()->GetSafeHwnd();
Thanks again,
chen
|
|
|
|
|
To see if we are on the same track,
You have a dialog class and you wish you use a function from the parent class of the dialog?
One solution would be is to pass the parent within the constructor of the dialog class.
Menus
eg)
CMenu mnu;
HMENU hmnu = pWnd->GetMenu( );
mnu.Attach( hmnu );
// Now you can manipulate the window's menu as a CMenu
// object...
|
|
|
|
|
Is there a way to save information between function calls when using load library? I can always use a file on the drive, or redefine my function params, just curious.
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
a global variable in a DLL will persist until your app releases the DLL.
-c
All you have to do is tell the people they are being attacked, and denounce the opposition for lack of patriotism and exposing the country to danger.
-- Herman Goering
|
|
|
|
|
That would be a prob as I release the dll every time I call the function. It is a plugin. Is that the only way?
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
Darroll wrote:
Is that the only way?
maybe not the only way, but it's the obvious way
for plugins, i always write the data to a file somewhere (or the registry, depending on my mood).
-c
All you have to do is tell the people they are being attacked, and denounce the opposition for lack of patriotism and exposing the country to danger.
-- Herman Goering
|
|
|
|
|
My next thought is how to know when the app starts as to not save data between sessions. I may have to have the app set a running flag in the registry or something. If there is an easier way then this. Any clues?
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|