|
Hi all,
i m already using a Imagelist in Treectrl.
i want to use a back image for treectrl.
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
|
|
|
|
|
|
"_$h@nky_" wrote: please tell me how can i do this.
I don't think there is a function to set back ground image for a tree control. How ever you can draw an image by deriving a class from CTreeCtrl and the draw the image by overriding the WM_ERASEBKGND message.
|
|
|
|
|
After decades of fun we now have to stop using MFC in the project.
How do I get this to work? I want a simple solution, because I have this about 1000 times in the code. I tried those answers which seemed obvious to me, but it does not compile.
const char CODE_N = 'N';
string SK::getCode() const // was CString
{
return CODE_N;
}
1>..\path\SK.cpp(1423) : error C2440: 'initializing' : cannot convert from 'const char' to 'std::basic_string<_Elem,_Traits,_Ax>'
-------------
Bibo ergo sum
|
|
|
|
|
|
Thankyou for your quick reply.
I realise I had hit on one of the few const char definitions which only has one character. Those with more than one worked fine the way it was.
-------------
Bibo ergo sum
|
|
|
|
|
I used the CWnd::GetClientRect function but it returns a rect with top=0,bottom=0,left=0,right=0,the dialog is not minimized why it happens
|
|
|
|
|
Are you sure you'd able to see the Window? From Which function you're calling this ? Have you declared any variables having same name in different scope and referring false one? Can you post the snippet?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Did you use of GetLastError for get info about error?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi All,
I want to make a application which can run on all three platform (MAC/Linux/Windows). i think it is possible if i code in core c/C++ only but problem is that how can i make a window using c/C++.
any suggestion would be greatfiull to me.
thanks
Bankey
|
|
|
|
|
bankey1010 wrote: i think it is possible if i code in core c/C++ only but problem is that how can i make a window using c/C++.
Depends what you mean by "it is possible" . You can't make the same executable run on different platform, because the format is different for each of the platform. However, if you stick to pure standard C++, then the only thing you will have to do is recompile your code for each of the platform using a different compiler.
But of course, you'll probably need more than just standard C++ and there are some cross-platform GUI libraries that exist which allow you to write cross-platform code. Look for instance at wxWidgets[^].
|
|
|
|
|
bankey1010 wrote: i think it is possible if i code in core c/C++ only but problem is that how can i make a window using c/C++
C/C++ is general purpose language. Even if you decide to do that with Pure C/C++, you will have to get support from Operating system.
What about trying QT?[^]
Cross-platform Development[^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
|
simple is use Java
|
|
|
|
|
Hi,
My application is crashing with this Api for only one domain user and only on all Dell Optiplex 755 with Vista SP1 installed.Can I know what could be the reason.
Thanks.
|
|
|
|
|
Was it working fine before installing service pack? I think it should work fine from Windows 95-Windows Server 2008.
Can you post the snippet?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Go to that users machine and open regedit.exe and navigate to the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping
1.) Check that it exists
2.) Right click it and check that the user currently logged in has access permissions. Note that this is technically a small security risk as subkeys such as Win.ini can be used to load malware at startup.
I would recommend not using this GetPrivateProfileInt function[^]. It was created for compatibility with old Windows 3.1 software.
At any rate, I would suggest creating your own registry key and subkeys. Microsoft will not support this registry key forever, its time for you to move along.
Best Wishes,
-David Delaune
|
|
|
|
|
How do i get the icon/bitmap from CMenu and then draw it on
void CMyMenu::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
}
Currently i able to get the check mark with ODS_CHECKED
But i don't know how do i get the icon/bitmap from the original CMenu
Any help would be appriciated
Regards,
KH
good
modified on Friday, December 19, 2008 2:10 AM
|
|
|
|
|
You can call CMenu::GetMenuItemInfo[^] Please follow the link, it describes how to use the API
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Dear Friends,
Please could you give an idea about below question.
need difference between using static variable in 'C' and 'C++'.
Thanks,
Sakthi
Nice things do nice works
|
|
|
|
|
|
i m creating 3 queutimers and after adding them in queue using 3 callbacks functions for each timer ,and calling one function after 10ms 2nd func after 100 ms,3rd func after 1sec but its not working properly they functions are not executing at specefied intervals,to call them after a bit interval i hv to use sleep method . so plz tell me how to fix it the code is below
HMODULE hlib = LoadLibrary ("kernel32.dll");
CTQ CreateTimerQueue = (CTQ)GetProcAddress (hlib, "CreateTimerQueue");
CTQT CreateTimerQueueTimer = (CTQT)GetProcAddress (hlib, "CreateTimerQueueTimer");
HANDLE htimer=CreateTimerQueue();
HANDLE t,t2,t3,t4;
int arg = 10;
if(!CreateTimerQueueTimer( &t, htimer,TimerRoutine, &arg , 10, 1,4))
{
SetDlgItemText(IDC_S,"not set");
}
else
{
SetDlgItemText(IDC_S,"set");
}
CreateTimerQueueTimer( &t2, htimer,TimerRoutine2, NULL, 100, 1, 2);
CreateTimerQueueTimer( &t3, htimer,TimerRoutine3,NULL , 1000, 1, 2);
}
VOID CALLBACK TimerRoutine(PVOID lpParam, BOOLEAN TimerOrWaitFired)
{
one++;
char a[20];
itoa(one,a,10);
st1->SetWindowText(a);
}
VOID CALLBACK TimerRoutine2(PVOID lpParam, BOOLEAN TimerOrWaitFired)
{
two++;
char a[20];
itoa(two,a,10);
st2->SetWindowText(a);
}
VOID CALLBACK TimerRoutine3(PVOID lpParam, BOOLEAN TimerOrWaitFired)
{
three++;
char a[20];
itoa(three,a,10);
st3->SetWindowText(a);
}
|
|
|
|
|
shaina2231 wrote: i m creating 3 queutimers and after adding them in queue using 3 callbacks functions for each timer ,and calling one function after 10ms 2nd func after 100 ms,3rd func after 1sec
No you're not, you've set the parameters incorrectly. The 10, 100 and 1000 arguments are specified in the DueTime position. You've specified 1ms for the period. Also, the last parameter of CreateTimerQueueTimer is a flag argument. Looking at this page[^], the valid values for that parameter do not include 4...which is what you've used for one of the timers.
Your CreateTimerQueueTimer calls should look more like this:
CreateTimerQueueTimer( &t, htimer,TimerRoutine, &arg , 1000, 10, WT_EXECUTEINIOTHREAD);
CreateTimerQueueTimer( &t2, htimer,TimerRoutine2, NULL, 1000, 100, WT_EXECUTEINIOTHREAD);
CreateTimerQueueTimer( &t3, htimer,TimerRoutine3,NULL , 1000, 1000, WT_EXECUTEINIOTHREAD);
WT_EXECUTEINIOTHREAD is defined in winnt.h as 0x00000001 . If you're using VC6, do yourself a favour and install a modern Platform SDK. Then you won't need to do stuff like call LoadLibrary and GetProcAddress to get the CreateTimerQueue function's address - you can use the kernel32 import library - and you can use symbolic constants like WT_EXECUTEINIOTHREAD rather than numbers that you can get wrong (and you did get one wrong).
Also - the timer callbacks are likely to be called on different threads than the UI thread. That means that you possibly shouldn't be calling SetWindowText, as (I think) it sends a Windows message rather than posting it.
|
|
|
|
|
I have ported a old MFC appliction to VC8 and have everything but the context sensitive help working. What help system - HTML Help 1, MS Help 2, Windows Vista AP help, or ... is most appropriate to use in Visual Studio 2005?
Can you suggest any tutorials to lead me through the process also.
Thanks
Clayton
|
|
|
|
|
What systems are you hoping to deploy on? If it includes XP, then Vista Help isn't much good, I would have thought.
Also, MS Help 2 is primarily designed for Visual Studio[^], so isn't going to be that widely installed.
So - I'd go for CHMs myself.
|
|
|
|
|