|
frontpage has a option to open a web thru file-open web command.
it displays a tree view control. i wanted to read the text of the root node in the control. so i tried the following:
1) HTREEITEM htitem;
htitem=TreeView_GetRoot(hWnd); //hWnd is the handle to the tree control
2) char Buf[80];
TVITEM tvitem;
tvitem.mask=TVIF_TEXT | TVIF_HANDLE;
tvitem.hItem=htitem;
tvitem.pszText=(LPSTR)&Buf;
tvitem.cchTextMax=79;
3) SendMessage(hWnd, TVM_GETITEM, 0, (LPARAM)&tvitem);
but this fails. why?
following works:
1) int cnt=SendMessage(hWnd, TVM_GETCOUNT, 0, 0);
2) SendMessage(hWnd, TVM_SELECTITEM, TVGN_CARET, htitem);
if this works, why tvm_getitem fails?
can anyone help?
thanks
|
|
|
|
|
Just a guess, but I suspect that Buf needs to be on the heap.
char *pBuf = new char[80];
tvitem.pszText = pBuf;
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all
I had been doing dialog based work till now (MFC). Now that I would like to learn SDI and MDI, I will be glad if you can provide me with links to articles regarding the same for beginners. Thanks for your time.
|
|
|
|
|
|
Hi there
Its for extreme beginners, I think. I was expecting like how do I add some more controls in it, how do I make it work, etc. The article just shows how to make one SDI app. I will be thankful if you can provide me with the required. Thanks for your time. Please note that I have a fair knowledge of working with dialog based apps.
|
|
|
|
|
oh Well I think you need to a basic article you said I need to learn SDI/MDI.Did you search on codeproject
|
|
|
|
|
Yes, I searched but there are just too many of them either with loads of information which is a little overdose for me or an article like "how to create a SDI app using the wizard". I look for something in between though
|
|
|
|
|
I want to answer to you but I think you get your answer with CFormView(David Crow) now you can insert your controls on forum.
|
|
|
|
|
Aljechin wrote: I was expecting like how do I add some more controls in it...
One way is to derive the view from CFormView .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Might I suggest a very good book (softcover) called 'Beginning MFC Programming', by Ivor Horton. This book has an excellent tutorial in it and explains things very well.
John P.
|
|
|
|
|
Hi,
I want to move a file in my system to a remote system.
For example I have a file "abc.wav" in my system . Now I want to move this file to another remote system's subdirectory(say "c://xyz").
IP of the remote system say "1.2.0.4".
Can anyone help me.
Thanks in advance.
|
|
|
|
|
use sockets for that purpose with file reading,u will find the code on code project as well just search "Network Transfer of File".
thing u had to do is read a file from computer and send to another using sockets where other side will receive and then write on file in this way the transfer will take place.
Tasleem Arif
|
|
|
|
|
you could also attach to a share on the other machine eg \\1.2.0.4\c$\xyz either programmatically or through a script to map a drive, then copy the file there using copyfile()
bit lower tech than using the socket suggestion ...
'g'
|
|
|
|
|
What about MoveFile() or SHFileOperation() ? If neither of them accepts a UNC path, you can make use NetUseAdd() to map a drive letter to the remote share.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Dear All,
How do i convert TCHAR[75] to CLSID ?
Kindly ... Help in this .
|
|
|
|
|
|
How to export MS outlook mail to a text file?
Who have source?Please email me.
My e-mail:phyton_y@163.com
thanks a lot!
|
|
|
|
|
Can you use Outlook Automation?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Do you have some source about Outlook Automation?
I know this ,but I do't know how to use it!
thanks!
|
|
|
|
|
There are tons of example available, like:
_Application app;
_NameSpace ns;
_MailItem mi;
COleVariant vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
vtTrue((short) TRUE);
long olFolderInbox((long) 6),
MAPIFolder folderInbox;
_Items itemsMessages;
if (app.CreateDispatch("Outlook.Application") == TRUE)
{
ns = app.GetNamespace("MAPI");
ns.Logon(vtOptional, vtOptional, vtTrue, vtTrue);
folderInbox = ns.GetDefaultFolder(olFolderInbox);
itemsMessages = folderInbox.GetItems();
for (int x = 0; x < itemsMessages.GetCount(); x++)
{
mi = itemsMessages.Item(COleVariant((long) x + 1L));
TRACE("Message %d, subject = %s\n", x, mi.GetSubject());
}
ns.Logoff();
}
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
Why should we register a window class? What is its actual advantage?
Thank you.
- NS -
|
|
|
|
|
The windows class has a lot of functionality. The most important is to tell Windows which WndProc to call when a message is send to the window. It also tells which brush to use to paint the background, which icon to show and which cursor should be displayed when the mouse is over the window. It also tells Windows which menu to associate with the window. Pretty important stuff.
Cheers
Steen.
"Are you gonna check your makeup when you're done whining?" John Simmons, 05/31/2006
|
|
|
|
|
These all are assosiated with window class. This is OK. But I would like to know the reason for such a registration.
I dont feel this is just for getting such settings. Because in many cases registered window class is used for a single program only. Some times, only for one window.
- NS -
|
|
|
|
|
Well, even if there only exist one window of any given class in the entire universe, Windows still needs to know these things. And since there may exists hundreds of windows of the same class (a static text control is a good example) you may as well put these common things into a windows class instead of defining them for each instance of the class. It's analogous to defining the member functions of a C++ class each time you declare an instance - that would not be efficient either.
The bottom line is that your Windows program won't work if you don't register your window classes. Live with it.
Cheers
Steen.
"Are you gonna check your makeup when you're done whining?" John Simmons, 05/31/2006
|
|
|
|
|