|
use string.c_str() function it will return LPCTSTR string associated with stored string!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
i should use strin.c_str() instead of what? what is a LPCTSTR?
could you write it. Like:
string s1;<br />
getline(list,s1);
fstream fichier1;<br />
fichier1.open(s1,ios::in);
Thank you very much
|
|
|
|
|
fichier1.open(s1.c_str(),ios::in);
|
|
|
|
|
thank you very much for your help!
|
|
|
|
|
LPCTSTR is an LPCWSTR in UNICODE builds and a LPCSTR otherwise.
A LPCSTR is a Long Pointer on a Constant STRing, a LPCWSTR a Long Pointer on a Constant Wide STRing.
All WIN32 stuff.
|
|
|
|
|
Allright thank you for this information.
|
|
|
|
|
how to read stl files in binary format using mfc?
|
|
|
|
|
saisp wrote: how to read stl files in binary format using mfc?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
yes i have seen this. but this code reads only ascii format files. i have to read both. if i convert binary to ascii the file is not valid one. since the string value is not there. how to convert binary to ascii
|
|
|
|
|
I dont know much about STL format, however check VTK.
There should be an example showing how to use VTK with MFC.
|
|
|
|
|
Thank you!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Hi,
i have a very old project without unicode support that i wanted to modernize a bit. Especially the user interface should get the new windows xp or vista control-style. But it doesn't works completly . The Dialog Controls don't wanted to switch to the new style. I tried everything i've found in the net but nothing works. Then i created a new project (mfc-application, dialog based) where i just open a about box to start some tests. The first result was:
The Button and the Icon are drawn in XP Style
Then i compared every option in the project settings and all include-files and #defines in the stdafx.h to my own project and changed one by one to find out whats wrong.
When i changed the character set from Unicode to Multi Byte i got this dialog box:
The Button and the Icon are drawn in Old Style
I really don't understand why this switch leads to this old window styles. But the bigger problem is: my own application is written completly for Multi Byte Character Set. And its a VERY Big Application. It will take days to convert it to Unicode and since there are things like text parsers included it will not be easy to be sure that everything runs fine after the conversion.
It would be nice if there is a way to get around this problem without switching to unicode.
Does someone know this problem and how to go around?
Thanks in advance.
Best Regards,
Florian
-- modified at 5:28 Friday 27th July, 2007
|
|
|
|
|
Should have used the generic text routine mappings from the start
Is it just a manifest problem?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
I'm trying to let my application run another application and give it write permission. At the moment i'm using CreateProcess, but can't figure out how to grant the process write permissions..
Tried googling alot, but can't find too many examples.. =/
Can anyone help me..?
Thanks!
|
|
|
|
|
in a bit of a rush... so sorry if this isnt much help
i believe off the top of my head that it depends on how the process is created and under which user rights it is, to allow writing and general interaction.
you want to use
CreateProcessAsUser()[^]
and either get the user account logon or run under impersonation token.
that should fix your problem
|
|
|
|
|
Thanks!
I've tried with CreateProcessAsUser, but i can't figure out how to get the token without knowing the username and password..?
|
|
|
|
|
just taken this from one of my services from awhile ago
it should be set up correct
<br />
STARTUPINFO startupInfo;<br />
PROCESS_INFORMATION pi={0};<br />
LPTSTR szCmdline=_tcsdup(L"");<br />
<br />
ZeroMemory(&startupInfo, sizeof(STARTUPINFO)); <br />
ZeroMemory(&pi, sizeof(pi));<br />
<br />
startupInfo.cb = sizeof(STARTUPINFO); <br />
startupInfo.lpReserved = NULL; <br />
startupInfo.lpDesktop = TEXT("winsta0\\default"); <br />
startupInfo.lpTitle = NULL; <br />
startupInfo.dwX = 0; <br />
startupInfo.dwY = 0; <br />
startupInfo.dwXSize = 0; <br />
startupInfo.dwYSize = 0; <br />
startupInfo.dwXCountChars = 0; <br />
startupInfo.dwYCountChars = 0; <br />
startupInfo.dwFillAttribute =0; <br />
startupInfo.dwFlags = STARTF_USESHOWWINDOW; <br />
startupInfo.wShowWindow = SW_SHOW; <br />
startupInfo.cbReserved2 = 0; <br />
startupInfo.lpReserved2 = NULL; <br />
startupInfo.hStdInput = 0; <br />
startupInfo.hStdOutput = 0; <br />
startupInfo.hStdError = 0;<br />
<br />
<br />
HANDLE hndToken;<br />
HANDLE TDuplicate;<br />
TDuplicate = TOKEN_DUPLICATE;<br />
if(DuplicateTokenEx(TDuplicate, MAXIMUM_ALLOWED,NULL,SecurityImpersonation, TokenPrimary, &hndToken)==0)<br />
return 1;<br />
if (CreateProcessAsUser(<br />
hndToken,<br />
szCmdline,
NULL,
NULL,
NULL,
FALSE,
NULL,
NULL, <br />
NULL, <br />
&startupInfo, <br />
&pi ) != 0) <br />
{ <br />
WaitForSingleObject(pi.hProcess, INFINITE); <br />
<br />
<br />
CloseHandle (pi.hThread); <br />
CloseHandle (pi.hProcess); <br />
<br />
} <br />
else
{ <br />
Beep(700,100);<br />
return FALSE; <br />
} <br />
<br />
return 0;<br />
}
Modified:
p.s if anyone can see anything stupid in there let me know please
its from about a year ago and is in my library and i havent checked it before posting as its time for lunch
|
|
|
|
|
I have developed a directshow filter . My filter connects the
upstream filter successfully . when I play my filter graph
I got the following error
cannot allocate memory because no size has been set
(return code 0x8004022)
RajeshGupta
|
|
|
|
|
code?
[Insert Witty Sig Here]
|
|
|
|
|
this is my code
//----------------------------------------------------------------
HRESULT CNetRecievePin::DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pRequest)
{
HRESULT hr;
CAutoLock cAutoLock(m_pFilter->pStateLock());
CheckPointer(pAlloc, E_POINTER);
CheckPointer(pRequest, E_POINTER);
VIDEOINFOHEADER *pvi = (VIDEOINFOHEADER*) m_mt.Format();
//Ensure a minimum number of buffers
if (pRequest->cBuffers == 0)
{
pRequest->cBuffers =2;
}
pRequest->cbBuffer = pvi->bmiHeader.biSizeImage;
ALLOCATOR_PROPERTIES Actual;
hr = pAlloc->SetProperties(pRequest, &Actual);
if (FAILED(hr))
{
return E_FAIL;
}
//Is this allocator unsuitable?
if (Actual.cbBuffer < pRequest->cbBuffer)
{
return E_FAIL;
}
return S_OK;
}
//----------------------------------------------------------------------
RajeshGupta
|
|
|
|
|
how to let all contents tabs of html-help expand when the htmp-file pops up by HtmpHelp(...) function?
it can be done in html-help design or c++ code.
I did see some apps with contents tabs expended when apps' html-help pop up.
thx.
|
|
|
|
|
I have one source code of project in which our dll is used that source code is not full source code the client give us obj file instead of cpp and we fix bugs of our dll now linking error occur when i execute that program with new dll. pls help me if anybody have any idea.
Thanks in advance
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Maybe (i.e. post error messages for meaningful help) you have changed function signatures.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|