|
|
You can use _pgmptr .
Regards,
Krishnakumar
|
|
|
|
|
I have created a tree control and added few items in it.
And i have used TVN_SELCHANGED notify message as below.
But i am not able to get item names using LPNMTREEVIEW structure instead its showing junk chars.
void CMyDlg1::OnTvnSelchangingTreectrl(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<lpnmtreeview>(pNMHDR);
CString str = pNMTreeView->itemNew.pszText;
CString str1 = m_TreeCtrl.GetItemText(m_TreeCtrl.GetSelectedItem());
.....
}</lpnmtreeview>
|
|
|
|
|
According to MSDN, that is to be expected.
"The itemOld and itemNew members of the NMTREEVIEW structure are TVITEM structures that contain information about the previously selected item and the newly selected item. Only the mask, hItem, state, and lParam members of these structures are valid. The stateMask members of the TVITEM structures specified by itemOld and itemNew are undefined on input."
TVN_SELCHANGED Notification[^]
|
|
|
|
|
using
int DialogWidth = GetSystemMetrics(SM_CXSCREEN);
int DialogHeight = GetSystemMetrics(SM_CYSCREEN);
system Resolution is get but how to set System Resolution(by giving width and height) using code is there some methods?
|
|
|
|
|
To set screen resolution, you've to use ChangeDisplaySettings(). For that this[^] will help you. May need to have a look at this[^] too. And I think you can dig out better how to use them.
|
|
|
|
|
Please try with
SystemParametersInfo() with SPI_SETWORKAREA
Regards
Radhakrishnan G.
|
|
|
|
|
Hi All !
I'm running an application that spwans several processes and threads, it runs on Windows 2003 Server OS and using 8 cpu's machine(Xeon).
We are considering the use of SetProcessAffinityMask to allocate heavy processing jobs to a spcific cpu. My question therfore is this:
Using SetProcessAffinityMask, is it possible to tell the OS that I want my process to be the only one using that cpu (i.e. no other process, mine or the OS's, is allowed to run on it) ? is it possible ?
We wish to get deteministic results when system is working for long periods of time.
thanks,
Amit
|
|
|
|
|
AmitCohen222 wrote: no other process, mine or the OS's, is allowed to run on it) ? is it possible ?
I don't believe so.
You may want to use SetThreadAffinityMask to distribute threads among processors,
but there's no guarantee the system will actually use your suggestions.
Try it and test it thoroughly to see if you're actually getting any benefit -
from my experience, on XP and above, the OS thread scheduler does a pretty good
job without intervention.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
HI,
I want to pass argument for my application.My application is dialog based.so Please help me i have no idea how to do it.
Thanks
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
|
If you wish to pass command line arguments in IDE go to "Project | Properties | Debugging | Command Arguments". Here you can specify your command line arguments.
Hope this will help you.
Thanks,
Paresh.
|
|
|
|
|
But how to check the passed arguments value at the initilization of application.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
In CWinApp::InitInstance .
Please have a look at CWinApp::m_lpCmdLine .
Hope this will serve your purpose.
Regards,
Paresh.
|
|
|
|
|
It's very helpful for me.
Very -2 Thanks
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
|
i have 1 dialog application.my dialog
application is sending some messages to other appication.i want to save these
messages into xml file and so that later it can be executed.means i neeed to implement
to create,read n write to xml file.
thanks in advance
|
|
|
|
|
|
|
Download the Microsoft XML Parser SDK and dig through the documentation. You'll probably find that using smart pointers and the DOM approach to be adequate for most scenarios.
|
|
|
|
|
Hi all,
i m draw a rectangle with this.
CRect rectrect;
CDC* pDC;
pDC->Rectangle(rectrect.left,rectrect.top,rectrect.right,rectrect.bottom);
here the sides of rectangle appears very light ,i want to make it dark.
please tell me how can i do this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
The Rectangle function draw the border with the currently selected pen. So to get a dark border, before calling Rectangle, select a pen with dark color as show below
CPen DarkPen( PS_SOLID,1, RGB(0,0,0));
pDC->SelectObject( &DarkPen );
pDC->Rectangle(rectrect.left,rectrect.top,rectrect.right,rectrect.bottom);
|
|
|
|
|
Thanks its done.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hello All,
I am doing an SDI application in MFC(.Net 2008 platform). In my project, when i click on any button, i have to create a child window in the mainframe window. This child window having no caption, title bar, system menu. i want only border for that window. This child window will always be displayed on the Mainframe window, even i click anywhere on the mainframe window.
I have created window using CreateEx() function and Set its position using SetWindowsPos() function. as follwing;
Problem is that, when i minimize the Mainframe window, child window always be there on the screen. i want to change this child window size along with Mainframe window. How can i do this. Please give me any hint with the help of code.
Which flag i have to set while creating the window or in the SetWindowPos() function.?
Thanks in advance.
|
|
|
|
|
I am writing an application using C++ and MFC. Is there a way for my application to know how many cores/CPUs are on the machine? The reason I am asking is that it is multi-threaded and I would like to have one worker thread for every core/CPU on the machine. Any ideas?
Thanks
Bob
|
|
|
|