|
No problem
Blue screened due to lack of disk space?! Good old M$
|
|
|
|
|
Hey, I create a modeless Dialog in my SDI view-class. Now I tried to send a message from the modeless dialog to the (parent) view class.
GetParent()->SendMessage...
No success.
The adress returned from GetParent() is not the adress from my CView. It returned the adress from CMainFrm. Why?
How can I get the adress from my CView from within the modeless dialog?
|
|
|
|
|
i don't have mind to have read that we could access a parent handle like this.
what you can simply do is to give the handle when you create the son dialog (by the constructor for example)...
anyway, if such function exist, prefer the member function to the global one.
TOXCCT alias Nicolas C.
|
|
|
|
|
Didn't you forget to pass a pParentWnd parameter to dialog constructor or Create function? If you omit it, the parent of dialog is set to main frame window.
Robert-Antonio
|
|
|
|
|
How to change the Backgroung of Menubar,statusBar,toolbar in VC++
Can sizes of buttons on the toolbar be customized?
|
|
|
|
|
hi man, dit you have a look on that page :
http://www.codeproject.com/menu/
i'm sure you will find whatever you're looking for, and probably more !
TOXCCT alias Nicolas C.
|
|
|
|
|
Can anyone help me to start off a crc checksum program that will check entire cd's or dvd
|
|
|
|
|
There's a dandy CRC-32 article here[^].
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
I use a dialog box to open wave file. The full path of file will be copy to a char* variable 'pInputFileName' by CFile::GetFilePath and a variable 'pInside = "..\in.wave" but when i use CFile f; fin.Open(....) and finput.Open(...) a problem will create one file will open not two file. The full path name of file that will be opened by CFile has "\" Not "\\".
If you write this will see my problem.
Thank you.
Mehdi Hosseinpour
|
|
|
|
|
Can you provide a relevant code snippet (i.e., just the code necessary to recreate the problem)?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
it's hard to understand everything...
anyway, we're here on an "international" site, that's powerful to progress, isn't it?
i'd like to know why you don't try to open your file basically by streams, with <font style="color:blue;">#include</font> <iostream> ?
There are so many operations you can do like this, it would probably be more simple for you....
TOXCCT alias Nicolas C.
|
|
|
|
|
Has somebody an idea how to make a "virual hard disk"?
The disk needn't be readable. I yast want to be notified when a new file is created (or moved) in it.
At the moment I mounted a directory to a hard disk ("subst y: C:\temp")
and catch the notifiction on this folder via FindFirstChangeNotification, FindNextChangeNotification, ...
Maybe someone know how to do this with a device driver?
Tanx
Möhre
|
|
|
|
|
If you want a 'real' disk, then yes, you are into device driver land. You could just the DefineDosDevice function to define a disk from a folder (thats how subst.exe does it), and then use QueryDosDevice to find out what the folder that drive maps to is .
So say if you had drive y: substed to C:\temp, at the moment you are telling findfirstchangenotifaction to watch C:\temp, you could use QueryDosDevice to programmatically find out which folder y: maps to, so you would have somthing like:
FindFirstChangeNotification(MapDriveToFolder("Y:"), ....)
where MapDriveToFolder is a helper function that calls QueryDosDevice and returns the folder the drive maps to.
|
|
|
|
|
Thaks, seems to work!
By the way: is it possible to subst an allocated memory to a DOS-Disk, so i don't need the folder?
|
|
|
|
|
No problem
In regard to the second bit - not easially no. DefineDosDevice basically creates a symbolic link to a real device (which may just be a folder on the haddrive in the case of subst). The symbolic link is then seen as a new drive.
I don't belive you can link to a chunk of memory without a custom driver which implmements a device that just reads and writes to that memory - and if your doing one of them you may as well just do a disk driver anyway and forget symbolic links.
|
|
|
|
|
I created one window, and that second as a Pop-up.
But I need next to make second lloking as a modal Window
for first, but -just by position.
First must on top of second,
but not applying style TOP_MOST .
For making only possible to go to second window after hiding
first.
How to do it?
Thanks.
|
|
|
|
|
|
hello:
i am using following code
in message map
ON_NOTIFY(EN_SELCHANGE, IDC_RICHEDIT22, MyMethod)
i want to capure the event as soon as the user selects the text or changes the selection in the CRichEditCtrl, but the message handler MyMethod is not called at all..
any suggestions for eliminating the possible cause...
Regards
Muhammad Ahmed
ahmed
|
|
|
|
|
Put the following in the dialog's OnInitDialog() method:
m_edit.SetEventMask(m_edit.GetEventMask() | ENM_CHANGE);
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
thanks alot for solving the problem
i had to change yr code a little like this
m_Editor.SetEventMask(m_Editor.GetEventMask()|ENM_SELCHANGE);
ahmed
|
|
|
|
|
Hi!
I am trying to integrate the DHTML editing control to a win32 dialog.
For that I manually copy-pasted the code (CONTROL IDC_DHTML ....) from a mfc application resource to my win32 api application resource and I import the dhtmled.ocx. The program doesnt open when I click on it ( it also doesnt give an error message).
Am I doing something wrong?
Well... I am a beginner ...
|
|
|
|
|
MFC does a lot of work behind the scenes to pretend that you can place an ActiveX control in your resources and have it 'just work'. See the code in DLGCORE.CPP in the MFC source, particularly CDialog::CreateDlgIndirect , for more details.
The Win32 dialog box API knows nothing of ActiveX controls and bombs out because it cannot find a suitable window class for the ActiveX control.
If you want to host ActiveX controls in a raw Win32 application, you need to implement a control site (from memory, you need to at least implement the IOleContainer and IOleControlSite interfaces) and then create the controls yourself.
For anyone who cares, MFC preprocesses the dialog template before passing it to Windows, stripping out (but remembering) any ActiveX control data and any list box initialisations (Win32 doesn't do this either). When Windows sends WM_INITDIALOG to the window, MFC actually calls CDialog::HandleInitDialog , which creates any ActiveX controls, initialises them, and performs any other control initialisations, before calling your override of OnInitDialog . In this way, it presents the illusion that ActiveX controls are controls like any other.
|
|
|
|
|
Hai Friends,
How can i get the IP addrees of the current system.
Plase anyone give me a step by step procedure
|
|
|
|
|
Hello,
I've done this before using windows sockets.
I don't know if it's the best way, but it definitely works:
char szHostName[400];
struct hostent *hostinfo = NULL;
IN_ADDR addr;
char szIP[16]; // "xxx.xxx.xxx.xxx\0"
ULONG ulIP = 0;
// get the dns name as a string
gethostname(szHostName, 400);
// get the host info (contains ip address)
hostinfo = gethostbyname(szHostName);
if(hostinfo == NULL)
{
DWORD dwError = WSAGetLastError();
// handle the error
}
else
{
// get the ip as ULONG
ulIP = *reinterpret_cast<pulong>(hostinfo->h_addr_list[0]);
// put the ip it into an IN_ADDR
addr.S_un.S_addr = ulIP;
// changes ip into string
sprintf(szIP, "%s", inet_ntoa(addr));
TRACE("My IP address is %s\n", szIP);
}
Regards,
Simon
|
|
|
|
|
Hai,
Thanks for your message. But when i copy the given code lot of errors occured. IN_ADDR undeclared identifier etc.
I have not insatlled Platform SDK. For running the code may i need the Paltform SDK?
regards
Anish
|
|
|
|