|
see here[^]
maybe it is some helpful to you
|
|
|
|
|
actually this result as well hr=INVALID_ARG.......
help??
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
use CSIDL_PERSONAL
it seem that your problem is same with
here[^]
|
|
|
|
|
10x!
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Do you want to create a file in the My Documents folder?
This is from the VS 2005 help file:
szPath will contain the path to My Documents.
If you just want the path in szPath, and don't need to create a file, then don't send in the CSIDL_FLAG_CREATE flag.
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_PERSONAL|CSIDL_FLAG_CREATE,
NULL,
0,
szPath)))
{
PathAppend(szPath, TEXT("New Doc.txt"));
HANDLE hFile = CreateFile(szPath, ...);
}
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|
|
10x!
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
hi all
for example if I have
CString sVal = _T("something");
how to assign sVal to a const char * variable ?
const char * pVal = ... ?
thanks
|
|
|
|
|
|
big_denny_200 wrote: const char * pVal = ... ?
Try this
const char * pVal = (LPCTSTR)sVal;
Large cats have been scientifically proven to dream. Among the recurring themes are balls of yarn, mice, and half-blind overweight shackled oryx.
|
|
|
|
|
CString str=_T("Hello");
const char *buffer;
buffer=(const char*)LocalAlloc(LPTR,20);
strcpy((char*)buffer,str);
LocalFree((HLOCAL)buffer);
|
|
|
|
|
Monty2 wrote: Try this
const char * pVal = (LPCTSTR)sVal;
Can I add something?
Using this way we have to be carefull using pVal in WRITE mode: the pointer points to the local CString object!
Hope it helps.
|
|
|
|
|
_Russell_ wrote: Using this way we have to be carefull using pVal in WRITE mode: the pointer points to the local CString object!
Ofcourse
Thanks for the correction.
Large cats have been scientifically proven to dream. Among the recurring themes are balls of yarn, mice, and half-blind overweight shackled oryx.
|
|
|
|
|
const char * pVal = sVal.c_str();
|
|
|
|
|
The other answers won't work in a Unicode build. You need to convert your CString to ANSI to assign it to a char* variable. The quickest way is:
#include <atlconv.h>
{
USES_CONVERSION;
CString sVal = _T("something");
const char* p = T2CA(LPCTSTR(sVal));
}
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hello,
How can I check on which paltform the program is running?
(Such as: windows 2003, NT, 98 etc).
Thanks.
-- modified at 9:34 Monday 8th May, 2006
|
|
|
|
|
Try GetVersionEx[^]
Large cats have been scientifically proven to dream. Among the recurring themes are balls of yarn, mice, and half-blind overweight shackled oryx.
|
|
|
|
|
What are the advantages of unmanaged code over managed code and vice versa?
|
|
|
|
|
acemahesh@yahoo.co.in wrote: the advantages of unmanaged code over managed code and vice versa
Freedom, flexibility, ...
Maxwell Chen
|
|
|
|
|
I have created an applicatio having six child dialog. WHen you press ALT+Tab when window is in focus another window which was in focus gets displayed and again if I try doing the same thing the orginal window is displayed .....
But one of my child dialog some thread are executing and IF i press ALT+tab to display it again the windows does not appears but the process continues. When the threads process is completed the window functions well...
I tried with VK_TAB and VK_ALT but it does not work
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Ganesh_T wrote: But one of my child dialog some thread are executing
Are you sure that there is another thread rather than the main thread is doing the process?
- NS -
|
|
|
|
|
yes I am starting five threads.....by AfxBeginThread
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Ganesh_T wrote: yes I am starting five threads
And you talk of six child windows...
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I am starting these all threads from one of my child dialog.
I am not starting threads for creating the child dialogs
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Ganesh_T wrote: But one of my child dialog some thread are executing and IF i press ALT+tab to display it again the windows does not appears but the process continues. When the threads process is completed the window functions well...
That's because the thread isn't processing window messages, so the dialog can't repaint.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hi Every one,
I'm programming in VC++ and I created a dll(MFC dll) with VC++,in this dll I'd like to have a function that export to out,I can do it ,but when I declare DllRegisterServer function I can't export it.
My code is same as folowing code:
__declspec(dllexport) STDAPI DllRegisterServer(void);
how can I export DllRegisterServer or DllUnregisterServer function that implemented in a dll ?
Please help me.
Best Regards.
Orchid
|
|
|
|