|
still doesn't work... any other ideas?
ØIvIND
|
|
|
|
|
Is it possible to make my popup CDilalog into another Cdialog (making it as a child) I’ve figured of the CWnd::ModifyStyle func but it return false when I for e.g. run:
m_dialog.ModifyStyle(ModifyStyle( 0 ,WS_CHILD );
Any suggestions how I could tackle the problem.
I’ve searched for articles round the net but no success…
Thanks
_____________________________
...and justice for all
APe
|
|
|
|
|
d00_ape wrote:
m_dialog.ModifyStyle(ModifyStyle( 0 ,WS_CHILD );
Of course:
m_dialog.ModifyStyle( 0 ,WS_CHILD );
_____________________________
...and justice for all
APe
|
|
|
|
|
helloo all fellow programmer
i want to know loginc behind or any api behind copying one directory from one drives to other.
thanks in advance
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Have you looked at SHFileOperation() ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
HI!
When I'm debugging and stepping through my code, in certain places I get the message "There is no source code available for the current location.", even though it is my own code, and the files are in my project... Anyone know how to fix this?
|
|
|
|
|
Hi how i can detect modem (name of one)which installed in my system,programatically?????
Thank.
|
|
|
|
|
http://www.codeguru.com/Cpp/I-N/network/dial-upnetworking/article.php/c2465/
|
|
|
|
|
Hi!
I've have overridden CWnd::OnNcLButtonUp() to detect when I click on the title bar of my window. What I need now is to detect if I have released the window. This is so I click on my title bar and drag window to another position. How do I know when the drag has finished?
I have tried CWnd::OnNcLButtonUp() but it doesn't help.
|
|
|
|
|
|
Doesn't this just state the obvious. If you are writing native code then C++ will be faster!?! Given the speed of modern machines the majority of applications speed is not noticably different, from a user point of view, no matter what language they are written in.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Antony M Kancidrowski wrote:
Doesn't this just state the obvious. If you are writing native code then C++ will be faster!?!
The impression I get from his statement is that for .NET tasks C++ is preferred too. A lot (most?) of the native code in Longhorn is .NET.
Kevin
|
|
|
|
|
I use SetItemText to store title,that's ok.but SetItemData store URL have some question.why result is often wrong?
how to use SetItemData?
very very thx poor english
insert an item to a tree
code:--------------------------------------------------------------------------------
for (int i = 0;...; i++)
{
....
htiChild = m_etc.InsertItem(m_strNewDir, hti, TVI_LAST);
CString strItemData= "www.aaa.com";
lpszItemData = new TCHAR[strItemData.GetLength()+1];
lpszItemData = (LPCTSTR)strItemData;
m_etc.SetItemData(htiChild, (DWORD)lpszItemData);
}
--------------------------------------------------------------------------------
save tree to a file
code:--------------------------------------------------------------------------------
for(..)
{LPCTSTR pItemData;
strTitle = GetItemText(hti);
pItemData = (LPCTSTR)GetItemData(hti);
CString strItemData(pItemData);
str = strTitle + strItemData;
save str
}
--------------------------------------------------------------------------------
lLoad the file to a tree
code:--------------------------------------------------------------------------------
for (iCount = 0; ...iCount++)
{
strItemText = strItem.Left(n);
lpszItemText = strItemText.GetBuffer();
strItemText.ReleaseBuffer();
strItemData = strItem.Right(strItem.GetLength() - n - 5);
lpszItemData = new TCHAR[strItemData.GetLength()+1];
lpszItemData = strItemData;
InsertItem(lpszItem, hParent, hInsertAfter);
SetItemData(htiSon, (DWORD)lpszItemData);
......
}
|
|
|
|
|
You need to study pointers a little more
lpszItemData = new TCHAR[strItemData.GetLength()+1];
lpszItemData = (LPCTSTR)strItemData;
That's not going to work. You must copy the memory from the source string to the target string not just assign the pointer. Also you have a memory leak since you lost the memory address that was allocated with "new".
Try this to start with http://www.codeproject.com/cpp/pointers.asp[^]
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I like to use greek letters and subcript indexes for mathematical expressions and formulas in dialog forms and output strings of my Visual C++ MFC programs. Can some one explain how to do that.
Thanks
|
|
|
|
|
You do this by selecting appropriate fonts when outputting. For editable text, you will want to use the Rich edit control. For captions, you'll need CStatics with font-setting capabilities.
For both types of controls, you'll find a multitude of articles on this site.
|
|
|
|
|
Hi
I have a simple question on where to put #include statements. Should I put them in .h file, or in .cpp file? For example, I have a class A in A.h and A.cpp. Class A uses STL vector, so is it better for me to #include <vector> in A.h or A.cpp? ANd how about using keyword? Should I write using std::vector in A.h or A.cpp?
Thanks!
|
|
|
|
|
normally you include A.h in A.cpp
if you need to declare eg a vector in your .h file you need to use the #include here, if not, you still can put it here (because you include your A.h in your .cpp) or put it in your .cpp.
I'm not sure of the reason of putting includes in the cpp files, but I think it's because of inheretence of other files from your .h.
hope this helps.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Indrawati wrote:
how about using keyword? Should I write using std::vector in A.h or A.cpp?
You should never use the using keyword in your .h files. This way, you pollute the global namespace. It may not result in disaster for using std::vector, but you never know...
If you really want to use the using keyword, put it in the .cpp file.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
The #includes can be in either. But a common approach is to put them in the .h.
So, in A.h
#include <vector>
// Use namespace qualifier std::
void foo(const std::vector& vec);
In the A.cpp
#include "A.h"
using namespace std;
void A::foo(const vector& vec)
{
}
But never put using namespace std;
in the header.
Kevin
|
|
|
|
|
If whatever you need to include also needs to be include in another file to work with your class (say for instance, one member returns a vector), then put the include in the header file.
Also, if your class (or whatever) encapsulates all dependencies then do not put the includes in the header file.
Jeremy Falcon
|
|
|
|
|
If the cpp uses the functions inside the h files put in the cpp otherwise put them somewhere where the functions could be used by the program.
It is advisable that you make a .h file that stores all the .h files you need.
for ex:
storing_h_files.cpp should be loking like this:
#include storing_h_files.h
storing_h_files.h should be loking like this:
#ifndef storing_h_files
#define storing_h_files
#include <afxwin.h>
#include <afxext.h>
#include <afxdisp.h>
#include <afxdtctl.h>
#include <afxcmn.h>
.
.
.
.
.
.
.
#endif
gabby
|
|
|
|
|
How can I display My Computer folder in a CFileDialog? I tried with SHGetSpecialFolderPath , but the path is empty, i believe because Ny Computer is a vitual folder, not a system one or a real one.Thank you.
|
|
|
|
|
you can set a default directory if your CFileDialog opens.
look into the ONF structure or something.
Don't know if it will work with Virtual Folders though.
Good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Only some CSIDLs are supported with SHGetFolderPath() , and CSIDL_DRIVES is not one of them. You can, however, use CSIDL_DRIVES in conjunction with SHBrowseForFolder() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|