|
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
|
|
|
|
|
Sorry, yes you will definitely need the platform SDK.
Regards,
Simon
|
|
|
|
|
How can I check the CPU usage (like in the taskmanager)?
Thanks
Yaniv
|
|
|
|
|
Check out the WMI class, Win32_Processor .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I want to convert a number like (i=3546246547) to a string variable( str='3546246547') and vice versa. How can we do this?
Mehdi Hosseinpour
|
|
|
|
|
try the atoi and _itoa or use CString:
CString str;
int i = 3546246547;
str.Format("%d",i);
|
|
|
|
|
CString is MFC specific.
If you're not creating an MFC application and don't want to bloat your code use the following CRT data conversion routines.
strtoul, wcstoul - Converts string to unsigned long integer.
_ultoa, _ultow - Converts unsigned long to string.
For more data conversion functions search MSDN for "Data Conversion Routines"
|
|
|
|
|
there is also another way to convert values into strings with the sprintf() fonction :
<font style="color:blue;">#include</font> <string.h>
<font style="color:blue;">int</font> sprintf(<font style="color:blue;">char</font>* buffer, <font style="color:blue;">const char</font>* format, ...);
<font style="color:green;">
you can use it like printf(), giving it a pointer to where the string will be stored
TOXCCT alias Nicolas C.
|
|
|
|
|
I have some wave files that should be play every time. I want to copy them at a folder like 'INCLUDE\' and also i want open some wave files from another place. When i open this wave file program search link 'INCLUDE\' in new folder not inside project?
How can we have inside files and olso open some other files from other folders?
Mehdi Hosseinpour
|
|
|
|
|
I don't know if I unserstand you correctly...
But if you want to open files that are not in the working directory of your application, you just have to specify complete path ("c:\\My Documents\\Test.wav"). Don't forget to put the character '\' twice because otherwise it is interpreted as a special character.
If you want to access a folder related to your working folder, you can use the "..\\Test.wav" like in dos (this opens a file that is in the root folder of your working directory).
Hope this helps
|
|
|
|
|
cedric moonen wrote:
...you can use the "..\\Test.wav" like in dos (this opens a file that is in the root folder of your working directory).
The ".." denote the parent folder of the current, or working directory. The root folder is simply expressed as "\\".
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hum sorry, my english is not as good as I want !
Yes, of course that's what I wanted to say but I expressed it as root folder of working folder...
|
|
|
|
|
I have created a dialog with 4 sets of radio buttons groups.
for the first 2, its working fine.
but for the rest of the radio buttons group, only one is selecting. When the save and close, its saved. But while displaying, its displaying as only one radio button checked out of all.
Where the problem would be?
|
|
|
|
|
Hai
Your question is not cleared. I think the problem is where the groups u have created. Please confirm that the group check box for the First radio button of every group should be marked.
Regards
Anish
|
|
|
|