|
|
Hi peterchen,
I am not using any Imagelist in my program.I am using the checkboxes provided by the CTreeCtrl only. I just want to check some items in a tree during initialization. I wrote the following code but it is getting checked ones.
=============
#define CHECK 1
#define MAXFT 10
HTREEITEM root;
root = m_extensiontree.InsertItem("Extension", 3,3, TVI_ROOT);
CString str[MAXFT] = {"doc","txt","htm","html","bmp","pdf", "rtf", "xls", "tmp", "lnk"};
for(int i=0;i
|
|
|
|
|
a) Checkbox Indices are 1-based so 1 is unchecked, 2 is checked
b try to set the checkmark *after* OnInitDialog. IIRC there was a comctl32 version that did not handle state changes in WM_INITDIALOG correctly (or maybe this was with the list control)
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Dear Peterchen,
First of all I am sorry for disturbing you again.
I changed the indeces of CHECK to 2 but still it is not working. Is there some problem with the Comctl32.dll ?? I am working on XP machine and using VC 6.May I download the latest dll for this ??
Or is there some fault in the code ? I am using this code in a function ie. mytree() and calling it after
CDialog::OnInitDialog()
Or can you/anybody please send some sample code for this ?
Thanks a lot.
Rohit
|
|
|
|
|
Hi,
I've 2 EXEs.
Say A & B.
A always runs in Administrator mode (spooler is one example) - even if we log onto the system as any user and run it.
I've to (in some cases) run B from A. Since A (which is in admin mode) is creating process B - process B is also now in Admin mode.
Can I in process B - make it run in the currently active logged on user in a particualr system.
This has nothing to do with network - its just the multiple user accounts in one system.
Can you please help me out.
Thanx
Srinivas
|
|
|
|
|
You can get the current user context from Process B
Then use ImpersonnateLoggedOnUser (See MSDN) in process B to work under that user context.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
In a LAN, there are Plotters/Printers connected to few servers
We need to log
a.File Name being Plotted/Printed
b.From which machine the Command was issued to the server,what time
c.The user logged on to the machine from where the print command was issued...
How do we log the above information using VC++(either MFC or ATL or Windows API)
The application needs to be deployed on Windows NT as well as 9x systems
on NT system, it can be deployed as a NT service, but what bout 9x systems, even the user logged on the server should not be able to shut down the application...
Can anyone provide some information...
|
|
|
|
|
i am trying to make the application frame
just looks like photoshop in windows 2000.
Right now i am having problem to make 4
modeless dialog boxes active (title bars
are all blue) as well as mdi document view
simultaneously. does anyone have solution
to this.
Thanks in advance.
Shinya
|
|
|
|
|
|
I use PostMessage method to update a dialog box through a thread outside of my dialog box class like this:
<br />
CMyThread::update()<br />
{<br />
m_pDlg->PostMessage(UM_UPDATEDIALOG);<br />
}<br />
this code works properly in debug version but in release there is an exception in PostMessage function.
How can I solve this problem.
|
|
|
|
|
I think using PostThreadMessage would be better. Also check how the message queue is handled in your target thread.
~RaGE();
|
|
|
|
|
What is the cause of the exception. I would assume m_pDlg isn't valid at the time it is used.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
CWnd* objects are not thread safe, give the thread a copy of the HWND and send a message to that.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
What does UM_UPDATEDIALOG equate to? How does the dialog class respond to the posted message? Maybe the pointer is invalid.
|
|
|
|
|
hi all:
can i add a string table entry in source file.
If yes how to do?
gucy
|
|
|
|
|
IN ResourceView you can find the string table ,double click the blank and enter your string
|
|
|
|
|
I think, some years have 52 weeks while some have 53. Is there a way of using CTime/SPan classes to compute this
|
|
|
|
|
How about do it like that :
COleDateTime ct = COleDateTime( 2003, 12, 31, 23, 59, 59 );
int iNumWeeks = atoi( ct.Format( "%U" ) );
|
|
|
|
|
Hi !
please use the <pre> HTML tags (see Formatting bar under your sig when writing a message) to format your code instead of bold. It is far more readable.
~RaGE();
|
|
|
|
|
I am building a project.I want to write something to registry to save some informatiom.
|
|
|
|
|
Who can give me a sample or a demo?
|
|
|
|
|
Use RegOpenKey, RegQueryValue, RegCloseKey.
You can look for sample code in MSDN, or you can search Google for a whole lot of sample code
You might also find some code on CP
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
Here are some code snippets, which you may use :
//////////////////////////////////////////////////////
CString GetFromRegistry( CString csRegKeyString, CString csRegKeyField, CString csDefault )
{
CString csResult = csDefault;
CRegKey* pRK = new CRegKey();
LONG lRegOpen = pRK->Open(HKEY_LOCAL_MACHINE, csRegKeyString);
if(lRegOpen == ERROR_SUCCESS)
{
char cValue[1000];
memset( cValue, 0, sizeof( cValue ) );
DWORD dwSize = sizeof( cValue );
LONG lRegQuery = pRK->QueryValue( &(cValue[0]), csRegKeyField, &dwSize );
if(lRegQuery == ERROR_SUCCESS) csResult = cValue;
}
delete pRK;
pRK = NULL;
return( csResult );
}
//////////////////////////////////////////////////////
BOOL SetInRegistry( CString csRegKeyString, CString csRegKeyField, CString csValue )
{
BOOL bResult = FALSE;
CRegKey* pRK = new CRegKey();
LONG lRegSetValue = pRK->SetValue( HKEY_LOCAL_MACHINE, csRegKeyString, csValue, csRegKeyField );
if(lRegSetValue == ERROR_SUCCESS) bResult = TRUE;
delete pRK;
pRK = NULL;
return( bResult );
}
I think there are a lot of complete classes here at codeguru. Use the code above only as an example how you may do it.
Best regards
|
|
|
|
|
|
csc wrote:
I think there are a lot of complete classes here at codeguru.
Codeguru? Don't you mean CodeProject?
|
|
|
|