|
In Java, brackets can go either with variable or type. Crazy...
|
|
|
|
|
Yes its really bothering me.... I have a CTreeCtrl on a modeless dialog, When a selection is made on the list control that is on the dialog box I want another class, generic, to parse out the contents to the related file... how can I do this? I understand that I can't pass a CTreeCtrl as a return value from the generic class (CParseDocument) and I can't get the generic class to get control of the Dialog class and make it update the control.
Also I'm using another class for this to organize it and it gets really messy if I keep the parsing in the Dialog class.
Heres what I've been trying to get to work (it keeps returning NULL):
TV_INSERTSTRUCT tv_is;
tv_is.hParent = TVI_ROOT;
tv_is.hInsertAfter = TVI_LAST ;
tv_is.item.mask = TVIF_TEXT;
tv_is.item.pszText = ConvertCStringToChar(m_strSectionName);
hSectionRoot = m_cSlidOpen.m_ctrlXMLTree.InsertItem(&tv_is);
if (hSectionRoot==NULL)
{
AfxMessageBox("failed");
return;
}
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
|
<Hello,
How can i handle interrupts in win2k environment?
Thanks in advance...
|
|
|
|
|
I'm pretty sure that you need to run in ring 0 which means you write a device driver or similar kernel-mode code.
Brad
|
|
|
|
|
|
Hello,
I would like to create an empty folder on the disk, which command should I used in Visual C++? Thank you for your help!
Nachi
|
|
|
|
|
I'd start with CreateDirectory() .
|
|
|
|
|
Hi,
I have a custom listbox set up with several columns (file name, file type, size and path), and I want it so that whenever a user clicks on a column header, the items are sorted, just as in Windows Explorer, for instance.
The column click part is easy, as I just have this code underneath case WM_NOTIFY:
<br />
case IDC_LIST1:<br />
if(((LPNMHDR)lParam)->code == LVN_COLUMNCLICK)<br />
{<br />
if(((LPNMLISTVIEW)lParam)->iSubItem == 0)<br />
{<br />
}<br />
}<br />
However, I have no idea about how to use LVM_SORTITEMS. Obviously, I need to send it using SendDlgItemMessage and use a callback function as it says over on MSDN, but I don't know how to set up the callback function.
The problem is that all of the examples I have found are MFC based, but I am _not_ using MFC, just the straight Windows API.
Does anybody know where I can find a decent "sort listview items" code example that does not use MFC, or could anybody give me some pointers on how to go about it myself?
Many thanks for any help,
KB
|
|
|
|
|
Kayembi wrote:
...but I don't know how to set up the callback function.
It has the following signature:
int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
The MSDN article Q170884 should give you some ideas, even though it's in VB.
Basically, each item that is added to the list control has an associated item data (use the LVM_SETITEM message for this). When CompareFunc() is called, lParam1 points to one item's data and lParam2 points to another item's data. You have to cast lParam1 and lParam2 to the appropriate type, and then do some sort of comparision.
|
|
|
|
|
Hello
Does anyone know how to print HTML files from a console application? I wanna print the files like the I Explorer shows them not the source code . I think a solution could be using IWebBwoser control but i don't know how to embed it to a console application
Thanks a lot
xxx
|
|
|
|
|
You could write a simple web resource provider[^] to download the page to disk, then just print the file by doing:
CString strPrintFile = "MyFile.htm";
SHELLEXECUTEINFO seInfo;
::ZeroMemory (&seInfo, sizeof (seInfo));
seInfo.cbSize = sizeof (seInfo);
seInfo.fMask = SEE_MASK_FLAG_DDEWAIT;
seInfo.hwnd = GetSafeHwnd();
seInfo.lpVerb = "print";
seInfo.lpFile = strPrintFile.GetBuffer(0);
seInfo.lpDirectory = "";
seInfo.nShow = SW_SHOWNORMAL;
BOOL bStatus = ::ShellExecuteEx (&seInfo);
strPrintFile.ReleaseBuffer();
if (!bStatus) {
CString strMessage;
strMessage.Format (IDS_CantPrintFile, strPrintFile.GetBuffer(0));
strPrintFile.ReleaseBuffer();
AfxMessageBox (strMessage);
}
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I create a new document in my doc/view app, and when I close it asks if I want to save it. How do I keep it from asking me this?
I have tried SetModifiedFlag(FALSE) and that isn't working. Any other ideas?
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
Jason Henderson wrote:
I have tried SetModifiedFlag(FALSE) and that isn't working.
Yes, but where are you doing this, and what code, even MFC, is setting it back to TRUE ? If you do anything at all to your document, its dirty flag will be set to TRUE . Set a breakpoint in SetModifiedFlag() . Once there, check the call stack.
|
|
|
|
|
I figured it out.
I'm overriding SaveModified now and it seems to be OK.
thanks
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
Overriding BOOL CDocument::CanCloseFrame(CFrameWnd *pFrame) could also do the trick.
HTH,
K.
Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Dwight D. Eisenhower
|
|
|
|
|
Is this possible to write a service program running under NT/2000/XP, which has a global keyboard hook, and capture the user login name and pasword? has anybody tried it? I just don't want spend couple of days and then find out no way to do it.
Thanks
|
|
|
|
|
You'll need to ask GINA for help on this one! It's precarious, so proceed with caution.
|
|
|
|
|
Instead of reporting you to police, I decided to give you some help, check this article[^] out. Don't say that I provided you the information.
|
|
|
|
|
Hi,
I am using an activex in my application and when I ran it on another machine it crashed because the OCX file was missing.
I add the OCX file but it still does not work....
Is there some kind of "registration I have to do"
I am using the MSFlexGrid and I copied the MSFLXGRD.OCX file (Machines that has this file are OK)
Is it possible I need more than one file ?
Shay
|
|
|
|
|
All COM servers (ActiveX) need to be registered. You can use the regsvr32.exe utility to register .OCX files.
Brad
|
|
|
|
|
Coool !
Exactly what I needed
thanks
|
|
|
|
|
I have an object that has a std::map member variable. I placed this object in a static library. Whenever I call the find method of the std::map I get an access violation (due to a variable pointer to uninitialized memory in the comparator).
I looked around on the internet and found out that this actually is a bug in the xtree header file (see here[^]). Does anyone know if there is a microsoft fix for this bug? I searched the microsoft knowledgebase, but could not find any information on it.
|
|
|
|
|
What is the DLL property? Does the compiler links it using single thread or multithreading?
Kuphryn
|
|
|
|
|
It actually is a lib, but I'm using this object in a exe and multiple dll's. All are compiled with the multithread option.
This isn't a sychronisation issue by the way, because I do protected access to my collections with critcial sections.
|
|
|
|